aboutsummaryrefslogtreecommitdiff
path: root/src/conversions
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversions')
-rw-r--r--src/conversions/cart.cpp6
-rw-r--r--src/conversions/unitconvert.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/conversions/cart.cpp b/src/conversions/cart.cpp
index 5175599a..a134bc6a 100644
--- a/src/conversions/cart.cpp
+++ b/src/conversions/cart.cpp
@@ -212,7 +212,8 @@ static PJ_XY cart_forward (PJ_LP lp, PJ *P) {
point.lp = lp;
point.lpz.z = 0;
- point.xyz = cartesian (point.lpz, P);
+ const auto xyz = cartesian (point.lpz, P);
+ point.xyz = xyz;
return point.xy;
}
@@ -222,7 +223,8 @@ static PJ_LP cart_reverse (PJ_XY xy, PJ *P) {
point.xy = xy;
point.xyz.z = 0;
- point.lpz = geodetic (point.xyz, P);
+ const auto lpz = geodetic (point.xyz, P);
+ point.lpz = lpz;
return point.lp;
}
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;