From 3043b2f7fcf4471983c8d4472b17ccf9df1710c8 Mon Sep 17 00:00:00 2001 From: Micah Cochran Date: Sat, 28 May 2016 11:26:35 -0500 Subject: Change math constants, similar to PR #372. Use M_ namespace with the de facto standard M_PI and its ilk. Change names that are widely used in the project to be in the M_ namespace, so HALFPI becomes M_HALFPI. HALFPI is #defined as M_PI_2 (the defacto standard name). #defines _USE_MATH_DEFINES for MS Visual Studio (I didn't personally test this part, but Appveyor will not build otherwise). --- src/pj_transform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pj_transform.c') diff --git a/src/pj_transform.c b/src/pj_transform.c index ce7b96a3..1794678b 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -425,10 +425,10 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, if( x[point_offset*i] == HUGE_VAL ) continue; - while( x[point_offset*i] < dstdefn->long_wrap_center - PI ) - x[point_offset*i] += TWOPI; - while( x[point_offset*i] > dstdefn->long_wrap_center + PI ) - x[point_offset*i] -= TWOPI; + while( x[point_offset*i] < dstdefn->long_wrap_center - M_PI ) + x[point_offset*i] += M_TWOPI; + while( x[point_offset*i] > dstdefn->long_wrap_center + M_PI ) + x[point_offset*i] -= M_TWOPI; } } -- cgit v1.2.3