cvs: php-src /ext/spl php_spl.c spl_array.c

From: Date: Sun, 12 Feb 2006 16:43:30 +0000
Subject: cvs: php-src /ext/spl php_spl.c spl_array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-36855@lists.php.net to get a copy of this message
helly Sun Feb 12 16:43:30 2006 UTC Modified files: /php-src/ext/spl php_spl.c spl_array.c Log: - No more old parameter api usage http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/php_spl.c?r1=1.83&r2=1.84&diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.83 php-src/ext/spl/php_spl.c:1.84 --- php-src/ext/spl/php_spl.c:1.83 Tue Jan 17 12:18:52 2006 +++ php-src/ext/spl/php_spl.c Sun Feb 12 16:43:30 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_spl.c,v 1.83 2006/01/17 12:18:52 dmitry Exp $ */ +/* $Id: php_spl.c,v 1.84 2006/02/12 16:43:30 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -340,7 +340,7 @@ Try all registerd autoload function to load the requested class */ PHP_FUNCTION(spl_autoload_call) { - zval **class_name, *retval = NULL; + zval *class_name, *retval = NULL; int class_name_len, class_name_type; char *func_name, *lc_name; uint func_name_len; @@ -348,20 +348,20 @@ HashPosition function_pos; autoload_func_info *alfi; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name) == FAILURE || - Z_TYPE_PP(class_name) != (UG(unicode)?IS_UNICODE:IS_STRING)) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE || + Z_TYPE_P(class_name) != (UG(unicode)?IS_UNICODE:IS_STRING)) { return; } if (SPL_G(autoload_functions)) { - class_name_type = Z_TYPE_PP(class_name); - class_name_len = Z_UNILEN_PP(class_name); - lc_name = zend_u_str_tolower_dup(class_name_type, Z_UNIVAL_PP(class_name), Z_UNILEN_PP(class_name)); + class_name_type = Z_TYPE_P(class_name); + class_name_len = Z_UNILEN_P(class_name); + lc_name = zend_u_str_tolower_dup(class_name_type, Z_UNIVAL_P(class_name), class_name_len); zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos); while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS && !EG(exception)) { zend_hash_get_current_key_ex(SPL_G(autoload_functions), &func_name, &func_name_len, &dummy, 0, &function_pos); zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) &alfi, &function_pos); - zend_call_method(alfi->obj ? &alfi->obj : NULL, alfi->ce, &alfi->func_ptr, func_name, func_name_len, &retval, 1, *class_name, NULL TSRMLS_CC); + zend_call_method(alfi->obj ? &alfi->obj : NULL, alfi->ce, &alfi->func_ptr, func_name, func_name_len, &retval, 1, class_name, NULL TSRMLS_CC); if (retval) { zval_ptr_dtor(&retval); } @@ -373,7 +373,7 @@ efree(lc_name); } else { /* do not use or overwrite &EG(autoload_func) here */ - zend_call_method_with_1_params(NULL, NULL, NULL, "spl_autoload", NULL, *class_name); + zend_call_method_with_1_params(NULL, NULL, NULL, "spl_autoload", NULL, class_name); } } /* }}} */ http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_array.c?r1=1.96&r2=1.97&diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.96 php-src/ext/spl/spl_array.c:1.97 --- php-src/ext/spl/spl_array.c:1.96 Mon Feb 6 02:07:08 2006 +++ php-src/ext/spl/spl_array.c Sun Feb 12 16:43:30 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_array.c,v 1.96 2006/02/06 02:07:08 helly Exp $ */ +/* $Id: spl_array.c,v 1.97 2006/02/12 16:43:30 helly Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -978,7 +978,7 @@ array_init(return_value); zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*)); - if (ZEND_NUM_ARGS() > 1 || zend_get_parameters_ex(1, &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &array) == FAILURE) { WRONG_PARAM_COUNT; } if (Z_TYPE_PP(array) == IS_OBJECT && intern == (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC)) @@ -1119,18 +1119,18 @@ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC); HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - zval tmp, **arg; + zval tmp, *arg; INIT_PZVAL(&tmp); Z_TYPE(tmp) = IS_ARRAY; Z_ARRVAL(tmp) = aht; if (use_arg) { - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { + if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { zend_throw_exception(U_CLASS_ENTRY(spl_ce_BadMethodCallException), "Function expects exactly one argument", 0 TSRMLS_CC); return; } - zend_call_method(NULL, NULL, NULL, fname, fname_len, &return_value, 2, &tmp, *arg TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &return_value, 2, &tmp, arg TSRMLS_CC); } else { zend_call_method(NULL, NULL, NULL, fname, fname_len, &return_value, 1, &tmp, NULL TSRMLS_CC); }

« previous php.cvs (#36855) next »