1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00

- New parameter parsing API (for gmp_testbit)

This commit is contained in:
Felipe Pena
2008-08-13 12:20:54 +00:00
parent 7f5b9cf91a
commit b13b2a42e1
+6 -6
View File
@@ -1531,18 +1531,18 @@ ZEND_FUNCTION(gmp_clrbit)
Tests if bit is set in a */
ZEND_FUNCTION(gmp_testbit)
{
zval **a_arg, **ind_arg;
zval *a_arg;
long ind_arg;
int index;
mpz_t *gmpnum_a;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &ind_arg) == FAILURE){
WRONG_PARAM_COUNT;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &a_arg, &ind_arg) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp);
ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, &a_arg, -1, GMP_RESOURCE_NAME, le_gmp);
convert_to_long_ex(ind_arg);
index = Z_LVAL_PP(ind_arg);
index = ind_arg;
if (index < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");