diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-09-04 18:00:20 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-09-04 18:01:11 +0200 |
| commit | a767ae5d14063f3df1a3af994f26915f973de408 (patch) | |
| tree | acd84b4c078ac55cb587297737f57b92c9baf9c9 /src/conversions/unitconvert.cpp | |
| parent | 49c0ef87bad8de7d3351b99eeae0e437adc60f0b (diff) | |
| download | PROJ-a767ae5d14063f3df1a3af994f26915f973de408.tar.gz PROJ-a767ae5d14063f3df1a3af994f26915f973de408.zip | |
Workaround 'Overlapping read/write of union is undefined behavior' cppcheck warning (but really fixing them would be more involved)
Diffstat (limited to 'src/conversions/unitconvert.cpp')
| -rw-r--r-- | src/conversions/unitconvert.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp index 187acf17..d584d93f 100644 --- a/src/conversions/unitconvert.cpp +++ b/src/conversions/unitconvert.cpp @@ -322,7 +322,8 @@ static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) { point.lpz = lpz; /* take care of the horizontal components in the 2D function */ - point.xy = forward_2d(point.lp, P); + const auto xy = forward_2d(point.lp, P); + point.xy = xy; point.xyz.z *= Q->z_factor; @@ -339,7 +340,8 @@ static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) { point.xyz = xyz; /* take care of the horizontal components in the 2D function */ - point.lp = reverse_2d(point.xy, P); + const auto lp = reverse_2d(point.xy, P); + point.lp = lp; point.xyz.z /= Q->z_factor; |
