aboutsummaryrefslogtreecommitdiff
path: root/src/projections/natearth2.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-06 20:38:38 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-03-08 19:58:35 +0100
commit60d3df673ca224107eb63e459073fc11ab5f4f16 (patch)
tree52c871c17f0c98c90ce6415cdb79dc1e73c14f4d /src/projections/natearth2.cpp
parent38ec5e662a74d40e02e38dc5dca553c3ecb04356 (diff)
downloadPROJ-60d3df673ca224107eb63e459073fc11ab5f4f16.tar.gz
PROJ-60d3df673ca224107eb63e459073fc11ab5f4f16.zip
src/projections/: remove assignments in expression and multiple statements per line
Should hopefully result in no change in results, and hopefully more readable code...
Diffstat (limited to 'src/projections/natearth2.cpp')
-rw-r--r--src/projections/natearth2.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/projections/natearth2.cpp b/src/projections/natearth2.cpp
index 95d73c36..d149ca85 100644
--- a/src/projections/natearth2.cpp
+++ b/src/projections/natearth2.cpp
@@ -51,7 +51,7 @@ static PJ_XY natearth2_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, fo
static PJ_LP natearth2_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
PJ_LP lp = {0.0,0.0};
- double yc, tol, y2, y4, y6, f, fder;
+ double yc, y2, y4, y6, f, fder;
int i;
(void) P;
@@ -69,7 +69,8 @@ static PJ_LP natearth2_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, in
y4 = y2 * y2;
f = (yc * (B0 + y4 * y4 * (B1 + B2 * y2 + B3 * y4))) - xy.y;
fder = C0 + y4 * y4 * (C1 + C2 * y2 + C3 * y4);
- yc -= tol = f / fder;
+ const double tol = f / fder;
+ yc -= tol;
if (fabs(tol) < EPS) {
break;
}