aboutsummaryrefslogtreecommitdiff
path: root/src/pj_transform.c
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2007-09-11 20:20:26 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2007-09-11 20:20:26 +0000
commit7e85f8ad3d99b41c1c0653d7ae257b10e1bfbdfa (patch)
treed9fc7a37e581b5a3903b448ddedc5618c356872d /src/pj_transform.c
parent09b1b40e4f77362e19f45ee3ac650474c4825fef (diff)
downloadPROJ-7e85f8ad3d99b41c1c0653d7ae257b10e1bfbdfa.tar.gz
PROJ-7e85f8ad3d99b41c1c0653d7ae257b10e1bfbdfa.zip
avoid use of static variables to make reentrant
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1403 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/pj_transform.c')
-rw-r--r--src/pj_transform.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/pj_transform.c b/src/pj_transform.c
index c3a437e5..afa13ace 100644
--- a/src/pj_transform.c
+++ b/src/pj_transform.c
@@ -30,6 +30,9 @@
******************************************************************************
*
* $Log$
+ * Revision 1.21 2007/09/11 20:19:36 fwarmerdam
+ * avoid use of static variables to make reentrant
+ *
* Revision 1.20 2006/10/12 21:04:39 fwarmerdam
* Added experimental +lon_wrap argument to set a "center point" for
* longitude wrapping of longitude values coming out of pj_transform().
@@ -372,6 +375,7 @@ int pj_geodetic_to_geocentric( double a, double es,
{
double b;
int i;
+ GeocentricInfo gi;
pj_errno = 0;
@@ -380,7 +384,7 @@ int pj_geodetic_to_geocentric( double a, double es,
else
b = a * sqrt(1-es);
- if( pj_Set_Geocentric_Parameters( a, b ) != 0 )
+ if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 )
{
pj_errno = PJD_ERR_GEOCENTRIC;
return pj_errno;
@@ -393,7 +397,7 @@ int pj_geodetic_to_geocentric( double a, double es,
if( x[io] == HUGE_VAL )
continue;
- if( pj_Convert_Geodetic_To_Geocentric( y[io], x[io], z[io],
+ if( pj_Convert_Geodetic_To_Geocentric( &gi, y[io], x[io], z[io],
x+io, y+io, z+io ) != 0 )
{
pj_errno = -14;
@@ -416,13 +420,14 @@ int pj_geocentric_to_geodetic( double a, double es,
{
double b;
int i;
+ GeocentricInfo gi;
if( es == 0.0 )
b = a;
else
b = a * sqrt(1-es);
- if( pj_Set_Geocentric_Parameters( a, b ) != 0 )
+ if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 )
{
pj_errno = PJD_ERR_GEOCENTRIC;
return pj_errno;
@@ -435,8 +440,8 @@ int pj_geocentric_to_geodetic( double a, double es,
if( x[io] == HUGE_VAL )
continue;
- pj_Convert_Geocentric_To_Geodetic( x[io], y[io], z[io],
- y+io, x+io, z+io );
+ pj_Convert_Geocentric_To_Geodetic( &gi, x[io], y[io], z[io],
+ y+io, x+io, z+io );
}
return 0;