From 4330f9fa4391b4d39c52c972c75327ed2ba6ce33 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 28 Oct 2019 09:03:10 +0100 Subject: Various fixes/workarounds to make cppcheck 1.72 (Ubuntu 16.04) and HEAD/1.90dev happy (fixes #1648) --- src/projections/stere.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/projections/stere.cpp') 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(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) { -- cgit v1.2.3