aboutsummaryrefslogtreecommitdiff
path: root/src/projections/stere.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-10-28 09:03:10 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-10-28 09:03:10 +0100
commit4330f9fa4391b4d39c52c972c75327ed2ba6ce33 (patch)
treed2718cc258d02faee018c96602f84c814cba5fce /src/projections/stere.cpp
parente2d5b13f3442a8e88093a9d68e1be550194a4d77 (diff)
downloadPROJ-4330f9fa4391b4d39c52c972c75327ed2ba6ce33.tar.gz
PROJ-4330f9fa4391b4d39c52c972c75327ed2ba6ce33.zip
Various fixes/workarounds to make cppcheck 1.72 (Ubuntu 16.04) and HEAD/1.90dev happy (fixes #1648)
Diffstat (limited to 'src/projections/stere.cpp')
-rw-r--r--src/projections/stere.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/projections/stere.cpp b/src/projections/stere.cpp
index afcf5f02..a1bd41e7 100644
--- a/src/projections/stere.cpp
+++ b/src/projections/stere.cpp
@@ -141,7 +141,6 @@ static PJ_LP stere_e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, invers
PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, sinphi, tp=0.0, phi_l=0.0, rho, halfe=0.0, halfpi=0.0;
- int i;
rho = hypot (xy.x, xy.y);
@@ -171,7 +170,7 @@ static PJ_LP stere_e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, invers
break;
}
- for (i = NITER; i--; ) {
+ for (int i = NITER; i > 0; --i) {
sinphi = P->e * sin(phi_l);
lp.phi = 2. * atan (tp * pow ((1.+sinphi)/(1.-sinphi), halfe)) - halfpi;
if (fabs (phi_l - lp.phi) < CONV) {