diff options
| author | Charles Karney <charles.karney@sri.com> | 2019-10-01 18:17:03 -0400 |
|---|---|---|
| committer | Charles Karney <charles.karney@sri.com> | 2019-10-01 18:17:03 -0400 |
| commit | cdd2a72f647c12211f278e7fa3c647772fa85d9f (patch) | |
| tree | 65c48619ae2065a97bbedcd08b5dffedd7bef6d9 /src/geodesic.c | |
| parent | 50a182148d188c21f2bed6399090ebad96fe11cb (diff) | |
| download | PROJ-cdd2a72f647c12211f278e7fa3c647772fa85d9f.tar.gz PROJ-cdd2a72f647c12211f278e7fa3c647772fa85d9f.zip | |
Fix some Cppcheck complaints in geodesic routines
Diffstat (limited to 'src/geodesic.c')
| -rw-r--r-- | src/geodesic.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/geodesic.c b/src/geodesic.c index 02887e10..7d612d3f 100644 --- a/src/geodesic.c +++ b/src/geodesic.c @@ -91,12 +91,16 @@ static void Init() { #if defined(NAN) NaN = NAN; /* NAN is defined in C99 */ #else +#if HAVE_C99_MATH + NaN = nan("0"); +#else { real minus1 = -1; /* cppcheck-suppress wrongmathcall */ NaN = sqrt(minus1); } #endif +#endif init = 1; } } @@ -546,7 +550,7 @@ real geod_genposition(const struct geod_geodesicline* l, (pS12 ? GEOD_AREA : GEOD_NONE); outmask &= l->caps & OUT_ALL; - if (!( TRUE /*Init()*/ && + if (!( /*Init() &&*/ (flags & GEOD_ARCMODE || (l->caps & (GEOD_DISTANCE_IN & OUT_ALL))) )) /* Uninitialized or impossible distance calculation requested */ return NaN; |
