aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Knudsen <lastname DOT firstname AT gmail DOT com>2016-04-14 21:07:50 +0200
committerThomas Knudsen <lastname DOT firstname AT gmail DOT com>2016-04-14 21:07:50 +0200
commit147885200d7c0474a59b03224848a87b77bef917 (patch)
tree640574707a1e5b79fc48422c4f40be6ddd81b275 /src
parent1b9f4331c65d7d98d276433cc124e667c9aa695e (diff)
downloadPROJ-147885200d7c0474a59b03224848a87b77bef917.tar.gz
PROJ-147885200d7c0474a59b03224848a87b77bef917.zip
Minor cleanups of PJ_c...
A few cases of mixed declarations and code cleaned up, a few unused parameter warnings eliminated
Diffstat (limited to 'src')
-rw-r--r--src/PJ_cea.c34
-rw-r--r--src/PJ_chamb.c4
-rw-r--r--src/PJ_comill.c6
-rw-r--r--src/PJ_crast.c1
4 files changed, 23 insertions, 22 deletions
diff --git a/src/PJ_cea.c b/src/PJ_cea.c
index 87c0da07..e1bcb0af 100644
--- a/src/PJ_cea.c
+++ b/src/PJ_cea.c
@@ -13,7 +13,7 @@ PROJ_HEAD(cea, "Equal Area Cylindrical") "\n\tCyl, Sph&Ell\n\tlat_ts=";
static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
XY xy = {0.0,0.0};
xy.x = P->k0 * lp.lam;
- xy.y = 0.5 * pj_qsfn(sin(lp.phi), P->e, P->one_es) / P->k0;
+ xy.y = 0.5 * pj_qsfn (sin (lp.phi), P->e, P->one_es) / P->k0;
return xy;
}
@@ -28,8 +28,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
LP lp = {0.0,0.0};
- struct pj_opaque *Q = P->opaque;
- lp.phi = pj_authlat(asin( 2. * xy.y * P->k0 / Q->qp), Q->apa);
+ lp.phi = pj_authlat(asin( 2. * xy.y * P->k0 / P->opaque->qp), P->opaque->apa);
lp.lam = xy.x / P->k0;
return lp;
}
@@ -56,7 +55,7 @@ static void *freeup_new (PJ *P) { /* Destructor */
if (0==P->opaque)
return pj_dealloc (P);
- pj_dalloc (P->opaque->apa);
+ pj_dealloc (P->opaque->apa);
pj_dealloc (P->opaque);
return pj_dealloc (P);
}
@@ -67,12 +66,12 @@ static void freeup (PJ *P) {
}
PJ *PROJECTION(cea) {
+ double t = 0.0;
struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
if (0==Q)
return freeup_new (P);
P->opaque = Q;
- double t = 0.0;
if (pj_param(P->ctx, P->params, "tlat_ts").i) {
P->k0 = cos(t = pj_param(P->ctx, P->params, "rlat_ts").f);
@@ -116,17 +115,17 @@ int pj_cea_selftest (void) {
};
XY e_fwd_expect[] = {
- {222638.981586547132, 110568.812396267356},
- {222638.981586547132, -110568.812396265886},
+ { 222638.981586547132, 110568.812396267356},
+ { 222638.981586547132, -110568.812396265886},
{-222638.981586547132, 110568.812396267356},
- {-222638.981586547132, -110568.812396265886},
+ {-222638.981586547132, -110568.812396265886},
};
XY s_fwd_expect[] = {
- {223402.144255274179, 111695.401198614476},
- {223402.144255274179, -111695.401198614476},
+ { 223402.144255274179, 111695.401198614476},
+ { 223402.144255274179, -111695.401198614476},
{-223402.144255274179, 111695.401198614476},
- {-223402.144255274179, -111695.401198614476},
+ {-223402.144255274179, -111695.401198614476},
};
XY inv_in[] = {
@@ -137,21 +136,20 @@ int pj_cea_selftest (void) {
};
LP e_inv_expect[] = {
- {0.00179663056823904264, 0.000904369476105564289},
- {0.00179663056823904264, -0.000904369476105564289},
+ { 0.00179663056823904264, 0.000904369476105564289},
+ { 0.00179663056823904264, -0.000904369476105564289},
{-0.00179663056823904264, 0.000904369476105564289},
- {-0.00179663056823904264, -0.000904369476105564289},
+ {-0.00179663056823904264, -0.000904369476105564289},
};
LP s_inv_expect[] = {
- {0.00179049310978382265, 0.000895246554928338998},
- {0.00179049310978382265, -0.000895246554928338998},
+ { 0.00179049310978382265, 0.000895246554928338998},
+ { 0.00179049310978382265, -0.000895246554928338998},
{-0.00179049310978382265, 0.000895246554928338998},
- {-0.00179049310978382265, -0.000895246554928338998},
+ {-0.00179049310978382265, -0.000895246554928338998},
};
return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
-
#endif
diff --git a/src/PJ_chamb.c b/src/PJ_chamb.c
index c35061f3..68d99f26 100644
--- a/src/PJ_chamb.c
+++ b/src/PJ_chamb.c
@@ -109,13 +109,13 @@ static void freeup (PJ *P) {
PJ *PROJECTION(chamb) {
+ int i, j;
+ char line[10];
struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
if (0==Q)
return freeup_new (P);
P->opaque = Q;
- int i, j;
- char line[10];
for (i = 0; i < 3; ++i) { /* get control point locations */
(void)sprintf(line, "rlat_%d", i+1);
diff --git a/src/PJ_comill.c b/src/PJ_comill.c
index 1d88dbd5..6bccb264 100644
--- a/src/PJ_comill.c
+++ b/src/PJ_comill.c
@@ -25,6 +25,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
XY xy = {0.0,0.0};
double lat_sq;
+ (void) P; /* silence unused parameter warnings */
+
lat_sq = lp.phi * lp.phi;
xy.x = lp.lam;
xy.y = lp.phi * (K1 + lat_sq * (K2 + K3 * lat_sq));
@@ -34,7 +36,9 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
LP lp = {0.0,0.0};
- double yc, tol, y2, y4, f, fder;
+ double yc, tol, y2, f, fder;
+
+ (void) P; /* silence unused parameter warnings */
/* make sure y is inside valid range */
if (xy.y > MAX_Y) {
diff --git a/src/PJ_crast.c b/src/PJ_crast.c
index 0c5b706a..4773ee7c 100644
--- a/src/PJ_crast.c
+++ b/src/PJ_crast.c
@@ -56,7 +56,6 @@ int pj_crast_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;
- char e_args[] = {"+proj=crast +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
char s_args[] = {"+proj=crast +a=6400000 +lat_1=0.5 +lat_2=2"};
LP fwd_in[] = {