Skip to content

Commit a50db7c

Browse files
committed
Fixed arginfo and added prototype.
1 parent c218672 commit a50db7c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

geospatial.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
#include "ext/standard/info.h"
2828
#include "php_geospatial.h"
2929

30-
ZEND_BEGIN_ARG_INFO(haversine_args,ZEND_SEND_BY_VAL)
31-
ZEND_ARG_INFO(0,fromLatitude)
32-
ZEND_ARG_INFO(0,fromLongitude)
33-
ZEND_ARG_INFO(0,toLatitude)
34-
ZEND_ARG_INFO(0,toLongitude)
35-
ZEND_ARG_INFO(0,radius)
30+
ZEND_BEGIN_ARG_INFO_EX(haversine_args, 0, 0, 4)
31+
ZEND_ARG_INFO(0, fromLatitude)
32+
ZEND_ARG_INFO(0, fromLongitude)
33+
ZEND_ARG_INFO(0, toLatitude)
34+
ZEND_ARG_INFO(0, toLongitude)
35+
ZEND_ARG_INFO(0, radius)
3636
ZEND_END_ARG_INFO()
3737

3838
/* {{{ geospatial_functions[]
@@ -97,7 +97,8 @@ PHP_MINFO_FUNCTION(geospatial)
9797
}
9898
/* }}} */
9999

100-
100+
/* {{{ proto haversine(double fromLat, double fromLong, double toLat, double toLong [, double radius ])
101+
* Calculates the greater circle distance between the two lattitude/longitude pairs */
101102
PHP_FUNCTION(haversine)
102103
{
103104
double fromLat, fromLong, toLat, toLong, deltaLat, deltaLong;
@@ -118,6 +119,7 @@ PHP_FUNCTION(haversine)
118119
result = radius * 2.0 * asin(sqrt(latH + result * longH));
119120
RETURN_DOUBLE(result);
120121
}
122+
/* }}} */
121123

122124
/*
123125
* Local variables:

0 commit comments

Comments
 (0)