aboutsummaryrefslogtreecommitdiff
path: root/src/projections/collg.cpp
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2020-03-09 10:25:08 +0100
committerGitHub <noreply@github.com>2020-03-09 10:25:08 +0100
commit46c47e9adf6376ae06afabe5d24a0016a05ced82 (patch)
tree52c871c17f0c98c90ce6415cdb79dc1e73c14f4d /src/projections/collg.cpp
parent38ec5e662a74d40e02e38dc5dca553c3ecb04356 (diff)
parent60d3df673ca224107eb63e459073fc11ab5f4f16 (diff)
downloadPROJ-46c47e9adf6376ae06afabe5d24a0016a05ced82.tar.gz
PROJ-46c47e9adf6376ae06afabe5d24a0016a05ced82.zip
Merge pull request #2025 from rouault/projections_remove_assignments_in_expressions
src/projections/: remove assignments in expression and multiple statements per line
Diffstat (limited to 'src/projections/collg.cpp')
-rw-r--r--src/projections/collg.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/projections/collg.cpp b/src/projections/collg.cpp
index 40319a51..1b9d2da7 100644
--- a/src/projections/collg.cpp
+++ b/src/projections/collg.cpp
@@ -14,7 +14,8 @@ PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph";
static PJ_XY collg_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
PJ_XY xy = {0.0,0.0};
(void) P;
- if ((xy.y = 1. - sin(lp.phi)) <= 0.)
+ xy.y = 1. - sin(lp.phi);
+ if (xy.y <= 0.)
xy.y = 0.;
else
xy.y = sqrt(xy.y);
@@ -27,7 +28,8 @@ static PJ_XY collg_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forwar
static PJ_LP collg_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / FYC - 1.;
- if (fabs(lp.phi = 1. - lp.phi * lp.phi) < 1.)
+ lp.phi = 1. - lp.phi * lp.phi;
+ if (fabs(lp.phi) < 1.)
lp.phi = asin(lp.phi);
else if (fabs(lp.phi) > ONEEPS) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
@@ -36,7 +38,8 @@ static PJ_LP collg_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, invers
lp.phi = lp.phi < 0. ? -M_HALFPI : M_HALFPI;
}
- if ((lp.lam = 1. - sin(lp.phi)) <= 0.)
+ lp.lam = 1. - sin(lp.phi);
+ if (lp.lam <= 0.)
lp.lam = 0.;
else
lp.lam = xy.x / (FXC * sqrt(lp.lam));