aboutsummaryrefslogtreecommitdiff
path: root/src/projections/robin.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/robin.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/robin.cpp')
-rw-r--r--src/projections/robin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/projections/robin.cpp b/src/projections/robin.cpp
index 5a3b081c..3c4d9f07 100644
--- a/src/projections/robin.cpp
+++ b/src/projections/robin.cpp
@@ -101,8 +101,7 @@ static PJ_XY robin_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forwar
static PJ_LP robin_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
PJ_LP lp = {0.0,0.0};
- long i;
- double t, t1;
+ double t;
struct COEFS T;
int iters;
@@ -119,7 +118,7 @@ static PJ_LP robin_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, invers
}
} else { /* general problem */
/* in Y space, reduce to table interval */
- i = isnan(lp.phi) ? -1 : lround(floor(lp.phi * NODES));
+ long i = isnan(lp.phi) ? -1 : lround(floor(lp.phi * NODES));
if( i < 0 || i >= NODES ) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return lp;
@@ -133,7 +132,8 @@ static PJ_LP robin_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, invers
/* first guess, linear interp */
t = 5. * (lp.phi - T.c0)/(Y[i+1].c0 - T.c0);
for (iters = MAX_ITER; iters ; --iters) { /* Newton-Raphson */
- t -= t1 = (V(T,t) - lp.phi) / DV(T,t);
+ const double t1 = (V(T,t) - lp.phi) / DV(T,t);
+ t -= t1;
if (fabs(t1) < EPS)
break;
}