| 130 | } |
| 131 | |
| 132 | static void pj_vgridshift_reverse_4d(PJ_COORD &coo, PJ *P) { |
| 133 | struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque; |
| 134 | |
| 135 | /* If transformation is not time restricted, we always call it */ |
| 136 | if (Q->t_final == 0 || Q->t_epoch == 0) { |
| 137 | // Assigning in 2 steps avoids cppcheck warning |
| 138 | // "Overlapping read/write of union is undefined behavior" |
| 139 | // Cf |
| 140 | // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710 |
| 141 | const auto lpz = pj_vgridshift_reverse_3d(coo.xyz, P); |
| 142 | coo.lpz = lpz; |
| 143 | return; |
| 144 | } |
| 145 | |
| 146 | /* Time restricted - only apply transform if within time bracket */ |
| 147 | if (coo.lpzt.t < Q->t_epoch && Q->t_final > Q->t_epoch) { |
| 148 | // Assigning in 2 steps avoids cppcheck warning |
| 149 | // "Overlapping read/write of union is undefined behavior" |
| 150 | // Cf |
| 151 | // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710 |
| 152 | const auto lpz = pj_vgridshift_reverse_3d(coo.xyz, P); |
| 153 | coo.lpz = lpz; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | static PJ *pj_vgridshift_destructor(PJ *P, int errlev) { |
| 158 | if (nullptr == P) |
nothing calls this directly
no test coverage detected