@@ -122,9 +122,8 @@ ZEND_BEGIN_ARG_INFO_EX(cartesian_to_polar_args, 0, 0, 4)
122122 ZEND_ARG_INFO (0 , reference_ellipsoid )
123123ZEND_END_ARG_INFO ()
124124
125- ZEND_BEGIN_ARG_INFO_EX (transform_datum_args , 0 , 0 , 4 )
126- ZEND_ARG_INFO (0 , latitude )
127- ZEND_ARG_INFO (0 , longitude )
125+ ZEND_BEGIN_ARG_INFO_EX (transform_datum_args , 0 , 0 , 3 )
126+ ZEND_ARG_INFO (0 , GeoJSONPoint )
128127 ZEND_ARG_INFO (0 , from_reference_ellipsoid )
129128 ZEND_ARG_INFO (0 , to_reference_ellipsoid )
130129ZEND_END_ARG_INFO ()
@@ -156,9 +155,8 @@ ZEND_BEGIN_ARG_INFO_EX(interpolate_polygon_args, 0, 0, 2)
156155 ZEND_ARG_INFO (0 , epsilon )
157156ZEND_END_ARG_INFO ()
158157
159- ZEND_BEGIN_ARG_INFO_EX (geohash_encode_args , 0 , 0 , 3 )
160- ZEND_ARG_INFO (0 , latitude )
161- ZEND_ARG_INFO (0 , longitude )
158+ ZEND_BEGIN_ARG_INFO_EX (geohash_encode_args , 0 , 0 , 2 )
159+ ZEND_ARG_INFO (0 , GeoJSONPoint )
162160 ZEND_ARG_INFO (0 , precision )
163161ZEND_END_ARG_INFO ()
164162
@@ -275,7 +273,7 @@ void retval_point_from_coordinates(zval *return_value, double lon, double lat)
275273#endif
276274}
277275
278- static int parse_point_pair (zval * coordinates , double * lon , double * lat TSRMLS_DC )
276+ static int parse_point_pair (zval * coordinates , double * lon , double * lat )
279277{
280278 HashTable * coords ;
281279#if PHP_VERSION_ID >= 70000
@@ -285,7 +283,7 @@ static int parse_point_pair(zval *coordinates, double *lon, double *lat TSRMLS_D
285283#endif
286284
287285 if (Z_TYPE_P (coordinates ) != IS_ARRAY ) {
288- zend_throw_exception_ex (spl_ce_InvalidArgumentException , 0 TSRMLS_CC , "Expected a coordinate pair as an array, but %s given" , zend_zval_type_name (coordinates ));
286+ zend_throw_exception_ex (spl_ce_InvalidArgumentException , 0 , "Expected a coordinate pair as an array, but %s given" , zend_zval_type_name (coordinates ));
289287 return 0 ;
290288 }
291289
@@ -319,7 +317,7 @@ static int parse_point_pair(zval *coordinates, double *lon, double *lat TSRMLS_D
319317 return 1 ;
320318}
321319
322- int geojson_point_to_lon_lat (zval * point , double * lon , double * lat TSRMLS_DC )
320+ int geojson_point_to_lon_lat (zval * point , double * lon , double * lat )
323321{
324322#if PHP_VERSION_ID >= 70000
325323 zval * type , * coordinates ;
@@ -336,7 +334,7 @@ int geojson_point_to_lon_lat(zval *point, double *lon, double *lat TSRMLS_DC)
336334 if (Z_TYPE_P (coordinates ) != IS_ARRAY ) {
337335 return 0 ;
338336 }
339- return parse_point_pair (coordinates , lon , lat TSRMLS_CC );
337+ return parse_point_pair (coordinates , lon , lat );
340338#else
341339 zval * * type , * * coordinates ;
342340
@@ -352,7 +350,7 @@ int geojson_point_to_lon_lat(zval *point, double *lon, double *lat TSRMLS_DC)
352350 if (Z_TYPE_PP (coordinates ) != IS_ARRAY ) {
353351 return 0 ;
354352 }
355- return parse_point_pair (* coordinates , lon , lat TSRMLS_CC );
353+ return parse_point_pair (* coordinates , lon , lat );
356354#endif
357355}
358356
@@ -398,7 +396,7 @@ double php_geo_vincenty(double from_lat, double from_long, double to_lat, double
398396 double cosof2sigma , A , B , C , uSq , deltaSigma , s ;
399397 int loopLimit = 100 ;
400398 double precision = 0.000000000001 ;
401-
399+
402400 U1 = atan ((1.0 - eli .f ) * tan (from_lat ));
403401 U2 = atan ((1.0 - eli .f ) * tan (to_lat ));
404402 L = to_long - from_long ;
@@ -410,7 +408,7 @@ double php_geo_vincenty(double from_lat, double from_long, double to_lat, double
410408 do {
411409 sinLambda = sin (lambda );
412410 cosLambda = cos (lambda );
413- sinSigma = sqrt ((cosU2 * sinLambda ) * (cosU2 * sinLambda ) +
411+ sinSigma = sqrt ((cosU2 * sinLambda ) * (cosU2 * sinLambda ) +
414412 (cosU1 * sinU2 - sinU1 * cosU2 * cosLambda ) * (cosU1 * sinU2 - sinU1 * cosU2 * cosLambda ));
415413 cosSigma = sinU1 * sinU2 + cosU1 * cosU2 * cosLambda ;
416414 sigma = atan2 (sinSigma , cosSigma );
@@ -530,7 +528,7 @@ PHP_FUNCTION(dms_to_decimal)
530528 int direction_len ;
531529#endif
532530
533- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "ddd|s" , & degrees , & minutes , & seconds , & direction , & direction_len ) == FAILURE ) {
531+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "ddd|s" , & degrees , & minutes , & seconds , & direction , & direction_len ) == FAILURE ) {
534532 return ;
535533 }
536534
@@ -560,7 +558,7 @@ PHP_FUNCTION(decimal_to_dms)
560558 int coordinate_len ;
561559#endif
562560
563- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "ds" , & decimal , & coordinate , & coordinate_len ) == FAILURE ) {
561+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "ds" , & decimal , & coordinate , & coordinate_len ) == FAILURE ) {
564562 return ;
565563 }
566564
@@ -591,7 +589,7 @@ PHP_FUNCTION(helmert)
591589 long from_reference_ellipsoid = 0 , to_reference_ellipsoid = 0 ;
592590 geo_helmert_constants helmert_constants ;
593591
594- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "ddd|ll" , & x , & y , & z , & from_reference_ellipsoid , & to_reference_ellipsoid ) == FAILURE ) {
592+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "ddd|ll" , & x , & y , & z , & from_reference_ellipsoid , & to_reference_ellipsoid ) == FAILURE ) {
595593 return ;
596594 }
597595
@@ -612,7 +610,7 @@ PHP_FUNCTION(polar_to_cartesian)
612610 long reference_ellipsoid ;
613611 geo_cartesian point ;
614612
615- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "dd|l" , & latitude , & longitude , & reference_ellipsoid ) == FAILURE ) {
613+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "dd|l" , & latitude , & longitude , & reference_ellipsoid ) == FAILURE ) {
616614 return ;
617615 }
618616
@@ -633,7 +631,7 @@ PHP_FUNCTION(cartesian_to_polar)
633631 long reference_ellipsoid ;
634632 geo_lat_long polar ;
635633
636- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "ddd|l" , & x , & y , & z , & reference_ellipsoid ) == FAILURE ) {
634+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "ddd|l" , & x , & y , & z , & reference_ellipsoid ) == FAILURE ) {
637635 return ;
638636 }
639637
@@ -658,11 +656,11 @@ PHP_FUNCTION(transform_datum)
658656 geo_lat_long polar ;
659657 geo_helmert_constants helmert_constants ;
660658
661- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "all" , & geojson , & from_reference_ellipsoid , & to_reference_ellipsoid ) == FAILURE ) {
659+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "all" , & geojson , & from_reference_ellipsoid , & to_reference_ellipsoid ) == FAILURE ) {
662660 return ;
663661 }
664662
665- if (!geojson_point_to_lon_lat (geojson , & longitude , & latitude TSRMLS_CC )) {
663+ if (!geojson_point_to_lon_lat (geojson , & longitude , & latitude )) {
666664 RETURN_FALSE ;
667665 }
668666
@@ -690,12 +688,12 @@ PHP_FUNCTION(haversine)
690688 zval * from_geojson , * to_geojson ;
691689 double from_lat , from_long , to_lat , to_long ;
692690
693- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "aa|d" , & from_geojson , & to_geojson , & radius ) == FAILURE ) {
691+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "aa|d" , & from_geojson , & to_geojson , & radius ) == FAILURE ) {
694692 return ;
695693 }
696694
697- geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat TSRMLS_CC );
698- geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat TSRMLS_CC );
695+ geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat );
696+ geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat );
699697
700698 RETURN_DOUBLE (php_geo_haversine (from_lat * GEO_DEG_TO_RAD , from_long * GEO_DEG_TO_RAD , to_lat * GEO_DEG_TO_RAD , to_long * GEO_DEG_TO_RAD ) * radius );
701699}
@@ -709,12 +707,12 @@ PHP_FUNCTION(vincenty)
709707 double from_lat , from_long , to_lat , to_long ;
710708 long reference_ellipsoid = GEO_WGS84 ;
711709
712- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "aa|l" , & from_geojson , & to_geojson , & reference_ellipsoid ) == FAILURE ) {
710+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "aa|l" , & from_geojson , & to_geojson , & reference_ellipsoid ) == FAILURE ) {
713711 return ;
714712 }
715713
716- geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat TSRMLS_CC );
717- geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat TSRMLS_CC );
714+ geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat );
715+ geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat );
718716
719717 geo_ellipsoid eli = get_ellipsoid (reference_ellipsoid );
720718 RETURN_DOUBLE (php_geo_vincenty (from_lat * GEO_DEG_TO_RAD , from_long * GEO_DEG_TO_RAD , to_lat * GEO_DEG_TO_RAD , to_long * GEO_DEG_TO_RAD , eli ));
@@ -747,12 +745,12 @@ PHP_FUNCTION(fraction_along_gc_line)
747745 double from_lat , from_long , to_lat , to_long , fraction ;
748746 double res_lat , res_long ;
749747
750- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "aad" , & from_geojson , & to_geojson , & fraction ) == FAILURE ) {
748+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "aad" , & from_geojson , & to_geojson , & fraction ) == FAILURE ) {
751749 return ;
752750 }
753751
754- geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat TSRMLS_CC );
755- geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat TSRMLS_CC );
752+ geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat );
753+ geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat );
756754
757755 php_geo_fraction_along_gc_line (
758756 from_lat * GEO_DEG_TO_RAD ,
@@ -795,12 +793,12 @@ PHP_FUNCTION(initial_bearing)
795793 zval * from_geojson , * to_geojson ;
796794 double from_lat , from_long , to_lat , to_long , bearing ;
797795
798- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "aa" , & from_geojson , & to_geojson ) == FAILURE ) {
796+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "aa" , & from_geojson , & to_geojson ) == FAILURE ) {
799797 return ;
800798 }
801799
802- geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat TSRMLS_CC );
803- geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat TSRMLS_CC );
800+ geojson_point_to_lon_lat (from_geojson , & from_long , & from_lat );
801+ geojson_point_to_lon_lat (to_geojson , & to_long , & to_lat );
804802
805803 bearing = php_initial_bearing (
806804 from_lat * GEO_DEG_TO_RAD ,
@@ -813,7 +811,7 @@ PHP_FUNCTION(initial_bearing)
813811}
814812/* }}} */
815813
816- geo_array * geo_hashtable_to_array (zval * array TSRMLS_DC )
814+ geo_array * geo_hashtable_to_array (zval * array )
817815{
818816 geo_array * tmp ;
819817 int element_count ;
@@ -832,12 +830,12 @@ geo_array *geo_hashtable_to_array(zval *array TSRMLS_DC)
832830#if PHP_VERSION_ID >= 70000
833831 ZEND_HASH_FOREACH_VAL (Z_ARRVAL_P (array ), entry ) {
834832
835- if (!parse_point_pair (entry , & lon , & lat TSRMLS_CC )) {
833+ if (!parse_point_pair (entry , & lon , & lat )) {
836834#else
837835 zend_hash_internal_pointer_reset_ex (Z_ARRVAL_P (array ), & pos );
838836 while (zend_hash_get_current_data_ex (Z_ARRVAL_P (array ), (void * * )& entry , & pos ) == SUCCESS ) {
839837
840- if (!parse_point_pair (* entry , & lon , & lat TSRMLS_CC )) {
838+ if (!parse_point_pair (* entry , & lon , & lat )) {
841839#endif
842840
843841 goto failure ;
@@ -862,7 +860,7 @@ geo_array *geo_hashtable_to_array(zval *array TSRMLS_DC)
862860 return NULL ;
863861}
864862
865- int geojson_linestring_to_array (zval * line , geo_array * * array TSRMLS_DC )
863+ int geojson_linestring_to_array (zval * line , geo_array * * array )
866864{
867865 geo_array * tmp ;
868866#if PHP_VERSION_ID >= 70000
@@ -885,7 +883,7 @@ int geojson_linestring_to_array(zval *line, geo_array **array TSRMLS_DC)
885883 return 0 ;
886884 }
887885
888- tmp = geo_hashtable_to_array (coordinates TSRMLS_CC );
886+ tmp = geo_hashtable_to_array (coordinates );
889887#else
890888 zval * * type , * * coordinates ;
891889
@@ -906,7 +904,7 @@ int geojson_linestring_to_array(zval *line, geo_array **array TSRMLS_DC)
906904 return 0 ;
907905 }
908906
909- tmp = geo_hashtable_to_array (* coordinates TSRMLS_CC );
907+ tmp = geo_hashtable_to_array (* coordinates );
910908#endif
911909 if (tmp && array ) {
912910 * array = tmp ;
@@ -980,7 +978,7 @@ PHP_FUNCTION(rdp_simplify)
980978 int i ;
981979 zval * pair ;
982980
983- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "zd" , & points_array , & epsilon ) == FAILURE ) {
981+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "zd" , & points_array , & epsilon ) == FAILURE ) {
984982 return ;
985983 }
986984
@@ -990,7 +988,7 @@ PHP_FUNCTION(rdp_simplify)
990988
991989 array_init (return_value );
992990
993- points = geo_hashtable_to_array (points_array TSRMLS_CC );
991+ points = geo_hashtable_to_array (points_array );
994992 if (!points ) {
995993 return ;
996994 }
@@ -1057,11 +1055,11 @@ PHP_FUNCTION(interpolate_linestring)
10571055 zval * pair ;
10581056 geo_array * new_array ;
10591057
1060- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "zd" , & line , & epsilon ) == FAILURE ) {
1058+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "zd" , & line , & epsilon ) == FAILURE ) {
10611059 return ;
10621060 }
10631061
1064- if (!geojson_linestring_to_array (line , & points TSRMLS_CC )) {
1062+ if (!geojson_linestring_to_array (line , & points )) {
10651063 RETURN_FALSE ;
10661064 }
10671065
@@ -1097,15 +1095,15 @@ PHP_FUNCTION(interpolate_polygon)
10971095 int i ;
10981096 zval * pair ;
10991097
1100- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "zd" , & polygon , & epsilon ) == FAILURE ) {
1098+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "zd" , & polygon , & epsilon ) == FAILURE ) {
11011099 return ;
11021100 }
11031101
11041102 if (Z_TYPE_P (polygon ) != IS_ARRAY ) {
11051103 return ;
11061104 }
11071105
1108- if (!geojson_linestring_to_array (polygon , & points TSRMLS_CC )) {
1106+ if (!geojson_linestring_to_array (polygon , & points )) {
11091107 RETURN_FALSE ;
11101108 }
11111109
@@ -1144,11 +1142,11 @@ PHP_FUNCTION(geohash_encode)
11441142 zval * geojson ;
11451143 char * hash ;
11461144
1147- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "al" , & geojson , & precision ) == FAILURE ) {
1145+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "al" , & geojson , & precision ) == FAILURE ) {
11481146 return ;
11491147 }
11501148
1151- if (!geojson_point_to_lon_lat (geojson , & longitude , & latitude TSRMLS_CC )) {
1149+ if (!geojson_point_to_lon_lat (geojson , & longitude , & latitude )) {
11521150 RETURN_FALSE ;
11531151 }
11541152
@@ -1172,7 +1170,7 @@ PHP_FUNCTION(geohash_decode)
11721170 int hash_len ;
11731171#endif
11741172
1175- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "s" , & hash , & hash_len ) == FAILURE ) {
1173+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "s" , & hash , & hash_len ) == FAILURE ) {
11761174 return ;
11771175 }
11781176
0 commit comments