From f773897a3025438326c1131e1586d9ddae080c4f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 29 May 2018 22:45:18 +0200 Subject: Fix warnings found by clang with new warning flags to be added in later commit Fixes consist in: - no use of comma operator for multi statement purpose - avoid confusing comma in for loops first and third clauses - avoid implicit long to int casts by storing to long, or explicit bound checking before cast --- src/geodesic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/geodesic.c') diff --git a/src/geodesic.c b/src/geodesic.c index 3fcfd1c9..220dcd7f 100644 --- a/src/geodesic.c +++ b/src/geodesic.c @@ -932,8 +932,9 @@ static real geod_geninverse_int(const struct geod_geodesic* g, unsigned numit = 0; /* Bracketing range */ real salp1a = tiny, calp1a = 1, salp1b = tiny, calp1b = -1; - boolx tripn, tripb; - for (tripn = FALSE, tripb = FALSE; numit < maxit2; ++numit) { + boolx tripn = FALSE; + boolx tripb = FALSE; + for (; numit < maxit2; ++numit) { /* the WGS84 test set: mean = 1.47, sd = 1.25, max = 16 * WGS84 and random input: mean = 2.85, sd = 0.60 */ real dv = 0, -- cgit v1.2.3