aboutsummaryrefslogtreecommitdiff
path: root/src/projections/stere.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-10-28 10:41:39 +0100
committerGitHub <noreply@github.com>2019-10-28 10:41:39 +0100
commitd9b9afe2b9921b0b3624095b60cca7d630cae67a (patch)
tree7865bf5e9b3d7b293f207c10a24fe965a114cfce /src/projections/stere.cpp
parente2d5b13f3442a8e88093a9d68e1be550194a4d77 (diff)
parent7026fa2241d4e42ac35688487b7c7dd4d7f8bad1 (diff)
downloadPROJ-d9b9afe2b9921b0b3624095b60cca7d630cae67a.tar.gz
PROJ-d9b9afe2b9921b0b3624095b60cca7d630cae67a.zip
Merge pull request #1697 from rouault/cppcheck_fixes
Fixes/workaround to be able to use cppcheck from Ubuntu 16.04 (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) {