aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2001-02-07 17:55:05 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2001-02-07 17:55:05 +0000
commit6ab5e6cfa7775b8fe77a93432d331b8654a33b3f (patch)
tree9af88663973b8f6c23f345c4783a16ca1de223ce /src
parent6c008cb7ae007b6f0cb813febcefa60c718c05c7 (diff)
downloadPROJ-6ab5e6cfa7775b8fe77a93432d331b8654a33b3f.tar.gz
PROJ-6ab5e6cfa7775b8fe77a93432d331b8654a33b3f.zip
Cleaned up various warnings when compiled with -Wall.
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@906 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
-rw-r--r--src/PJ_aea.c4
-rw-r--r--src/PJ_aeqd.c1
-rw-r--r--src/PJ_aitoff.c4
-rw-r--r--src/PJ_bipc.c4
-rw-r--r--src/PJ_eqdc.c4
-rw-r--r--src/PJ_imw_p.c4
-rw-r--r--src/PJ_laea.c6
-rw-r--r--src/PJ_lcc.c4
-rw-r--r--src/PJ_merc.c4
-rw-r--r--src/PJ_mod_ster.c86
-rw-r--r--src/PJ_nzmg.c12
-rw-r--r--src/PJ_ob_tran.c6
-rw-r--r--src/PJ_ocea.c2
-rw-r--r--src/PJ_omerc.c2
-rw-r--r--src/PJ_sconics.c6
-rw-r--r--src/PJ_stere.c4
-rw-r--r--src/projects.h5
17 files changed, 83 insertions, 75 deletions
diff --git a/src/PJ_aea.c b/src/PJ_aea.c
index 6ad5e9f0..447d9755 100644
--- a/src/PJ_aea.c
+++ b/src/PJ_aea.c
@@ -55,7 +55,7 @@ FORWARD(e_forward); /* ellipsoid & spheroid */
return (xy);
}
INVERSE(e_inverse) /* ellipsoid & spheroid */;
- if (P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) {
+ if( (P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) != 0.0 ) {
if (P->n < 0.) {
P->rho = -P->rho;
xy.x = -xy.x;
@@ -90,7 +90,7 @@ setup(PJ *P) {
P->n = sinphi = sin(P->phi1);
cosphi = cos(P->phi1);
secant = fabs(P->phi1 - P->phi2) >= EPS10;
- if (P->ellips = P->es > 0.) {
+ if( (P->ellips = (P->es > 0.))) {
double ml1, m1;
if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
diff --git a/src/PJ_aeqd.c b/src/PJ_aeqd.c
index 95f98722..388ff92f 100644
--- a/src/PJ_aeqd.c
+++ b/src/PJ_aeqd.c
@@ -124,7 +124,6 @@ INVERSE(e_guam_inv); /* Guam elliptical */
}
INVERSE(e_inverse); /* elliptical */
double c, Az, cosAz, A, B, D, E, F, psi, t;
- int i;
if ((c = hypot(xy.x, xy.y)) < EPS10) {
lp.phi = P->phi0;
diff --git a/src/PJ_aitoff.c b/src/PJ_aitoff.c
index 37e89a81..c2048a02 100644
--- a/src/PJ_aitoff.c
+++ b/src/PJ_aitoff.c
@@ -11,7 +11,7 @@ PROJ_HEAD(wintri, "Winkel Tripel") "\n\tMisc Sph\n\tlat_1";
FORWARD(s_forward); /* spheroid */
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)))) {/* basic Aitoff */
xy.x = 2. * d * cos(lp.phi) * sin(c) * (xy.y = 1. / sin(d));
xy.y *= d * sin(lp.phi);
} else
@@ -36,8 +36,10 @@ ENDENTRY(setup(P))
ENTRY0(wintri)
P->mode = 1;
if (pj_param(P->params, "tlat_1").i)
+ {
if ((P->cosphi1 = cos(pj_param(P->params, "rlat_1").f)) == 0.)
E_ERROR(-22)
+ }
else /* 50d28' or acos(2/pi) */
P->cosphi1 = 0.636619772367581343;
ENDENTRY(setup(P))
diff --git a/src/PJ_bipc.c b/src/PJ_bipc.c
index dd3fae8d..f5008ddf 100644
--- a/src/PJ_bipc.c
+++ b/src/PJ_bipc.c
@@ -41,7 +41,7 @@ FORWARD(s_forward); /* spheroid */
tphi = sphi / cphi;
Az = atan2(sdlam , C45 * (tphi - cdlam));
}
- if (tag = (Az > Azba)) {
+ if( (tag = (Az > Azba)) ) {
cdlam = cos(sdlam = lp.lam + R110);
sdlam = sin(sdlam);
z = S20 * sphi + C20 * cphi * cdlam;
@@ -93,7 +93,7 @@ INVERSE(s_inverse); /* spheroid */
xy.x = -xy.x * cAzc + xy.y * sAzc;
xy.y = -xy.y * cAzc - t * sAzc;
}
- if (neg = (xy.x < 0.)) {
+ if( (neg = (xy.x < 0.)) ) {
xy.y = rhoc - xy.y;
s = S20;
c = C20;
diff --git a/src/PJ_eqdc.c b/src/PJ_eqdc.c
index 349266ff..edd82c3e 100644
--- a/src/PJ_eqdc.c
+++ b/src/PJ_eqdc.c
@@ -23,7 +23,7 @@ FORWARD(e_forward); /* sphere & ellipsoid */
return (xy);
}
INVERSE(e_inverse); /* sphere & ellipsoid */
- if (P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) {
+ if ((P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) != 0.0 ) {
if (P->n < 0.) {
P->rho = -P->rho;
xy.x = -xy.x;
@@ -62,7 +62,7 @@ ENTRY1(eqdc, en)
P->n = sinphi = sin(P->phi1);
cosphi = cos(P->phi1);
secant = fabs(P->phi1 - P->phi2) >= EPS10;
- if (P->ellips = P->es > 0.) {
+ if( (P->ellips = (P->es > 0.)) ) {
double ml1, m1;
m1 = pj_msfn(sinphi, cosphi, P->es);
diff --git a/src/PJ_imw_p.c b/src/PJ_imw_p.c
index 58d04f8c..39e071a1 100644
--- a/src/PJ_imw_p.c
+++ b/src/PJ_imw_p.c
@@ -95,7 +95,7 @@ INVERSE(e_inverse); /* ellipsoid */
}
static void
xy(PJ *P, double phi, double *x, double *y, double *sp, double *R) {
- double t, F;
+ double F;
*sp = sin(phi);
*R = 1./(tan(phi) * sqrt(1. - P->es * *sp * *sp ));
@@ -109,7 +109,7 @@ ENTRY1(imw_p, en)
int i;
if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
- if (i = phi12(P, &del, &sig))
+ if( (i = phi12(P, &del, &sig)) != 0)
E_ERROR(i);
if (P->phi_2 < P->phi_1) { /* make sure P->phi_1 most southerly */
del = P->phi_1;
diff --git a/src/PJ_laea.c b/src/PJ_laea.c
index dab96700..9ba60c26 100644
--- a/src/PJ_laea.c
+++ b/src/PJ_laea.c
@@ -25,7 +25,7 @@ PROJ_HEAD(laea, "Lambert Azimuthal Equal Area") "\n\tAzi, Sph&Ell";
#define EQUIT 2
#define OBLIQ 3
FORWARD(e_forward); /* ellipsoid */
- double coslam, sinlam, sinphi, q, sinb, cosb, b;
+ double coslam, sinlam, sinphi, q, sinb=0.0, cosb=0.0, b=0.0;
coslam = cos(lp.lam);
sinlam = sin(lp.lam);
@@ -105,7 +105,7 @@ oblcon:
return (xy);
}
INVERSE(e_inverse); /* ellipsoid */
- double cCe, sCe, q, rho, ab;
+ double cCe, sCe, q, rho, ab=0.0;
switch (P->mode) {
case EQUIT:
@@ -146,7 +146,7 @@ INVERSE(e_inverse); /* ellipsoid */
return (lp);
}
INVERSE(s_inverse); /* spheroid */
- double cosz, rh, sinz;
+ double cosz=0.0, rh, sinz=0.0;
rh = hypot(xy.x, xy.y);
if ((lp.phi = rh * .5 ) > 1.) I_ERROR;
diff --git a/src/PJ_lcc.c b/src/PJ_lcc.c
index 9e697cd9..68cc895b 100644
--- a/src/PJ_lcc.c
+++ b/src/PJ_lcc.c
@@ -29,7 +29,7 @@ FORWARD(e_forward); /* ellipsoid & spheroid */
INVERSE(e_inverse); /* ellipsoid & spheroid */
xy.x /= P->k0;
xy.y /= P->k0;
- if (P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) {
+ if( (P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) != 0.0) {
if (P->n < 0.) {
P->rho = -P->rho;
xy.x = -xy.x;
@@ -77,7 +77,7 @@ ENTRY0(lcc)
P->n = sinphi = sin(P->phi1);
cosphi = cos(P->phi1);
secant = fabs(P->phi1 - P->phi2) >= EPS10;
- if (P->ellips = (P->es != 0.)) {
+ if( (P->ellips = (P->es != 0.)) ) {
double ml1, m1;
P->e = sqrt(P->es);
diff --git a/src/PJ_merc.c b/src/PJ_merc.c
index 63bc3341..6bf17aa9 100644
--- a/src/PJ_merc.c
+++ b/src/PJ_merc.c
@@ -29,10 +29,10 @@ INVERSE(s_inverse); /* spheroid */
}
FREEUP; if (P) pj_dalloc(P); }
ENTRY0(merc)
- double phits;
+ double phits=0.0;
int is_phits;
- if (is_phits = pj_param(P->params, "tlat_ts").i) {
+ if( (is_phits = pj_param(P->params, "tlat_ts").i) ) {
phits = fabs(pj_param(P->params, "rlat_ts").f);
if (phits >= HALFPI) E_ERROR(-24);
}
diff --git a/src/PJ_mod_ster.c b/src/PJ_mod_ster.c
index 04fecb68..090b6a73 100644
--- a/src/PJ_mod_ster.c
+++ b/src/PJ_mod_ster.c
@@ -101,9 +101,9 @@ setup(PJ *P) { /* general initialization */
ENTRY0(mil_os)
static COMPLEX /* Miller Oblated Stereographic */
AB[] = {
- 0.924500, 0.,
- 0., 0.,
- 0.019430, 0.
+ {0.924500, 0.},
+ {0., 0.},
+ {0.019430, 0.}
};
P->n = 2;
@@ -115,9 +115,9 @@ ENDENTRY(setup(P))
ENTRY0(lee_os)
static COMPLEX /* Lee Oblated Stereographic */
AB[] = {
- 0.721316, 0.,
- 0., 0.,
- -0.0088162, -0.00617325
+ {0.721316, 0.},
+ {0., 0.},
+ {-0.0088162, -0.00617325}
};
P->n = 2;
@@ -129,11 +129,11 @@ ENDENTRY(setup(P))
ENTRY0(gs48)
static COMPLEX /* 48 United States */
AB[] = {
- 0.98879, 0.,
- 0., 0.,
- -0.050909, 0.,
- 0., 0.,
- 0.075528, 0.
+ {0.98879, 0.},
+ {0., 0.},
+ {-0.050909, 0.},
+ {0., 0.},
+ {0.075528, 0.}
};
P->n = 4;
@@ -146,19 +146,19 @@ ENDENTRY(setup(P))
ENTRY0(alsk)
static COMPLEX
ABe[] = { /* Alaska ellipsoid */
- .9945303, 0.,
- .0052083, -.0027404,
- .0072721, .0048181,
- -.0151089, -.1932526,
- .0642675, -.1381226,
- .3582802, -.2884586},
+ {.9945303, 0.},
+ {.0052083, -.0027404},
+ {.0072721, .0048181},
+ {-.0151089, -.1932526},
+ {.0642675, -.1381226},
+ {.3582802, -.2884586}},
ABs[] = { /* Alaska sphere */
- .9972523, 0.,
- .0052513, -.0041175,
- .0074606, .0048125,
- -.0153783, -.1968253,
- .0636871, -.1408027,
- .3660976, -.2937382
+ {.9972523, 0.},
+ {.0052513, -.0041175},
+ {.0074606, .0048125},
+ {-.0153783, -.1968253},
+ {.0636871, -.1408027},
+ {.3660976, -.2937382}
};
P->n = 5;
@@ -176,28 +176,28 @@ ENDENTRY(setup(P))
ENTRY0(gs50)
static COMPLEX
ABe[] = { /* GS50 ellipsoid */
- .9827497, 0.,
- .0210669, .0053804,
- -.1031415, -.0571664,
- -.0323337, -.0322847,
- .0502303, .1211983,
- .0251805, .0895678,
- -.0012315, -.1416121,
- .0072202, -.1317091,
- -.0194029, .0759677,
- -.0210072, .0834037
+ {.9827497, 0.},
+ {.0210669, .0053804},
+ {-.1031415, -.0571664},
+ {-.0323337, -.0322847},
+ {.0502303, .1211983},
+ {.0251805, .0895678},
+ {-.0012315, -.1416121},
+ {.0072202, -.1317091},
+ {-.0194029, .0759677},
+ {-.0210072, .0834037}
},
ABs[] = { /* GS50 sphere */
- .9842990, 0.,
- .0211642, .0037608,
- -.1036018, -.0575102,
- -.0329095, -.0320119,
- .0499471, .1223335,
- .0260460, .0899805,
- .0007388, -.1435792,
- .0075848, -.1334108,
- -.0216473, .0776645,
- -.0225161, .0853673
+ {.9842990, 0.},
+ {.0211642, .0037608},
+ {-.1036018, -.0575102},
+ {-.0329095, -.0320119},
+ {.0499471, .1223335},
+ {.0260460, .0899805},
+ {.0007388, -.1435792},
+ {.0075848, -.1334108},
+ {-.0216473, .0776645},
+ {-.0225161, .0853673}
};
P->n = 9;
diff --git a/src/PJ_nzmg.c b/src/PJ_nzmg.c
index fabe32a1..2606cb4c 100644
--- a/src/PJ_nzmg.c
+++ b/src/PJ_nzmg.c
@@ -10,12 +10,12 @@ PROJ_HEAD(nzmg, "New Zealand Map Grid") "\n\tfixed Earth";
#define RAD_TO_SEC5 2.062648062470963551564733573
static COMPLEX
bf[] = {
- .7557853228, 0.0,
- .249204646, .003371507,
- -.001541739, .041058560,
- -.10162907, .01727609,
- -.26623489, -.36249218,
- -.6870983, -1.1651967 };
+ {.7557853228, 0.0},
+ {.249204646, .003371507},
+ {-.001541739, .041058560},
+ {-.10162907, .01727609},
+ {-.26623489, -.36249218},
+ {-.6870983, -1.1651967} };
static double
tphi[] = { 1.5627014243, .5185406398, -.03333098, -.1052906, -.0368594,
.007317, .01220, .00394, -.0013 },
diff --git a/src/PJ_ob_tran.c b/src/PJ_ob_tran.c
index d02878c9..8cf5d995 100644
--- a/src/PJ_ob_tran.c
+++ b/src/PJ_ob_tran.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char SCCSID[]="@(#)PJ_ob_tran.c 4.1 94/02/15 GIE REL";
+static const char SCCSID[]="@(#)PJ_ob_tran.c 4.1 94/02/15 GIE REL";
#endif
#define PROJ_PARMS__ \
struct PJconsts *link; \
@@ -16,6 +16,8 @@ PROJ_HEAD(ob_tran, "General Oblique Transformation") "\n\tMisc Sph"
FORWARD(o_forward); /* spheroid */
double coslam, sinphi, cosphi;
+ (void) xy;
+
coslam = cos(lp.lam);
sinphi = sin(lp.phi);
cosphi = cos(lp.phi);
@@ -27,6 +29,8 @@ FORWARD(o_forward); /* spheroid */
FORWARD(t_forward); /* spheroid */
double cosphi, coslam;
+ (void) xy;
+
cosphi = cos(lp.phi);
coslam = cos(lp.lam);
lp.lam = adjlon(aatan2(cosphi * sin(lp.lam), sin(lp.phi)) + P->lamp);
diff --git a/src/PJ_ocea.c b/src/PJ_ocea.c
index 95fcda0d..cbe32522 100644
--- a/src/PJ_ocea.c
+++ b/src/PJ_ocea.c
@@ -40,7 +40,7 @@ INVERSE(s_inverse); /* spheroid */
}
FREEUP; if (P) pj_dalloc(P); }
ENTRY0(ocea)
- double phi_0, phi_1, phi_2, lam_1, lam_2, lonz, alpha;
+ double phi_0=0.0, phi_1, phi_2, lam_1, lam_2, lonz, alpha;
P->rok = P->a / P->k0;
P->rtk = P->a * P->k0;
diff --git a/src/PJ_omerc.c b/src/PJ_omerc.c
index 5494186b..c10111fa 100644
--- a/src/PJ_omerc.c
+++ b/src/PJ_omerc.c
@@ -81,7 +81,7 @@ ENTRY0(omerc)
int azi;
P->rot = pj_param(P->params, "bno_rot").i == 0;
- if (azi = pj_param(P->params, "talpha").i) {
+ if( (azi = pj_param(P->params, "talpha").i) != 0.0) {
P->lamc = pj_param(P->params, "rlonc").f;
P->alpha = pj_param(P->params, "ralpha").f;
if ( fabs(P->alpha) <= TOL ||
diff --git a/src/PJ_sconics.c b/src/PJ_sconics.c
index 567e4f60..422e3c99 100644
--- a/src/PJ_sconics.c
+++ b/src/PJ_sconics.c
@@ -37,7 +37,7 @@ PROJ_HEAD(vitk1, "Vitkovsky I")
/* get common factors for simple conics */
static int
phi12(PJ *P, double *del) {
- double p1, p2, d, s;
+ double p1, p2;
int err = 0;
if (!pj_param(P->params, "tlat_1").i ||
@@ -96,10 +96,10 @@ INVERSE(s_inverse); /* ellipsoid & spheroid */
FREEUP; if (P) pj_dalloc(P); }
static PJ *
setup(PJ *P) {
- double del, cs, dummy;
+ double del, cs;
int i;
- if (i = phi12(P, &del))
+ if( (i = phi12(P, &del)) )
E_ERROR(i);
switch (P->type) {
case TISSOT:
diff --git a/src/PJ_stere.c b/src/PJ_stere.c
index 5c130420..ca76fdf3 100644
--- a/src/PJ_stere.c
+++ b/src/PJ_stere.c
@@ -28,7 +28,7 @@ ssfn_(double phit, double sinphi, double eccen) {
pow((1. - sinphi) / (1. + sinphi), .5 * eccen));
}
FORWARD(e_forward); /* ellipsoid */
- double coslam, sinlam, sinX, cosX, X, A, sinphi;
+ double coslam, sinlam, sinX=0.0, cosX=0.0, X, A, sinphi;
coslam = cos(lp.lam);
sinlam = sin(lp.lam);
@@ -92,7 +92,7 @@ oblcon:
return (xy);
}
INVERSE(e_inverse); /* ellipsoid */
- double cosphi, sinphi, tp, phi_l, rho, halfe, halfpi;
+ 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);
diff --git a/src/projects.h b/src/projects.h
index 76e20162..d102c73d 100644
--- a/src/projects.h
+++ b/src/projects.h
@@ -28,6 +28,9 @@
******************************************************************************
*
* $Log$
+ * Revision 1.7 2001/02/07 17:55:05 warmerda
+ * Cleaned up various warnings when compiled with -Wall.
+ *
* Revision 1.6 2000/11/30 03:37:22 warmerda
* use proj_strtod() in dmstor()
*
@@ -245,7 +248,7 @@ extern struct PJ_DATUMS pj_datums[];
#define PROJ_HEAD(id, name) static const char des_##id [] = name
#define ENTRYA(name) const char * const pj_s_##name = des_##name; \
PJ *pj_##name(PJ *P) { if (!P) { \
- if (P = pj_malloc(sizeof(PJ))) { \
+ if( (P = pj_malloc(sizeof(PJ))) != NULL) { \
P->pfree = freeup; P->fwd = 0; P->inv = 0; \
P->spc = 0; P->descr = des_##name;
#define ENTRYX } return P; } else {