]> granicus.if.org Git - php/commitdiff
- New parameter parsing API (for gmp_testbit)
authorFelipe Pena <felipe@php.net>
Wed, 13 Aug 2008 12:20:54 +0000 (12:20 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 13 Aug 2008 12:20:54 +0000 (12:20 +0000)
ext/gmp/gmp.c

index bbb4b7bb48253446fadfb7e0b6dc6a4888f87884..9e83e1109af48023c28f8e316076912fdd2fb32a 100644 (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");