felipe          Wed Aug 13 12:20:54 2008 UTC

  Modified files:              
    /php-src/ext/gmp    gmp.c 
  Log:
  - New parameter parsing API (for gmp_testbit)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/gmp.c?r1=1.68&r2=1.69&diff_format=u
Index: php-src/ext/gmp/gmp.c
diff -u php-src/ext/gmp/gmp.c:1.68 php-src/ext/gmp/gmp.c:1.69
--- php-src/ext/gmp/gmp.c:1.68  Wed Jan 30 18:26:08 2008
+++ php-src/ext/gmp/gmp.c       Wed Aug 13 12:20:54 2008
@@ -1531,18 +1531,18 @@
    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");



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to