aboutsummaryrefslogtreecommitdiff
path: root/src/projections/geos.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/geos.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/geos.cpp')
-rw-r--r--src/projections/geos.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/projections/geos.cpp b/src/projections/geos.cpp
index fcd7d4ee..338f07c2 100644
--- a/src/projections/geos.cpp
+++ b/src/projections/geos.cpp
@@ -121,7 +121,7 @@ static PJ_XY geos_e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward
static PJ_LP geos_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- double Vx, Vy, Vz, a, b, det, k;
+ double Vx, Vy, Vz, a, b, k;
/* Setting three components of vector from satellite to position.*/
Vx = -1.0;
@@ -136,7 +136,8 @@ static PJ_LP geos_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse
/* Calculation of terms in cubic equation and determinant.*/
a = Vy * Vy + Vz * Vz + Vx * Vx;
b = 2 * Q->radius_g * Vx;
- if ((det = (b * b) - 4 * a * Q->C) < 0.) {
+ const double det = (b * b) - 4 * a * Q->C;
+ if (det < 0.) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return lp;
}
@@ -158,7 +159,7 @@ static PJ_LP geos_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse
static PJ_LP geos_e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- double Vx, Vy, Vz, a, b, det, k;
+ double Vx, Vy, Vz, a, b, k;
/* Setting three components of vector from satellite to position.*/
Vx = -1.0;
@@ -175,7 +176,8 @@ static PJ_LP geos_e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse
a = Vz / Q->radius_p;
a = Vy * Vy + a * a + Vx * Vx;
b = 2 * Q->radius_g * Vx;
- if ((det = (b * b) - 4 * a * Q->C) < 0.) {
+ const double det = (b * b) - 4 * a * Q->C;
+ if (det < 0.) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return lp;
}