diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-09-05 15:41:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-05 15:41:40 +0200 |
| commit | 71b372e6f08b2f40fbd043c80b56bdb8d2c0b5a0 (patch) | |
| tree | eaae225629ae6101db6094b046f319df4f6aba7a /src/inv.cpp | |
| parent | 09367628bfe698d6a73a1b928bcf611ea675103d (diff) | |
| parent | b91af0075a7e8a189e2cd443a823a0798e0b9ed9 (diff) | |
| download | PROJ-71b372e6f08b2f40fbd043c80b56bdb8d2c0b5a0.tar.gz PROJ-71b372e6f08b2f40fbd043c80b56bdb8d2c0b5a0.zip | |
Merge pull request #2841 from rouault/cppcheck_fixes
Cppcheck fixes
Diffstat (limited to 'src/inv.cpp')
| -rw-r--r-- | src/inv.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/inv.cpp b/src/inv.cpp index 8925f0e9..92b3c1d6 100644 --- a/src/inv.cpp +++ b/src/inv.cpp @@ -151,9 +151,15 @@ PJ_LP pj_inv(PJ_XY xy, PJ *P) { /* Do the transformation, using the lowest dimensional transformer available */ if (P->inv) - coo.lp = P->inv(coo.xy, P); + { + const auto lp = P->inv(coo.xy, P); + coo.lp = lp; + } else if (P->inv3d) - coo.lpz = P->inv3d (coo.xyz, P); + { + const auto lpz = P->inv3d (coo.xyz, P); + coo.lpz = lpz; + } else if (P->inv4d) coo = P->inv4d (coo, P); else { @@ -185,11 +191,17 @@ PJ_LPZ pj_inv3d (PJ_XYZ xyz, PJ *P) { /* Do the transformation, using the lowest dimensional transformer feasible */ if (P->inv3d) - coo.lpz = P->inv3d (coo.xyz, P); + { + const auto lpz = P->inv3d (coo.xyz, P); + coo.lpz = lpz; + } else if (P->inv4d) coo = P->inv4d (coo, P); else if (P->inv) - coo.lp = P->inv (coo.xy, P); + { + const auto lp = P->inv (coo.xy, P); + coo.lp = lp; + } else { proj_errno_set (P, PROJ_ERR_OTHER_NO_INVERSE_OP); return proj_coord_error ().lpz; @@ -219,9 +231,15 @@ PJ_COORD pj_inv4d (PJ_COORD coo, PJ *P) { if (P->inv4d) coo = P->inv4d (coo, P); else if (P->inv3d) - coo.lpz = P->inv3d (coo.xyz, P); + { + const auto lpz = P->inv3d (coo.xyz, P); + coo.lpz = lpz; + } else if (P->inv) - coo.lp = P->inv (coo.xy, P); + { + const auto lp = P->inv (coo.xy, P); + coo.lp = lp; + } else { proj_errno_set (P, PROJ_ERR_OTHER_NO_INVERSE_OP); return proj_coord_error (); |
