aboutsummaryrefslogtreecommitdiff
path: root/src/geodesic.c
diff options
context:
space:
mode:
authorCharles Karney <ckarney@karney.com>2016-02-15 20:51:06 -0500
committerCharles Karney <ckarney@karney.com>2016-02-15 20:51:06 -0500
commit2101a86ef6870b5073df2a8b93ece0d5ce44e451 (patch)
tree64f88c901a292293e1cb1817013dec19ebf36796 /src/geodesic.c
parent16df65976714747f2ab5fb73a47327970ccd723f (diff)
downloadPROJ-2101a86ef6870b5073df2a8b93ece0d5ce44e451.tar.gz
PROJ-2101a86ef6870b5073df2a8b93ece0d5ce44e451.zip
geodesic.c: move declarations to beginings of functions.
Diffstat (limited to 'src/geodesic.c')
-rw-r--r--src/geodesic.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/geodesic.c b/src/geodesic.c
index 8d9c9285..e897e89e 100644
--- a/src/geodesic.c
+++ b/src/geodesic.c
@@ -187,8 +187,9 @@ static real AngDiff(real x, real y, real* e) {
static real AngRound(real x) {
const real z = 1/(real)(16);
+ volatile real y;
if (x == 0) return 0;
- volatile real y = fabs(x);
+ y = fabs(x);
/* The compiler mustn't "simplify" z - (z - y) to y */
y = y < z ? z - (z - y) : y;
return x < 0 ? -y : y;
@@ -413,8 +414,8 @@ static void geod_lineinit_int(struct geod_geodesicline* l,
void geod_lineinit(struct geod_geodesicline* l,
const struct geod_geodesic* g,
real lat1, real lon1, real azi1, unsigned caps) {
- azi1 = AngNormalize(azi1);
real salp1, calp1;
+ azi1 = AngNormalize(azi1);
/* Guard against underflow in salp0 */
sincosdx(AngRound(azi1), &salp1, &calp1);
geod_lineinit_int(l, g, lat1, lon1, azi1, salp1, calp1, caps);