aboutsummaryrefslogtreecommitdiff
path: root/src/projections/cea.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-06 20:38:38 +0100
committerKristian Evers <kristianevers@gmail.com>2020-03-09 11:08:58 +0100
commitf830121a2f7a4d631b906e5f22f5a96dac55f084 (patch)
treeb32ba74fe3e249d9bd2eeb5e224a126cabd2c228 /src/projections/cea.cpp
parent04f74f53962de4149aa32c35c13148268fd37cd2 (diff)
downloadPROJ-f830121a2f7a4d631b906e5f22f5a96dac55f084.tar.gz
PROJ-f830121a2f7a4d631b906e5f22f5a96dac55f084.zip
src/projections/: remove assignments in expression and multiple statements per line
Should hopefully result in no change in results, and hopefully more readable code...
Diffstat (limited to 'src/projections/cea.cpp')
-rw-r--r--src/projections/cea.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/projections/cea.cpp b/src/projections/cea.cpp
index a7e5fd04..7e6d3212 100644
--- a/src/projections/cea.cpp
+++ b/src/projections/cea.cpp
@@ -43,9 +43,10 @@ static PJ_LP cea_e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse
static PJ_LP cea_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
PJ_LP lp = {0.0,0.0};
- double t;
- if ((t = fabs(xy.y *= P->k0)) - EPS <= 1.) {
+ xy.y *= P->k0;
+ const double t = fabs(xy.y);
+ if (t - EPS <= 1.) {
if (t >= 1.)
lp.phi = xy.y < 0. ? -M_HALFPI : M_HALFPI;
else
@@ -88,7 +89,8 @@ PJ *PROJECTION(cea) {
t = sin(t);
P->k0 /= sqrt(1. - P->es * t * t);
P->e = sqrt(P->es);
- if (!(Q->apa = pj_authset(P->es)))
+ Q->apa = pj_authset(P->es);
+ if (!(Q->apa))
return pj_default_destructor(P, ENOMEM);
Q->qp = pj_qsfn(1., P->e, P->one_es);