aboutsummaryrefslogtreecommitdiff
path: root/src/geodesic.c
diff options
context:
space:
mode:
authorCharles Karney <charles.karney@sri.com>2019-10-01 18:17:03 -0400
committerCharles Karney <charles.karney@sri.com>2019-10-01 18:17:03 -0400
commitcdd2a72f647c12211f278e7fa3c647772fa85d9f (patch)
tree65c48619ae2065a97bbedcd08b5dffedd7bef6d9 /src/geodesic.c
parent50a182148d188c21f2bed6399090ebad96fe11cb (diff)
downloadPROJ-cdd2a72f647c12211f278e7fa3c647772fa85d9f.tar.gz
PROJ-cdd2a72f647c12211f278e7fa3c647772fa85d9f.zip
Fix some Cppcheck complaints in geodesic routines
Diffstat (limited to 'src/geodesic.c')
-rw-r--r--src/geodesic.c6
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;