diff options
| author | Thomas Knudsen <lastname DOT firstname AT gmail DOT com> | 2016-04-14 21:07:50 +0200 |
|---|---|---|
| committer | Thomas Knudsen <lastname DOT firstname AT gmail DOT com> | 2016-04-14 21:07:50 +0200 |
| commit | 147885200d7c0474a59b03224848a87b77bef917 (patch) | |
| tree | 640574707a1e5b79fc48422c4f40be6ddd81b275 /src/PJ_cea.c | |
| parent | 1b9f4331c65d7d98d276433cc124e667c9aa695e (diff) | |
| download | PROJ-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/PJ_cea.c')
| -rw-r--r-- | src/PJ_cea.c | 34 |
1 files changed, 16 insertions, 18 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 |
