| 75 | } |
| 76 | |
| 77 | static void pj_hgridshift_forward_4d(PJ_COORD &coo, PJ *P) { |
| 78 | struct hgridshiftData *Q = (struct hgridshiftData *)P->opaque; |
| 79 | |
| 80 | /* If transformation is not time restricted, we always call it */ |
| 81 | if (Q->t_final == 0 || Q->t_epoch == 0) { |
| 82 | // Assigning in 2 steps avoids cppcheck warning |
| 83 | // "Overlapping read/write of union is undefined behavior" |
| 84 | // Cf |
| 85 | // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710 |
| 86 | const auto xyz = pj_hgridshift_forward_3d(coo.lpz, P); |
| 87 | coo.xyz = xyz; |
| 88 | return; |
| 89 | } |
| 90 | |
| 91 | /* Time restricted - only apply transform if within time bracket */ |
| 92 | if (coo.lpzt.t < Q->t_epoch && Q->t_final > Q->t_epoch) { |
| 93 | // Assigning in 2 steps avoids cppcheck warning |
| 94 | // "Overlapping read/write of union is undefined behavior" |
| 95 | // Cf |
| 96 | // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710 |
| 97 | const auto xyz = pj_hgridshift_forward_3d(coo.lpz, P); |
| 98 | coo.xyz = xyz; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | static void pj_hgridshift_reverse_4d(PJ_COORD &coo, PJ *P) { |
| 103 | struct hgridshiftData *Q = (struct hgridshiftData *)P->opaque; |
nothing calls this directly
no test coverage detected