aboutsummaryrefslogtreecommitdiff
path: root/src/internal.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-09-05 15:41:40 +0200
committerGitHub <noreply@github.com>2021-09-05 15:41:40 +0200
commit71b372e6f08b2f40fbd043c80b56bdb8d2c0b5a0 (patch)
treeeaae225629ae6101db6094b046f319df4f6aba7a /src/internal.cpp
parent09367628bfe698d6a73a1b928bcf611ea675103d (diff)
parentb91af0075a7e8a189e2cd443a823a0798e0b9ed9 (diff)
downloadPROJ-71b372e6f08b2f40fbd043c80b56bdb8d2c0b5a0.tar.gz
PROJ-71b372e6f08b2f40fbd043c80b56bdb8d2c0b5a0.zip
Merge pull request #2841 from rouault/cppcheck_fixes
Cppcheck fixes
Diffstat (limited to 'src/internal.cpp')
-rw-r--r--src/internal.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/internal.cpp b/src/internal.cpp
index b96e2160..e934069f 100644
--- a/src/internal.cpp
+++ b/src/internal.cpp
@@ -83,11 +83,17 @@ chained calls starting out with a call to its 2D interface.
direction = static_cast<PJ_DIRECTION>(-direction);
switch (direction) {
case PJ_FWD:
- coo.xy = pj_fwd (coo.lp, P);
+ {
+ const auto xy = pj_fwd (coo.lp, P);
+ coo.xy = xy;
return coo;
+ }
case PJ_INV:
- coo.lp = pj_inv (coo.xy, P);
+ {
+ const auto lp = pj_inv (coo.xy, P);
+ coo.lp = lp;
return coo;
+ }
case PJ_IDENT:
break;
}
@@ -110,11 +116,17 @@ chained calls starting out with a call to its 3D interface.
direction = static_cast<PJ_DIRECTION>(-direction);
switch (direction) {
case PJ_FWD:
- coo.xyz = pj_fwd3d (coo.lpz, P);
+ {
+ const auto xyz = pj_fwd3d (coo.lpz, P);
+ coo.xyz = xyz;
return coo;
+ }
case PJ_INV:
- coo.lpz = pj_inv3d (coo.xyz, P);
+ {
+ const auto lpz = pj_inv3d (coo.xyz, P);
+ coo.lpz = lpz;
return coo;
+ }
case PJ_IDENT:
break;
}