aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-02-26 12:05:24 +0100
committerEven Rouault <even.rouault@spatialys.com>2017-02-26 12:43:40 +0100
commit8eb46dbbb63d7a880ac787561c907491cffc0917 (patch)
tree2d197951da4cf7a62e9f27728fc87995ffa4c7d6 /src
parent89b273a10a5ca97510d7bf2c6970c4c2ff5cd740 (diff)
downloadPROJ-8eb46dbbb63d7a880ac787561c907491cffc0917.tar.gz
PROJ-8eb46dbbb63d7a880ac787561c907491cffc0917.zip
Recent clang (e.g MacOSX) warning fixes related to double to _Bool implicit conversions
Diffstat (limited to 'src')
-rw-r--r--src/PJ_aeqd.c2
-rw-r--r--src/PJ_aitoff.c4
-rw-r--r--src/PJ_bonne.c2
-rw-r--r--src/PJ_calcofi.c2
-rw-r--r--src/PJ_cea.c2
-rw-r--r--src/PJ_chamb.c4
-rw-r--r--src/PJ_fouc_s.c2
-rw-r--r--src/PJ_geos.c4
-rw-r--r--src/PJ_gn_sinu.c6
-rw-r--r--src/PJ_healpix.c4
-rw-r--r--src/PJ_imw_p.c8
-rw-r--r--src/PJ_laea.c4
-rw-r--r--src/PJ_merc.c2
-rw-r--r--src/PJ_mod_ster.c6
-rw-r--r--src/PJ_poly.c2
-rw-r--r--src/PJ_qsc.c6
-rw-r--r--src/PJ_stere.c4
-rw-r--r--src/PJ_sterea.c2
-rw-r--r--src/PJ_tmerc.c4
-rw-r--r--src/geod_set.c2
-rw-r--r--src/mk_cheby.c4
-rw-r--r--src/pj_ell_set.c4
-rw-r--r--src/pj_factors.c4
-rw-r--r--src/pj_init.c8
-rw-r--r--src/proj.c2
-rw-r--r--src/proj_etmerc.c2
-rw-r--r--src/rtodms.c2
27 files changed, 50 insertions, 48 deletions
diff --git a/src/PJ_aeqd.c b/src/PJ_aeqd.c
index 92b81748..b10bfd62 100644
--- a/src/PJ_aeqd.c
+++ b/src/PJ_aeqd.c
@@ -278,7 +278,7 @@ PJ *PROJECTION(aeqd) {
Q->sinph0 = sin(P->phi0);
Q->cosph0 = cos(P->phi0);
}
- if (! P->es) {
+ if (P->es == 0.0) {
P->inv = s_inverse;
P->fwd = s_forward;
} else {
diff --git a/src/PJ_aitoff.c b/src/PJ_aitoff.c
index e85f6391..faab9aba 100644
--- a/src/PJ_aitoff.c
+++ b/src/PJ_aitoff.c
@@ -53,7 +53,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
struct pj_opaque *Q = P->opaque;
double c, d;
- if((d = acos(cos(lp.phi) * cos(c = 0.5 * lp.lam)))) {/* basic Aitoff */
+ if((d = acos(cos(lp.phi) * cos(c = 0.5 * lp.lam))) != 0.0) {/* basic Aitoff */
xy.x = 2. * d * cos(lp.phi) * sin(c) * (xy.y = 1. / sin(d));
xy.y *= d * sin(lp.phi);
} else
@@ -129,7 +129,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
if ((fabs(fabs(lp.phi) - M_PI_2) < EPSILON) && (!Q->mode)) lp.lam = 0.; /* if pole in Aitoff, return longitude of 0 */
/* calculate x,y coordinates with solution obtained */
- if((D = acos(cos(lp.phi) * cos(C = 0.5 * lp.lam)))) {/* Aitoff */
+ if((D = acos(cos(lp.phi) * cos(C = 0.5 * lp.lam))) != 0.0) {/* Aitoff */
x = 2. * D * cos(lp.phi) * sin(C) * (y = 1. / sin(D));
y *= D * sin(lp.phi);
} else
diff --git a/src/PJ_bonne.c b/src/PJ_bonne.c
index 47793ed6..ca076f56 100644
--- a/src/PJ_bonne.c
+++ b/src/PJ_bonne.c
@@ -102,7 +102,7 @@ PJ *PROJECTION(bonne) {
Q->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
if (fabs(Q->phi1) < EPS10) E_ERROR(-23);
- if (P->es) {
+ if (P->es != 0.0) {
Q->en = pj_enfn(P->es);
Q->m1 = pj_mlfn(Q->phi1, Q->am1 = sin(Q->phi1),
c = cos(Q->phi1), Q->en);
diff --git a/src/PJ_calcofi.c b/src/PJ_calcofi.c
index 0f206155..ebffd4f5 100644
--- a/src/PJ_calcofi.c
+++ b/src/PJ_calcofi.c
@@ -155,7 +155,7 @@ static void freeup (PJ *P) {
PJ *PROJECTION(calcofi) {
P->opaque = 0;
- if (P->es) { /* ellipsoid */
+ if (P->es != 0.0) { /* ellipsoid */
P->inv = e_inverse;
P->fwd = e_forward;
} else { /* sphere */
diff --git a/src/PJ_cea.c b/src/PJ_cea.c
index eb6435ab..d6dcd471 100644
--- a/src/PJ_cea.c
+++ b/src/PJ_cea.c
@@ -79,7 +79,7 @@ PJ *PROJECTION(cea) {
E_ERROR(-24);
}
}
- if (P->es) {
+ if (P->es != 0.0) {
t = sin(t);
P->k0 /= sqrt(1. - P->es * t * t);
P->e = sqrt(P->es);
diff --git a/src/PJ_chamb.c b/src/PJ_chamb.c
index 6bacbbe9..eb3ed479 100644
--- a/src/PJ_chamb.c
+++ b/src/PJ_chamb.c
@@ -59,7 +59,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
for (i = 0; i < 3; ++i) { /* dist/azimiths from control */
v[i] = vect(P->ctx, lp.phi - Q->c[i].phi, Q->c[i].cosphi, Q->c[i].sinphi,
cosphi, sinphi, lp.lam - Q->c[i].lam);
- if ( ! v[i].r)
+ if (v[i].r == 0.0)
break;
v[i].Az = adjlon(v[i].Az - Q->c[i].v.Az);
}
@@ -130,7 +130,7 @@ PJ *PROJECTION(chamb) {
j = i == 2 ? 0 : i + 1;
Q->c[i].v = vect(P->ctx,Q->c[j].phi - Q->c[i].phi, Q->c[i].cosphi, Q->c[i].sinphi,
Q->c[j].cosphi, Q->c[j].sinphi, Q->c[j].lam - Q->c[i].lam);
- if (! Q->c[i].v.r) E_ERROR(-25);
+ if (Q->c[i].v.r == 0.0) E_ERROR(-25);
/* co-linearity problem ignored for now */
}
Q->beta_0 = lc(P->ctx,Q->c[0].v.r, Q->c[2].v.r, Q->c[1].v.r);
diff --git a/src/PJ_fouc_s.c b/src/PJ_fouc_s.c
index 4392a6ec..f5df5d84 100644
--- a/src/PJ_fouc_s.c
+++ b/src/PJ_fouc_s.c
@@ -29,7 +29,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
double V;
int i;
- if (Q->n) {
+ if (Q->n != 0.0) {
lp.phi = xy.y;
for (i = MAX_ITER; i ; --i) {
lp.phi -= V = (Q->n * lp.phi + Q->n1 * sin(lp.phi) - xy.y ) /
diff --git a/src/PJ_geos.c b/src/PJ_geos.c
index b7caacc3..56357c2b 100644
--- a/src/PJ_geos.c
+++ b/src/PJ_geos.c
@@ -204,7 +204,7 @@ PJ *PROJECTION(geos) {
if ((Q->h = pj_param(P->ctx, P->params, "dh").f) <= 0.) E_ERROR(-30);
- if (P->phi0) E_ERROR(-46);
+ if (P->phi0 != 0.0) E_ERROR(-46);
Q->sweep_axis = pj_param(P->ctx, P->params, "ssweep").s;
if (Q->sweep_axis == NULL)
@@ -223,7 +223,7 @@ PJ *PROJECTION(geos) {
Q->radius_g_1 = Q->h / P->a;
Q->radius_g = 1. + Q->radius_g_1;
Q->C = Q->radius_g * Q->radius_g - 1.0;
- if (P->es) {
+ if (P->es != 0.0) {
Q->radius_p = sqrt (P->one_es);
Q->radius_p2 = P->one_es;
Q->radius_p_inv2 = P->rone_es;
diff --git a/src/PJ_gn_sinu.c b/src/PJ_gn_sinu.c
index 5dad9787..3b2c8993 100644
--- a/src/PJ_gn_sinu.c
+++ b/src/PJ_gn_sinu.c
@@ -47,7 +47,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
XY xy = {0.0,0.0};
struct pj_opaque *Q = P->opaque;
- if (!Q->m)
+ if (Q->m == 0.0)
lp.phi = Q->n != 1. ? aasin(P->ctx,Q->n * sin(lp.phi)): lp.phi;
else {
double k, V;
@@ -75,7 +75,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
struct pj_opaque *Q = P->opaque;
xy.y /= Q->C_y;
- lp.phi = Q->m ? aasin(P->ctx,(Q->m * xy.y + sin(xy.y)) / Q->n) :
+ lp.phi = (Q->m != 0.0) ? aasin(P->ctx,(Q->m * xy.y + sin(xy.y)) / Q->n) :
( Q->n != 1. ? aasin(P->ctx,sin(xy.y) / Q->n) : xy.y );
lp.lam = xy.x / (Q->C_x * (Q->m + cos(xy.y)));
return lp;
@@ -122,7 +122,7 @@ PJ *PROJECTION(sinu) {
if (!(Q->en = pj_enfn(P->es)))
E_ERROR_0;
- if (P->es) {
+ if (P->es != 0.0) {
P->inv = e_inverse;
P->fwd = e_forward;
} else {
diff --git a/src/PJ_healpix.c b/src/PJ_healpix.c
index fc2122c5..1513d455 100644
--- a/src/PJ_healpix.c
+++ b/src/PJ_healpix.c
@@ -615,7 +615,7 @@ PJ *PROJECTION(healpix) {
return freeup_new (P);
P->opaque = Q;
- if (P->es) {
+ if (P->es != 0.0) {
Q->apa = pj_authset(P->es); /* For auth_lat(). */
Q->qp = pj_qsfn(1.0, P->e, P->one_es); /* For auth_lat(). */
P->a = P->a*sqrt(0.5*Q->qp); /* Set P->a to authalic radius. */
@@ -647,7 +647,7 @@ PJ *PROJECTION(rhealpix) {
if (Q->south_square < 0 || Q->south_square > 3) {
E_ERROR(-47);
}
- if (P->es) {
+ if (P->es != 0.0) {
Q->apa = pj_authset(P->es); /* For auth_lat(). */
Q->qp = pj_qsfn(1.0, P->e, P->one_es); /* For auth_lat(). */
P->a = P->a*sqrt(0.5*Q->qp); /* Set P->a to authalic radius. */
diff --git a/src/PJ_imw_p.c b/src/PJ_imw_p.c
index 5d37b16d..126dd190 100644
--- a/src/PJ_imw_p.c
+++ b/src/PJ_imw_p.c
@@ -37,7 +37,7 @@ static XY loc_for(LP lp, PJ *P, double *yc) {
struct pj_opaque *Q = P->opaque;
XY xy;
- if (! lp.phi) {
+ if (lp.phi == 0.0) {
xy.x = lp.lam;
xy.y = 0.;
} else {
@@ -162,13 +162,15 @@ PJ *PROJECTION(imw_p) {
Q->lam_1 = sig * DEG_TO_RAD;
}
Q->mode = 0;
- if (Q->phi_1) xy(P, Q->phi_1, &x1, &y1, &Q->sphi_1, &Q->R_1);
+ if (Q->phi_1 != 0.0)
+ xy(P, Q->phi_1, &x1, &y1, &Q->sphi_1, &Q->R_1);
else {
Q->mode = 1;
y1 = 0.;
x1 = Q->lam_1;
}
- if (Q->phi_2) xy(P, Q->phi_2, &x2, &T2, &Q->sphi_2, &Q->R_2);
+ if (Q->phi_2 != 0.0)
+ xy(P, Q->phi_2, &x2, &T2, &Q->sphi_2, &Q->R_2);
else {
Q->mode = -1;
T2 = 0.;
diff --git a/src/PJ_laea.c b/src/PJ_laea.c
index d4535dd0..f4976cab 100644
--- a/src/PJ_laea.c
+++ b/src/PJ_laea.c
@@ -152,7 +152,7 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
/*-fallthrough*/
case S_POLE:
q = (xy.x * xy.x + xy.y * xy.y);
- if (!q) {
+ if (q == 0.0) {
lp.lam = 0.;
lp.phi = P->phi0;
return (lp);
@@ -237,7 +237,7 @@ PJ *PROJECTION(laea) {
Q->mode = EQUIT;
else
Q->mode = OBLIQ;
- if (P->es) {
+ if (P->es != 0.0) {
double sinphi;
P->e = sqrt(P->es);
diff --git a/src/PJ_merc.c b/src/PJ_merc.c
index e0ec9658..aafe7b85 100644
--- a/src/PJ_merc.c
+++ b/src/PJ_merc.c
@@ -56,7 +56,7 @@ PJ *PROJECTION(merc) {
if (phits >= M_HALFPI) E_ERROR(-24);
}
- if (P->es) { /* ellipsoid */
+ if (P->es != 0.0) { /* ellipsoid */
if (is_phits)
P->k0 = pj_msfn(sin(phits), cos(phits), P->es);
P->inv = e_inverse;
diff --git a/src/PJ_mod_ster.c b/src/PJ_mod_ster.c
index 5d66fb41..d979b41e 100644
--- a/src/PJ_mod_ster.c
+++ b/src/PJ_mod_ster.c
@@ -116,7 +116,7 @@ static PJ *setup(PJ *P) { /* general initialization */
struct pj_opaque *Q = P->opaque;
double esphi, chio;
- if (P->es) {
+ if (P->es != 0.0) {
esphi = P->e * sin(P->phi0);
chio = 2. * atan(tan((M_HALFPI + P->phi0) * .5) *
pow((1. - esphi) / (1. + esphi), P->e * .5)) - M_HALFPI;
@@ -230,7 +230,7 @@ PJ *PROJECTION(alsk) {
Q->n = 5;
P->lam0 = DEG_TO_RAD * -152.;
P->phi0 = DEG_TO_RAD * 64.;
- if (P->es) { /* fixed ellipsoid/sphere */
+ if (P->es != 0.0) { /* fixed ellipsoid/sphere */
Q->zcoeff = ABe;
P->a = 6378206.4;
P->e = sqrt(P->es = 0.00676866);
@@ -278,7 +278,7 @@ PJ *PROJECTION(gs50) {
Q->n = 9;
P->lam0 = DEG_TO_RAD * -120.;
P->phi0 = DEG_TO_RAD * 45.;
- if (P->es) { /* fixed ellipsoid/sphere */
+ if (P->es != 0.0) { /* fixed ellipsoid/sphere */
Q->zcoeff = ABe;
P->a = 6378206.4;
P->e = sqrt(P->es = 0.00676866);
diff --git a/src/PJ_poly.c b/src/PJ_poly.c
index 5a679d61..8fb671af 100644
--- a/src/PJ_poly.c
+++ b/src/PJ_poly.c
@@ -142,7 +142,7 @@ PJ *PROJECTION(poly) {
return freeup_new (P);
P->opaque = Q;
- if (P->es) {
+ if (P->es != 0.0) {
if (!(Q->en = pj_enfn(P->es))) E_ERROR_0;
Q->ml0 = pj_mlfn(P->phi0, sin(P->phi0), cos(P->phi0), Q->en);
P->inv = e_inverse;
diff --git a/src/PJ_qsc.c b/src/PJ_qsc.c
index faf60114..e5fee0ea 100644
--- a/src/PJ_qsc.c
+++ b/src/PJ_qsc.c
@@ -115,7 +115,7 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
/* Convert the geodetic latitude to a geocentric latitude.
* This corresponds to the shift from the ellipsoid to the sphere
* described in [LK12]. */
- if (P->es) {
+ if (P->es != 0.0) {
lat = atan(Q->one_minus_f_squared * tan(lp.phi));
} else {
lat = lp.phi;
@@ -346,7 +346,7 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
/* Apply the shift from the sphere to the ellipsoid as described
* in [LK12]. */
- if (P->es) {
+ if (P->es != 0.0) {
int invert_sign;
double tanphi, xa;
invert_sign = (lp.phi < 0.0 ? 1 : 0);
@@ -400,7 +400,7 @@ PJ *PROJECTION(qsc) {
}
/* Fill in useful values for the ellipsoid <-> sphere shift
* described in [LK12]. */
- if (P->es) {
+ if (P->es != 0.0) {
Q->a_squared = P->a * P->a;
Q->b = P->a * sqrt(1.0 - P->es);
Q->one_minus_f = 1.0 - (P->a - Q->b) / P->a;
diff --git a/src/PJ_stere.c b/src/PJ_stere.c
index 5ca1b9d9..c7fb02e3 100644
--- a/src/PJ_stere.c
+++ b/src/PJ_stere.c
@@ -222,7 +222,7 @@ static PJ *setup(PJ *P) { /* general initialization */
Q->mode = t > EPS10 ? OBLIQ : EQUIT;
Q->phits = fabs (Q->phits);
- if (P->es) {
+ if (P->es != 0.0) {
double X;
switch (Q->mode) {
@@ -295,7 +295,7 @@ PJ *PROJECTION(ups) {
/* International Ellipsoid */
P->phi0 = pj_param(P->ctx, P->params, "bsouth").i ? - M_HALFPI: M_HALFPI;
- if (!P->es) E_ERROR(-34);
+ if (P->es == 0.0) E_ERROR(-34);
P->k0 = .994;
P->x0 = 2000000.;
P->y0 = 2000000.;
diff --git a/src/PJ_sterea.c b/src/PJ_sterea.c
index 6e450899..73c6b48c 100644
--- a/src/PJ_sterea.c
+++ b/src/PJ_sterea.c
@@ -64,7 +64,7 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
xy.x /= P->k0;
xy.y /= P->k0;
- if ( (rho = hypot (xy.x, xy.y)) ) {
+ if ( (rho = hypot (xy.x, xy.y)) != 0.0 ) {
c = 2. * atan2 (rho, Q->R2);
sinc = sin (c);
cosc = cos (c);
diff --git a/src/PJ_tmerc.c b/src/PJ_tmerc.c
index dcade171..5cbb2b5d 100644
--- a/src/PJ_tmerc.c
+++ b/src/PJ_tmerc.c
@@ -150,7 +150,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
/* Make sure that phi is on the correct hemisphere when false northing is used */
if (xy.y < 0. && -lp.phi+P->phi0 < 0.0) lp.phi = -lp.phi;
- lp.lam = (g || h) ? atan2 (g, h) : 0.;
+ lp.lam = (g != 0.0 || h != 0.0) ? atan2 (g, h) : 0.;
return lp;
}
@@ -172,7 +172,7 @@ static void freeup (PJ *P) {
static PJ *setup(PJ *P) { /* general initialization */
struct pj_opaque *Q = P->opaque;
- if (P->es) {
+ if (P->es != 0.0) {
if (!(Q->en = pj_enfn(P->es)))
E_ERROR_0;
Q->ml0 = pj_mlfn(P->phi0, sin(P->phi0), cos(P->phi0), Q->en);
diff --git a/src/geod_set.c b/src/geod_set.c
index f61ab437..60f19990 100644
--- a/src/geod_set.c
+++ b/src/geod_set.c
@@ -51,7 +51,7 @@ geod_set(int argc, char **argv) {
geod_for();
} else emess(1,"incomplete geodesic/arc info");
if ((n_alpha = pj_param(NULL,start, "in_A").i) > 0) {
- if (!(del_alpha = pj_param(NULL,start, "rdel_A").f))
+ if ((del_alpha = pj_param(NULL,start, "rdel_A").f) == 0.0)
emess(1,"del azimuth == 0");
} else if ((del_S = fabs(pj_param(NULL,start, "ddel_S").f)) != 0.) {
n_S = (int)(geod_S / del_S + .5);
diff --git a/src/mk_cheby.c b/src/mk_cheby.c
index 32f22f1a..a7cd75c5 100644
--- a/src/mk_cheby.c
+++ b/src/mk_cheby.c
@@ -83,9 +83,9 @@ mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV),
for (j = 0; j < nu; ++j) {
ncu[j] = ncv[j] = 0; /* clear column maxes */
for (s = w[j], i = 0; i < nv; ++i, ++s) {
- if (s->u)
+ if (s->u != 0.0)
ncu[j] = i + 1; /* update column max */
- if (s->v)
+ if (s->v != 0.0)
ncv[j] = i + 1;
}
if (ncu[j]) nru = j + 1; /* update row max */
diff --git a/src/pj_ell_set.c b/src/pj_ell_set.c
index 87fb6e41..865726fa 100644
--- a/src/pj_ell_set.c
+++ b/src/pj_ell_set.c
@@ -45,7 +45,7 @@ int pj_ell_set(projCtx ctx, paralist *pl, double *a, double *es) {
*es = e * e;
} else if (pj_param(ctx,pl, "trf").i) { /* recip flattening */
*es = pj_param(ctx,pl, "drf").f;
- if (!*es) {
+ if (*es == 0.0) {
pj_ctx_set_errno( ctx, -10);
goto bomb;
}
@@ -58,7 +58,7 @@ int pj_ell_set(projCtx ctx, paralist *pl, double *a, double *es) {
b = pj_param(ctx,pl, "db").f;
*es = 1. - (b * b) / (*a * *a);
} /* else *es == 0. and sphere of radius *a */
- if (!b)
+ if (b == 0.0)
b = *a * sqrt(1. - *es);
/* following options turn ellipsoid into equivalent sphere */
if (pj_param(ctx,pl, "bR_A").i) { /* sphere--area of ellipsoid */
diff --git a/src/pj_factors.c b/src/pj_factors.c
index ac23ed71..d959494e 100644
--- a/src/pj_factors.c
+++ b/src/pj_factors.c
@@ -47,7 +47,7 @@ pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) {
if (!(fac->code & IS_ANAL_HK)) {
fac->h = hypot(fac->der.x_p, fac->der.y_p);
fac->k = hypot(fac->der.x_l, fac->der.y_l) / cosphi;
- if (P->es) {
+ if (P->es != 0.0) {
t = sin(lp.phi);
t = 1. - P->es * t * t;
n = sqrt(t);
@@ -56,7 +56,7 @@ pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) {
r = t * t / P->one_es;
} else
r = 1.;
- } else if (P->es) {
+ } else if (P->es != 0.0) {
r = sin(lp.phi);
r = 1. - P->es * r * r;
r = r * r / P->one_es;
diff --git a/src/pj_init.c b/src/pj_init.c
index b6be52d9..24aece84 100644
--- a/src/pj_init.c
+++ b/src/pj_init.c
@@ -512,15 +512,15 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) {
/* flattening */
PIN->f = 1 - cos (PIN->alpha); /* = 1 - sqrt (1 - PIN->es); */
- PIN->rf = PIN->f? 1.0/PIN->f: HUGE_VAL;
+ PIN->rf = PIN->f != 0.0 ? 1.0/PIN->f: HUGE_VAL;
/* second flattening */
PIN->f2 = 1/cos (PIN->alpha) - 1;
- PIN->rf2 = PIN->f2? 1/PIN->f2: HUGE_VAL;
+ PIN->rf2 = PIN->f2 != 0.0 ? 1/PIN->f2: HUGE_VAL;
/* third flattening */
PIN->n = pow (tan (PIN->alpha/2), 2);
- PIN->rn = PIN->n? 1/PIN->n: HUGE_VAL;
+ PIN->rn = PIN->n != 0.0 ? 1/PIN->n: HUGE_VAL;
/* ...and a few more */
PIN->b = (1 - PIN->f)*PIN->a;
@@ -545,7 +545,7 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) {
}
/* set PIN->geoc coordinate system */
- PIN->geoc = (PIN->es && pj_param(ctx, start, "bgeoc").i);
+ PIN->geoc = (PIN->es != 0.0 && pj_param(ctx, start, "bgeoc").i);
/* over-ranging flag */
PIN->over = pj_param(ctx, start, "bover").i;
diff --git a/src/proj.c b/src/proj.c
index 10eb0f8d..18355125 100644
--- a/src/proj.c
+++ b/src/proj.c
@@ -450,7 +450,7 @@ int main(int argc, char **argv) {
pj_pr_list(Proj);
if (very_verby) {
(void)printf("#Final Earth figure: ");
- if (Proj->es) {
+ if (Proj->es != 0.0) {
(void)printf("ellipsoid\n# Major axis (a): ");
(void)printf(oform ? oform : "%.3f", Proj->a);
(void)printf("\n# 1/flattening: %.6f\n",
diff --git a/src/proj_etmerc.c b/src/proj_etmerc.c
index aed1499e..2c07808b 100644
--- a/src/proj_etmerc.c
+++ b/src/proj_etmerc.c
@@ -411,7 +411,7 @@ PJ *PROJECTION(utm) {
return freeup_new (P);
P->opaque = Q;
- if (!P->es)
+ if (P->es == 0.0)
E_ERROR(-34);
P->y0 = pj_param (P->ctx, P->params, "bsouth").i ? 10000000. : 0.;
P->x0 = 500000.;
diff --git a/src/rtodms.c b/src/rtodms.c
index 5e88ca14..b6ad9721 100644
--- a/src/rtodms.c
+++ b/src/rtodms.c
@@ -55,7 +55,7 @@ rtodms(char *s, double r, int pos, int neg) {
if (dolong)
(void)sprintf(ss,format,deg,min,sec,sign);
- else if (sec) {
+ else if (sec != 0.0) {
char *p, *q;
/* double prime + pos/neg suffix (if included) + NUL */
size_t suffix_len = sign ? 3 : 2;