| 105 | } |
| 106 | |
| 107 | static void pj_vgridshift_forward_4d(PJ_COORD &coo, PJ *P) { |
| 108 | struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque; |
| 109 | |
| 110 | /* If transformation is not time restricted, we always call it */ |
| 111 | if (Q->t_final == 0 || Q->t_epoch == 0) { |
| 112 | // Assigning in 2 steps avoids cppcheck warning |
| 113 | // "Overlapping read/write of union is undefined behavior" |
| 114 | // Cf |
| 115 | // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710 |
| 116 | const auto xyz = pj_vgridshift_forward_3d(coo.lpz, P); |
| 117 | coo.xyz = xyz; |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | /* Time restricted - only apply transform if within time bracket */ |
| 122 | if (coo.lpzt.t < Q->t_epoch && Q->t_final > Q->t_epoch) { |
| 123 | // Assigning in 2 steps avoids cppcheck warning |
| 124 | // "Overlapping read/write of union is undefined behavior" |
| 125 | // Cf |
| 126 | // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710 |
| 127 | const auto xyz = pj_vgridshift_forward_3d(coo.lpz, P); |
| 128 | coo.xyz = xyz; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | static void pj_vgridshift_reverse_4d(PJ_COORD &coo, PJ *P) { |
| 133 | struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque; |
nothing calls this directly
no test coverage detected