From b180fc2daa56cc0bfea3e1561fabdfdb452995b4 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Sat, 20 Sep 2014 21:28:01 +0100 Subject: update SPL extension for native-tls branch --- ext/spl/php_spl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/spl') diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index 534a03885e..cd8ea05f39 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -68,7 +68,7 @@ ZEND_END_MODULE_GLOBALS(spl) #ifdef ZTS # define SPL_G(v) TSRMG(spl_globals_id, zend_spl_globals *, v) -extern int spl_globals_id; +TSRMG_DH(zend_spl_globals, sapi_globals_id); #else # define SPL_G(v) (spl_globals.v) extern zend_spl_globals spl_globals; -- cgit v1.2.1 From d11734b4b00f57de80d931ad1c522e00082443af Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 25 Sep 2014 18:48:27 +0200 Subject: reworked the patch, less new stuff but worky TLS is already used in TSRM, the way exporting the tsrm cache through a thread local variable is not portable. Additionally, the current patch suffers from bugs which are hard to find, but prevent it to be worky with apache. What is done here is mainly uses the idea from the RFC patch, but - __thread variable is removed - offset math and declarations are removed - extra macros and definitions are removed What is done merely is - use an inline function to access the tsrm cache. The function uses the portable tsrm_tls_get macro which is cheap - all the TSRM_* macros are set to placebo. Thus this opens the way remove them later Except that, the logic is old. TSRMLS_FETCH will have to be done once per thread, then tsrm_get_ls_cache() can be used. Things seeming to be worky are cli, cli server and apache. I also tried to enable bz2 shared and it has worked out of the box. The change is yet minimal diffing to the current master bus is a worky start, IMHO. Though will have to recheck the other previously done SAPIs - embed and cgi. The offsets can be added to the tsrm_resource_type struct, then it'll not be needed to declare them in the userspace. Even the "done" member type can be changed to int16 or smaller, then adding the offset as int16 will not change the struct size. As well on the todo might be removing the hashed storage, thread_id != thread_id and linked list logic in favour of the explicit TLS operations. --- ext/spl/php_spl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/spl') diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index cd8ea05f39..534a03885e 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -68,7 +68,7 @@ ZEND_END_MODULE_GLOBALS(spl) #ifdef ZTS # define SPL_G(v) TSRMG(spl_globals_id, zend_spl_globals *, v) -TSRMG_DH(zend_spl_globals, sapi_globals_id); +extern int spl_globals_id; #else # define SPL_G(v) (spl_globals.v) extern zend_spl_globals spl_globals; -- cgit v1.2.1 From 991a04b068c0b49ed5022d8da735002c5187031b Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 15 Oct 2014 12:24:03 +0200 Subject: made ext/date and ext/spl use static tsrm ls cache --- ext/spl/config.m4 | 2 +- ext/spl/config.w32 | 2 +- ext/spl/php_spl.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/spl') diff --git a/ext/spl/config.m4 b/ext/spl/config.m4 index a0f0d1a06d..869e542ef4 100755 --- a/ext/spl/config.m4 +++ b/ext/spl/config.m4 @@ -22,6 +22,6 @@ int main(int argc, char **argv) { CPPFLAGS=$old_CPPFLAGS AC_DEFINE_UNQUOTED(HAVE_PACKED_OBJECT_VALUE, $ac_result, [Whether struct _zend_object_value is packed]) AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard PHP Library) support]) - PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, no) + PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_INSTALL_HEADERS([ext/spl], [php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h]) PHP_ADD_EXTENSION_DEP(spl, pcre, true) diff --git a/ext/spl/config.w32 b/ext/spl/config.w32 index 77cbd20346..56c466c220 100644 --- a/ext/spl/config.w32 +++ b/ext/spl/config.w32 @@ -1,7 +1,7 @@ // $Id$ // vim:ft=javascript -EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */); +EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE('HAVE_SPL', 1); PHP_SPL="yes"; PHP_INSTALL_HEADERS("ext/spl", "php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h"); diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index 534a03885e..8db6f09e6d 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -67,7 +67,7 @@ ZEND_BEGIN_MODULE_GLOBALS(spl) ZEND_END_MODULE_GLOBALS(spl) #ifdef ZTS -# define SPL_G(v) TSRMG(spl_globals_id, zend_spl_globals *, v) +# define SPL_G(v) ZEND_TSRMG(spl_globals_id, zend_spl_globals *, v) extern int spl_globals_id; #else # define SPL_G(v) (spl_globals.v) -- cgit v1.2.1 From bdeb220f48825642f84cdbf3ff23a30613c92e86 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 13 Dec 2014 23:06:14 +0100 Subject: first shot remove TSRMLS_* things --- ext/spl/php_spl.c | 102 ++++---- ext/spl/php_spl.h | 2 +- ext/spl/spl_array.c | 430 +++++++++++++++---------------- ext/spl/spl_array.h | 4 +- ext/spl/spl_directory.c | 550 +++++++++++++++++++-------------------- ext/spl/spl_directory.h | 12 +- ext/spl/spl_dllist.c | 196 +++++++------- ext/spl/spl_engine.c | 4 +- ext/spl/spl_engine.h | 22 +- ext/spl/spl_exceptions.c | 2 +- ext/spl/spl_fixedarray.c | 172 ++++++------- ext/spl/spl_functions.c | 36 +-- ext/spl/spl_functions.h | 36 +-- ext/spl/spl_heap.c | 182 ++++++------- ext/spl/spl_iterators.c | 652 +++++++++++++++++++++++------------------------ ext/spl/spl_iterators.h | 4 +- ext/spl/spl_observer.c | 168 ++++++------ 17 files changed, 1287 insertions(+), 1287 deletions(-) (limited to 'ext/spl') diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index aa740c40e2..bd6fa9019b 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -61,7 +61,7 @@ static PHP_GINIT_FUNCTION(spl) } /* }}} */ -static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autoload TSRMLS_DC) +static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autoload) { zend_class_entry *ce; @@ -72,10 +72,10 @@ static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autol ce = zend_hash_find_ptr(EG(class_table), lc_name); zend_string_free(lc_name); } else { - ce = zend_lookup_class(name TSRMLS_CC); + ce = zend_lookup_class(name); } if (ce == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class %s does not exist%s", name->val, autoload ? " and could not be loaded" : ""); + php_error_docref(NULL, E_WARNING, "Class %s does not exist%s", name->val, autoload ? " and could not be loaded" : ""); return NULL; } @@ -90,17 +90,17 @@ PHP_FUNCTION(class_parents) zend_class_entry *parent_class, *ce; zend_bool autoload = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) { RETURN_FALSE; } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected"); + php_error_docref(NULL, E_WARNING, "object or string expected"); RETURN_FALSE; } if (Z_TYPE_P(obj) == IS_STRING) { - if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) { + if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) { RETURN_FALSE; } } else { @@ -110,7 +110,7 @@ PHP_FUNCTION(class_parents) array_init(return_value); parent_class = ce->parent; while (parent_class) { - spl_add_class_name(return_value, parent_class, 0, 0 TSRMLS_CC); + spl_add_class_name(return_value, parent_class, 0, 0); parent_class = parent_class->parent; } } @@ -124,16 +124,16 @@ PHP_FUNCTION(class_implements) zend_bool autoload = 1; zend_class_entry *ce; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) { RETURN_FALSE; } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected"); + php_error_docref(NULL, E_WARNING, "object or string expected"); RETURN_FALSE; } if (Z_TYPE_P(obj) == IS_STRING) { - if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) { + if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) { RETURN_FALSE; } } else { @@ -141,7 +141,7 @@ PHP_FUNCTION(class_implements) } array_init(return_value); - spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE TSRMLS_CC); + spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE); } /* }}} */ @@ -153,16 +153,16 @@ PHP_FUNCTION(class_uses) zend_bool autoload = 1; zend_class_entry *ce; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) { RETURN_FALSE; } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected"); + php_error_docref(NULL, E_WARNING, "object or string expected"); RETURN_FALSE; } if (Z_TYPE_P(obj) == IS_STRING) { - if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) { + if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) { RETURN_FALSE; } } else { @@ -170,12 +170,12 @@ PHP_FUNCTION(class_uses) } array_init(return_value); - spl_add_traits(return_value, ce, 1, ZEND_ACC_TRAIT TSRMLS_CC); + spl_add_traits(return_value, ce, 1, ZEND_ACC_TRAIT); } /* }}} */ #define SPL_ADD_CLASS(class_name, z_list, sub, allow, ce_flags) \ - spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags TSRMLS_CC) + spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags) #define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags) \ SPL_ADD_CLASS(AppendIterator, z_list, sub, allow, ce_flags); \ @@ -245,7 +245,7 @@ PHP_FUNCTION(spl_classes) } /* }}} */ -static int spl_autoload(zend_string *class_name, zend_string *lc_name, const char *ext, int ext_len TSRMLS_DC) /* {{{ */ +static int spl_autoload(zend_string *class_name, zend_string *lc_name, const char *ext, int ext_len) /* {{{ */ { char *class_file; int class_file_len; @@ -268,7 +268,7 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha } #endif - ret = php_stream_open_for_zend_ex(class_file, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC); + ret = php_stream_open_for_zend_ex(class_file, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); if (ret == SUCCESS) { zend_string *opened_path; @@ -278,18 +278,18 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha opened_path = zend_string_init(file_handle.opened_path, strlen(file_handle.opened_path), 0); ZVAL_NULL(&dummy); if (zend_hash_add(&EG(included_files), opened_path, &dummy)) { - new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); + new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE); + zend_destroy_file_handle(&file_handle); } else { new_op_array = NULL; - zend_file_handle_dtor(&file_handle TSRMLS_CC); + zend_file_handle_dtor(&file_handle); } zend_string_release(opened_path); if (new_op_array) { ZVAL_UNDEF(&result); - zend_execute(new_op_array, &result TSRMLS_CC); + zend_execute(new_op_array, &result); - destroy_op_array(new_op_array TSRMLS_CC); + destroy_op_array(new_op_array); efree(new_op_array); if (!EG(exception)) { zval_ptr_dtor(&result); @@ -311,7 +311,7 @@ PHP_FUNCTION(spl_autoload) char *pos, *pos1; zend_string *class_name, *lc_name, *file_exts = SPL_G(autoload_extensions); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &class_name, &file_exts) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &class_name, &file_exts) == FAILURE) { RETURN_FALSE; } @@ -332,7 +332,7 @@ PHP_FUNCTION(spl_autoload) } else { pos1_len = pos_len; } - if (spl_autoload(class_name, lc_name, pos, pos1_len TSRMLS_CC)) { + if (spl_autoload(class_name, lc_name, pos, pos1_len)) { found = 1; break; /* loaded */ } @@ -354,9 +354,9 @@ PHP_FUNCTION(spl_autoload) if (ex && ex->opline->opcode != ZEND_FETCH_CLASS && ex->opline->opcode != ZEND_NEW) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Class %s could not be loaded", class_name->val); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Class %s could not be loaded", class_name->val); } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be loaded", class_name->val); + php_error_docref(NULL, E_ERROR, "Class %s could not be loaded", class_name->val); } } } /* }}} */ @@ -367,7 +367,7 @@ PHP_FUNCTION(spl_autoload_extensions) { zend_string *file_exts = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &file_exts) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &file_exts) == FAILURE) { return; } if (file_exts) { @@ -412,7 +412,7 @@ PHP_FUNCTION(spl_autoload_call) zend_string *lc_name, *func_name; autoload_func_info *alfi; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE || Z_TYPE_P(class_name) != IS_STRING) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &class_name) == FAILURE || Z_TYPE_P(class_name) != IS_STRING) { return; } @@ -422,8 +422,8 @@ PHP_FUNCTION(spl_autoload_call) lc_name = zend_string_alloc(Z_STRLEN_P(class_name), 0); zend_str_tolower_copy(lc_name->val, Z_STRVAL_P(class_name), Z_STRLEN_P(class_name)); ZEND_HASH_FOREACH_STR_KEY_PTR(SPL_G(autoload_functions), func_name, alfi) { - zend_call_method(Z_ISUNDEF(alfi->obj)? NULL : &alfi->obj, alfi->ce, &alfi->func_ptr, func_name->val, func_name->len, retval, 1, class_name, NULL TSRMLS_CC); - zend_exception_save(TSRMLS_C); + zend_call_method(Z_ISUNDEF(alfi->obj)? NULL : &alfi->obj, alfi->ce, &alfi->func_ptr, func_name->val, func_name->len, retval, 1, class_name, NULL); + zend_exception_save(); if (retval) { zval_ptr_dtor(retval); retval = NULL; @@ -432,7 +432,7 @@ PHP_FUNCTION(spl_autoload_call) break; } } ZEND_HASH_FOREACH_END(); - zend_exception_restore(TSRMLS_C); + zend_exception_restore(); zend_string_free(lc_name); SPL_G(autoload_running) = l_autoload_running; } else { @@ -465,19 +465,19 @@ PHP_FUNCTION(spl_autoload_register) zend_object *obj_ptr; zend_fcall_info_cache fcc; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) { return; } if (ZEND_NUM_ARGS()) { - if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &fcc, &error TSRMLS_CC)) { + if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &fcc, &error)) { alfi.ce = fcc.calling_scope; alfi.func_ptr = fcc.function_handler; obj_ptr = fcc.object; if (Z_TYPE_P(zcallable) == IS_ARRAY) { if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array specifies a non static method but no object (%s)", error); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Passed array specifies a non static method but no object (%s)", error); } if (error) { efree(error); @@ -485,7 +485,7 @@ PHP_FUNCTION(spl_autoload_register) zend_string_release(func_name); RETURN_FALSE; } else if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify %s %smethod (%s)", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "", error); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Passed array does not specify %s %smethod (%s)", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "", error); } if (error) { efree(error); @@ -494,7 +494,7 @@ PHP_FUNCTION(spl_autoload_register) RETURN_FALSE; } else if (Z_TYPE_P(zcallable) == IS_STRING) { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not %s (%s)", func_name->val, alfi.func_ptr ? "callable" : "found", error); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Function '%s' not %s (%s)", func_name->val, alfi.func_ptr ? "callable" : "found", error); } if (error) { efree(error); @@ -503,7 +503,7 @@ PHP_FUNCTION(spl_autoload_register) RETURN_FALSE; } else { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Illegal value passed (%s)", error); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Illegal value passed (%s)", error); } if (error) { efree(error); @@ -514,7 +514,7 @@ PHP_FUNCTION(spl_autoload_register) } else if (fcc.function_handler->type == ZEND_INTERNAL_FUNCTION && fcc.function_handler->internal_function.handler == zif_spl_autoload_call) { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function spl_autoload_call() cannot be registered"); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Function spl_autoload_call() cannot be registered"); } if (error) { efree(error); @@ -621,12 +621,12 @@ PHP_FUNCTION(spl_autoload_unregister) zend_object *obj_ptr; zend_fcall_info_cache fcc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zcallable) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcallable) == FAILURE) { return; } - if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &fcc, &error TSRMLS_CC)) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Unable to unregister invalid function (%s)", error); + if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &fcc, &error)) { + zend_throw_exception_ex(spl_ce_LogicException, 0, "Unable to unregister invalid function (%s)", error); if (error) { efree(error); } @@ -745,25 +745,25 @@ PHP_FUNCTION(spl_object_hash) { zval *obj; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { return; } - RETURN_NEW_STR(php_spl_object_hash(obj TSRMLS_CC)); + RETURN_NEW_STR(php_spl_object_hash(obj)); } /* }}} */ -PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/ +PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/ { intptr_t hash_handle, hash_handlers; if (!SPL_G(hash_mask_init)) { if (!BG(mt_rand_is_seeded)) { - php_mt_srand((uint32_t)GENERATE_SEED() TSRMLS_CC); + php_mt_srand((uint32_t)GENERATE_SEED()); } - SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1); - SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1); + SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand() >> 1); + SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand() >> 1); SPL_G(hash_mask_init) = 1; } @@ -774,7 +774,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/ } /* }}} */ -int spl_build_class_list_string(zval *entry, char **list TSRMLS_DC) /* {{{ */ +int spl_build_class_list_string(zval *entry, char **list) /* {{{ */ { char *res; @@ -797,7 +797,7 @@ PHP_MINFO_FUNCTION(spl) array_init(&list); SPL_LIST_CLASSES(&list, 0, 1, ZEND_ACC_INTERFACE) strg = estrdup(""); - zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC); + zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg); zval_dtor(&list); php_info_print_table_row(2, "Interfaces", strg + 2); efree(strg); @@ -805,7 +805,7 @@ PHP_MINFO_FUNCTION(spl) array_init(&list); SPL_LIST_CLASSES(&list, 0, -1, ZEND_ACC_INTERFACE) strg = estrdup(""); - zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC); + zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg); zval_dtor(&list); php_info_print_table_row(2, "Classes", strg + 2); efree(strg); diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index 8db6f09e6d..6d075e6c3f 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -79,7 +79,7 @@ PHP_FUNCTION(class_parents); PHP_FUNCTION(class_implements); PHP_FUNCTION(class_uses); -PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC); +PHPAPI zend_string *php_spl_object_hash(zval *obj); #endif /* PHP_SPL_H */ diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 8aab4c49bf..4f6efcac7d 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -87,7 +87,7 @@ static inline spl_array_object *spl_array_from_obj(zend_object *obj) /* {{{ */ { #define Z_SPLARRAY_P(zv) spl_array_from_obj(Z_OBJ_P((zv))) -static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props TSRMLS_DC) { /* {{{ */ +static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props) { /* {{{ */ if ((intern->ar_flags & SPL_ARRAY_IS_SELF) != 0) { if (!intern->std.properties) { rebuild_object_properties(&intern->std); @@ -95,7 +95,7 @@ static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int return intern->std.properties; } else if ((intern->ar_flags & SPL_ARRAY_USE_OTHER) && (check_std_props == 0 || (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) == 0) && Z_TYPE(intern->array) == IS_OBJECT) { spl_array_object *other = Z_SPLARRAY_P(&intern->array); - return spl_array_get_hash_table(other, check_std_props TSRMLS_CC); + return spl_array_get_hash_table(other, check_std_props); } else if ((intern->ar_flags & ((check_std_props ? SPL_ARRAY_STD_PROP_LIST : 0) | SPL_ARRAY_IS_SELF)) != 0) { if (!intern->std.properties) { rebuild_object_properties(&intern->std); @@ -106,7 +106,7 @@ static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int } } /* }}} */ -static void spl_array_rewind(spl_array_object *intern TSRMLS_DC); +static void spl_array_rewind(spl_array_object *intern); static void spl_array_update_pos(HashTable *ht, spl_array_object* intern) /* {{{ */ { @@ -122,7 +122,7 @@ static void spl_array_set_pos(spl_array_object* intern, HashTable *ht, HashPosit spl_array_update_pos(ht, intern); } /* }}} */ -SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht TSRMLS_DC) /* {{{ */ +SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht) /* {{{ */ { uint idx; @@ -143,24 +143,24 @@ SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht TSR } } /* HASH_UNPROTECT_RECURSION(ht); */ - spl_array_rewind(intern TSRMLS_CC); + spl_array_rewind(intern); return FAILURE; } /* }}} */ -SPL_API int spl_hash_verify_pos(spl_array_object * intern TSRMLS_DC) /* {{{ */ +SPL_API int spl_hash_verify_pos(spl_array_object * intern) /* {{{ */ { - HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - return spl_hash_verify_pos_ex(intern, ht TSRMLS_CC); + HashTable *ht = spl_array_get_hash_table(intern, 0); + return spl_hash_verify_pos_ex(intern, ht); } /* }}} */ /* {{{ spl_array_object_free_storage */ -static void spl_array_object_free_storage(zend_object *object TSRMLS_DC) +static void spl_array_object_free_storage(zend_object *object) { spl_array_object *intern = spl_array_from_obj(object); - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); zval_ptr_dtor(&intern->array); zval_ptr_dtor(&intern->retval); @@ -172,10 +172,10 @@ static void spl_array_object_free_storage(zend_object *object TSRMLS_DC) } /* }}} */ -zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); +zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref); /* {{{ spl_array_object_new_ex */ -static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) +static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) { spl_array_object *intern; zend_class_entry *parent = class_type; @@ -183,7 +183,7 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval * intern = ecalloc(1, sizeof(spl_array_object) + sizeof(zval) * (parent->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); intern->ar_flags = 0; @@ -227,7 +227,7 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval * inherited = 1; } if (!parent) { /* this must never happen */ - php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of ArrayObject or ArrayIterator"); + php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of ArrayObject or ArrayIterator"); } if (inherited) { intern->fptr_offset_get = zend_hash_str_find_ptr(&class_type->function_table, "offsetget", sizeof("offsetget") - 1); @@ -270,40 +270,40 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval * } } - spl_array_rewind(intern TSRMLS_CC); + spl_array_rewind(intern); return &intern->std; } /* }}} */ /* {{{ spl_array_object_new */ -static zend_object *spl_array_object_new(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_array_object_new(zend_class_entry *class_type) { - return spl_array_object_new_ex(class_type, NULL, 0 TSRMLS_CC); + return spl_array_object_new_ex(class_type, NULL, 0); } /* }}} */ /* {{{ spl_array_object_clone */ -static zend_object *spl_array_object_clone(zval *zobject TSRMLS_DC) +static zend_object *spl_array_object_clone(zval *zobject) { zend_object *old_object; zend_object *new_object; old_object = Z_OBJ_P(zobject); - new_object = spl_array_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC); + new_object = spl_array_object_new_ex(old_object->ce, zobject, 1); - zend_objects_clone_members(new_object, old_object TSRMLS_CC); + zend_objects_clone_members(new_object, old_object); return new_object; } /* }}} */ -static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */ +static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval *offset, int type) /* {{{ */ { zval *retval; zend_long index; zend_string *offset_key; spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *ht = spl_array_get_hash_table(intern, 0); if (!offset || Z_ISUNDEF_P(offset)) { return &EG(uninitialized_zval); @@ -400,7 +400,7 @@ num_index: } } /* }}} */ -static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type, zval *zv TSRMLS_DC) /* {{{ */ +static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type, zval *zv) /* {{{ */ { zval *ret; @@ -424,7 +424,7 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval return &EG(uninitialized_zval); } } - ret = spl_array_get_dimension_ptr(check_inherited, object, offset, type TSRMLS_CC); + ret = spl_array_get_dimension_ptr(check_inherited, object, offset, type); //!!! FIXME? // ZVAL_COPY(result, ret); @@ -442,12 +442,12 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval return ret; } /* }}} */ -static zval *spl_array_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */ +static zval *spl_array_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */ { - return spl_array_read_dimension_ex(1, object, offset, type, rv TSRMLS_CC); + return spl_array_read_dimension_ex(1, object, offset, type, rv); } /* }}} */ -static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */ +static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); zend_long index; @@ -468,7 +468,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval } if (!offset) { - ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + ht = spl_array_get_hash_table(intern, 0); if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; @@ -485,7 +485,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval } switch (Z_TYPE_P(offset)) { case IS_STRING: - ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + ht = spl_array_get_hash_table(intern, 0); if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; @@ -507,7 +507,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval case IS_LONG: index = Z_LVAL_P(offset); num_index: - ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + ht = spl_array_get_hash_table(intern, 0); if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; @@ -515,7 +515,7 @@ num_index: zend_hash_index_update(ht, index, value); return; case IS_NULL: - ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + ht = spl_array_get_hash_table(intern, 0); if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; @@ -528,12 +528,12 @@ num_index: } } /* }}} */ -static void spl_array_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */ +static void spl_array_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */ { - spl_array_write_dimension_ex(1, object, offset, value TSRMLS_CC); + spl_array_write_dimension_ex(1, object, offset, value); } /* }}} */ -static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset TSRMLS_DC) /* {{{ */ +static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset) /* {{{ */ { zend_long index; HashTable *ht; @@ -548,13 +548,13 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval switch(Z_TYPE_P(offset)) { case IS_STRING: - ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + ht = spl_array_get_hash_table(intern, 0); if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; } if (ht == &EG(symbol_table).ht) { - if (zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC)) { + if (zend_delete_global_variable(Z_STR_P(offset))) { zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); } } else { @@ -574,7 +574,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval ZVAL_UNDEF(data); } //??? fix for ext/spl/tests/bug45614.phpt (may be fix is wrong) - spl_array_rewind(intern TSRMLS_CC); + spl_array_rewind(intern); } else if (zend_symtable_del(ht, Z_STR_P(offset)) == FAILURE) { zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); } @@ -599,7 +599,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval case IS_LONG: index = Z_LVAL_P(offset); num_index: - ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + ht = spl_array_get_hash_table(intern, 0); if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; @@ -612,15 +612,15 @@ num_index: zend_error(E_WARNING, "Illegal offset type"); return; } - spl_hash_verify_pos(intern TSRMLS_CC); /* call rewind on FAILURE */ + spl_hash_verify_pos(intern); /* call rewind on FAILURE */ } /* }}} */ -static void spl_array_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */ +static void spl_array_unset_dimension(zval *object, zval *offset) /* {{{ */ { - spl_array_unset_dimension_ex(1, object, offset TSRMLS_CC); + spl_array_unset_dimension_ex(1, object, offset); } /* }}} */ -static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ +static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); zend_long index; @@ -636,12 +636,12 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o zend_call_method_with_1_params(object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset); zval_ptr_dtor(offset); - if (!Z_ISUNDEF(rv) && zend_is_true(&rv TSRMLS_CC)) { + if (!Z_ISUNDEF(rv) && zend_is_true(&rv)) { zval_ptr_dtor(&rv); if (check_empty != 1) { return 1; } else if (intern->fptr_offset_get) { - value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv TSRMLS_CC); + value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv); } } else { zval_ptr_dtor(&rv); @@ -650,7 +650,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o } if (!value) { - HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *ht = spl_array_get_hash_table(intern, 0); switch(Z_TYPE_P(offset)) { case IS_STRING: @@ -693,30 +693,30 @@ num_index: } if (check_empty && check_inherited && intern->fptr_offset_get) { - value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv TSRMLS_CC); + value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv); } else { value = tmp; } } - return check_empty ? zend_is_true(value TSRMLS_CC) : Z_TYPE_P(value) != IS_NULL; + return check_empty ? zend_is_true(value) : Z_TYPE_P(value) != IS_NULL; } /* }}} */ -static int spl_array_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ +static int spl_array_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */ { - return spl_array_has_dimension_ex(1, object, offset, check_empty TSRMLS_CC); + return spl_array_has_dimension_ex(1, object, offset, check_empty); } /* }}} */ /* {{{ spl_array_object_verify_pos_ex */ -static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix TSRMLS_DC) +static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix) { if (!ht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix); + php_error_docref(NULL, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix); return FAILURE; } - if (object->pos != INVALID_IDX && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix); + if (object->pos != INVALID_IDX && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht) == FAILURE) { + php_error_docref(NULL, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix); return FAILURE; } @@ -724,9 +724,9 @@ static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashT } /* }}} */ /* {{{ spl_array_object_verify_pos */ -static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht TSRMLS_DC) +static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht) { - return spl_array_object_verify_pos_ex(object, ht, "" TSRMLS_CC); + return spl_array_object_verify_pos_ex(object, ht, ""); } /* }}} */ /* {{{ proto bool ArrayObject::offsetExists(mixed $index) @@ -735,10 +735,10 @@ static inline int spl_array_object_verify_pos(spl_array_object *object, HashTabl SPL_METHOD(Array, offsetExists) { zval *index; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) { return; } - RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 2 TSRMLS_CC)); + RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 2)); } /* }}} */ /* {{{ proto mixed ArrayObject::offsetGet(mixed $index) @@ -747,10 +747,10 @@ SPL_METHOD(Array, offsetExists) SPL_METHOD(Array, offsetGet) { zval *value, *index; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) { return; } - value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R, return_value TSRMLS_CC); + value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R, return_value); if (value != return_value) { RETURN_ZVAL(value, 1, 0); } @@ -762,28 +762,28 @@ SPL_METHOD(Array, offsetGet) SPL_METHOD(Array, offsetSet) { zval *index, *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &index, &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &index, &value) == FAILURE) { return; } - spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC); + spl_array_write_dimension_ex(0, getThis(), index, value); } /* }}} */ -void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */ +void spl_array_iterator_append(zval *object, zval *append_value) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); + php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array"); return; } if (Z_TYPE(intern->array) == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name->val); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name->val); return; } - spl_array_write_dimension(object, NULL, append_value TSRMLS_CC); + spl_array_write_dimension(object, NULL, append_value); if (intern->pos == INVALID_IDX) { if (aht->nNumUsed && !Z_ISUNDEF(aht->arData[aht->nNumUsed-1].val)) { spl_array_set_pos(intern, aht, aht->nNumUsed - 1); @@ -798,10 +798,10 @@ SPL_METHOD(Array, append) { zval *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } - spl_array_iterator_append(getThis(), value TSRMLS_CC); + spl_array_iterator_append(getThis(), value); } /* }}} */ /* {{{ proto void ArrayObject::offsetUnset(mixed $index) @@ -810,10 +810,10 @@ SPL_METHOD(Array, append) SPL_METHOD(Array, offsetUnset) { zval *index; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) { return; } - spl_array_unset_dimension_ex(0, getThis(), index TSRMLS_CC); + spl_array_unset_dimension_ex(0, getThis(), index); } /* }}} */ /* {{{ proto array ArrayObject::getArrayCopy() @@ -825,25 +825,25 @@ SPL_METHOD(Array, getArrayCopy) spl_array_object *intern = Z_SPLARRAY_P(object); ZVAL_NEW_ARR(return_value); - zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC)); + zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0)); } /* }}} */ -static HashTable *spl_array_get_properties(zval *object TSRMLS_DC) /* {{{ */ +static HashTable *spl_array_get_properties(zval *object) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); HashTable *result; if (intern->nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Nesting level too deep - recursive dependency?"); + php_error_docref(NULL, E_ERROR, "Nesting level too deep - recursive dependency?"); } intern->nApplyCount++; - result = spl_array_get_hash_table(intern, 1 TSRMLS_CC); + result = spl_array_get_hash_table(intern, 1); intern->nApplyCount--; return result; } /* }}} */ -static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ +static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp) /* {{{ */ { zval *storage; zend_string *zname; @@ -872,7 +872,7 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* zval_add_ref(storage); base = (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) ? spl_ce_ArrayIterator : spl_ce_ArrayObject; - zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1 TSRMLS_CC); + zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1); zend_symtable_update(intern->debug_info, zname, storage); zend_string_release(zname); } @@ -882,67 +882,67 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* } /* }}} */ -static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */ +static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) { - return spl_array_read_dimension(object, member, type, rv TSRMLS_CC); + && !std_object_handlers.has_property(object, member, 2, cache_slot)) { + return spl_array_read_dimension(object, member, type, rv); } - return std_object_handlers.read_property(object, member, type, cache_slot, rv TSRMLS_CC); + return std_object_handlers.read_property(object, member, type, cache_slot, rv); } /* }}} */ -static void spl_array_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */ +static void spl_array_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) { - spl_array_write_dimension(object, member, value TSRMLS_CC); + && !std_object_handlers.has_property(object, member, 2, cache_slot)) { + spl_array_write_dimension(object, member, value); return; } - std_object_handlers.write_property(object, member, value, cache_slot TSRMLS_CC); + std_object_handlers.write_property(object, member, value, cache_slot); } /* }}} */ -static zval *spl_array_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */ +static zval *spl_array_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) { - return spl_array_get_dimension_ptr(1, object, member, type TSRMLS_CC); + && !std_object_handlers.has_property(object, member, 2, cache_slot)) { + return spl_array_get_dimension_ptr(1, object, member, type); } //!!! FIXME - //return std_object_handlers.get_property_ptr_ptr(object, member, type, key TSRMLS_CC); + //return std_object_handlers.get_property_ptr_ptr(object, member, type, key); return NULL; } /* }}} */ -static int spl_array_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */ +static int spl_array_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) { - return spl_array_has_dimension(object, member, has_set_exists TSRMLS_CC); + && !std_object_handlers.has_property(object, member, 2, cache_slot)) { + return spl_array_has_dimension(object, member, has_set_exists); } - return std_object_handlers.has_property(object, member, has_set_exists, cache_slot TSRMLS_CC); + return std_object_handlers.has_property(object, member, has_set_exists, cache_slot); } /* }}} */ -static void spl_array_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */ +static void spl_array_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) { - spl_array_unset_dimension(object, member TSRMLS_CC); - spl_array_rewind(intern TSRMLS_CC); /* because deletion might invalidate position */ + && !std_object_handlers.has_property(object, member, 2, cache_slot)) { + spl_array_unset_dimension(object, member); + spl_array_rewind(intern); /* because deletion might invalidate position */ return; } - std_object_handlers.unset_property(object, member, cache_slot TSRMLS_CC); + std_object_handlers.unset_property(object, member, cache_slot); } /* }}} */ -static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */ +static int spl_array_compare_objects(zval *o1, zval *o2) /* {{{ */ { HashTable *ht1, *ht2; @@ -953,20 +953,20 @@ static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */ intern1 = Z_SPLARRAY_P(o1); intern2 = Z_SPLARRAY_P(o2); - ht1 = spl_array_get_hash_table(intern1, 0 TSRMLS_CC); - ht2 = spl_array_get_hash_table(intern2, 0 TSRMLS_CC); + ht1 = spl_array_get_hash_table(intern1, 0); + ht2 = spl_array_get_hash_table(intern2, 0); - zend_compare_symbol_tables(&temp_zv, ht1, ht2 TSRMLS_CC); + zend_compare_symbol_tables(&temp_zv, ht1, ht2); result = (int)Z_LVAL(temp_zv); /* if we just compared std.properties, don't do it again */ if (result == 0 && !(ht1 == intern1->std.properties && ht2 == intern2->std.properties)) { - result = std_object_handlers.compare_objects(o1, o2 TSRMLS_CC); + result = std_object_handlers.compare_objects(o1, o2); } return result; } /* }}} */ -static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */ +static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht) /* {{{ */ { zend_string *string_key; zend_ulong num_key; @@ -995,51 +995,51 @@ static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSR return FAILURE; } /* }}} */ -static int spl_array_next_no_verify(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */ +static int spl_array_next_no_verify(spl_array_object *intern, HashTable *aht) /* {{{ */ { zend_hash_move_forward_ex(aht, &intern->pos); spl_array_update_pos(aht, intern); if (Z_TYPE(intern->array) == IS_OBJECT) { - return spl_array_skip_protected(intern, aht TSRMLS_CC); + return spl_array_skip_protected(intern, aht); } else { return zend_hash_has_more_elements_ex(aht, &intern->pos); } } /* }}} */ -static int spl_array_next_ex(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */ +static int spl_array_next_ex(spl_array_object *intern, HashTable *aht) /* {{{ */ { - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht) == FAILURE) { + php_error_docref(NULL, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); return FAILURE; } - return spl_array_next_no_verify(intern, aht TSRMLS_CC); + return spl_array_next_no_verify(intern, aht); } /* }}} */ -static int spl_array_next(spl_array_object *intern TSRMLS_DC) /* {{{ */ +static int spl_array_next(spl_array_object *intern) /* {{{ */ { - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); - return spl_array_next_ex(intern, aht TSRMLS_CC); + return spl_array_next_ex(intern, aht); } /* }}} */ -static void spl_array_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_array_it_dtor(zend_object_iterator *iter) /* {{{ */ { - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); zval_ptr_dtor(&iter->data); } /* }}} */ -static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static int spl_array_it_valid(zend_object_iterator *iter) /* {{{ */ { spl_array_object *object = Z_SPLARRAY_P(&iter->data); - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(object, 0); if (object->ar_flags & SPL_ARRAY_OVERLOADED_VALID) { - return zend_user_it_valid(iter TSRMLS_CC); + return zend_user_it_valid(iter); } else { - if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): " TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): ") == FAILURE) { return FAILURE; } @@ -1048,13 +1048,13 @@ static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ } /* }}} */ -static zval *spl_array_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static zval *spl_array_it_get_current_data(zend_object_iterator *iter) /* {{{ */ { spl_array_object *object = Z_SPLARRAY_P(&iter->data); - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(object, 0); if (object->ar_flags & SPL_ARRAY_OVERLOADED_CURRENT) { - return zend_user_it_get_current_data(iter TSRMLS_CC); + return zend_user_it_get_current_data(iter); } else { zval *data = zend_hash_get_current_data_ex(aht, &object->pos); if (Z_TYPE_P(data) == IS_INDIRECT) { @@ -1065,15 +1065,15 @@ static zval *spl_array_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) } /* }}} */ -static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */ +static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */ { spl_array_object *object = Z_SPLARRAY_P(&iter->data); - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(object, 0); if (object->ar_flags & SPL_ARRAY_OVERLOADED_KEY) { - zend_user_it_get_current_key(iter, key TSRMLS_CC); + zend_user_it_get_current_key(iter, key); } else { - if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): " TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): ") == FAILURE) { ZVAL_NULL(key); } else { zend_hash_get_current_key_zval_ex(aht, key, &object->pos); @@ -1082,66 +1082,66 @@ static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key T } /* }}} */ -static void spl_array_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_array_it_move_forward(zend_object_iterator *iter) /* {{{ */ { spl_array_object *object = Z_SPLARRAY_P(&iter->data); - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(object, 0); if (object->ar_flags & SPL_ARRAY_OVERLOADED_NEXT) { - zend_user_it_move_forward(iter TSRMLS_CC); + zend_user_it_move_forward(iter); } else { - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array"); + php_error_docref(NULL, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array"); return; } - if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::next(): Array was modified outside object and internal position is no longer valid"); + if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht) == FAILURE) { + php_error_docref(NULL, E_NOTICE, "ArrayIterator::next(): Array was modified outside object and internal position is no longer valid"); } else { - spl_array_next_no_verify(object, aht TSRMLS_CC); + spl_array_next_no_verify(object, aht); } } } /* }}} */ -static void spl_array_rewind_ex(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */ +static void spl_array_rewind_ex(spl_array_object *intern, HashTable *aht) /* {{{ */ { zend_hash_internal_pointer_reset_ex(aht, &intern->pos); spl_array_update_pos(aht, intern); - spl_array_skip_protected(intern, aht TSRMLS_CC); + spl_array_skip_protected(intern, aht); } /* }}} */ -static void spl_array_rewind(spl_array_object *intern TSRMLS_DC) /* {{{ */ +static void spl_array_rewind(spl_array_object *intern) /* {{{ */ { - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array"); + php_error_docref(NULL, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array"); return; } - spl_array_rewind_ex(intern, aht TSRMLS_CC); + spl_array_rewind_ex(intern, aht); } /* }}} */ -static void spl_array_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_array_it_rewind(zend_object_iterator *iter) /* {{{ */ { spl_array_object *object = Z_SPLARRAY_P(&iter->data); if (object->ar_flags & SPL_ARRAY_OVERLOADED_REWIND) { - zend_user_it_rewind(iter TSRMLS_CC); + zend_user_it_rewind(iter); } else { - zend_user_it_invalidate_current(iter TSRMLS_CC); - spl_array_rewind(object TSRMLS_CC); + zend_user_it_invalidate_current(iter); + spl_array_rewind(object); } } /* }}} */ /* {{{ spl_array_set_array */ -static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array TSRMLS_DC) { +static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array) { if (Z_TYPE_P(array) == IS_ARRAY) { SEPARATE_ARRAY(array); @@ -1157,7 +1157,7 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar ZVAL_COPY_VALUE(&intern->array, array); } else { if (Z_TYPE_P(array) != IS_OBJECT && Z_TYPE_P(array) != IS_ARRAY) { - zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0); return; } zval_ptr_dtor(&intern->array); @@ -1174,12 +1174,12 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar if (Z_TYPE_P(array) == IS_OBJECT) { zend_object_get_properties_t handler = Z_OBJ_HANDLER_P(array, get_properties); if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties) - || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name); + || !spl_array_get_hash_table(intern, 0)) { + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name); } } - spl_array_rewind(intern TSRMLS_CC); + spl_array_rewind(intern); } /* }}} */ @@ -1193,7 +1193,7 @@ zend_object_iterator_funcs spl_array_it_funcs = { spl_array_it_rewind }; -zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ +zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ { zend_user_iterator *iterator; spl_array_object *array_object = Z_SPLARRAY_P(object); @@ -1204,7 +1204,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, iterator = emalloc(sizeof(zend_user_iterator)); - zend_iterator_init(&iterator->it TSRMLS_CC); + zend_iterator_init(&iterator->it); ZVAL_COPY(&iterator->it.data, object); iterator->it.funcs = &spl_array_it_funcs; @@ -1231,12 +1231,12 @@ SPL_METHOD(Array, __construct) return; /* nothing to do */ } - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling); intern = Z_SPLARRAY_P(object); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) { + zend_restore_error_handling(&error_handling); return; } @@ -1246,9 +1246,9 @@ SPL_METHOD(Array, __construct) ar_flags &= ~SPL_ARRAY_INT_MASK; - spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1 TSRMLS_CC); + spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -1262,7 +1262,7 @@ SPL_METHOD(Array, setIteratorClass) zend_class_entry * ce_get_iterator = spl_ce_Iterator; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "C", &ce_get_iterator) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &ce_get_iterator) == FAILURE) { return; } #else @@ -1314,7 +1314,7 @@ SPL_METHOD(Array, setFlags) spl_array_object *intern = Z_SPLARRAY_P(object); zend_long ar_flags = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ar_flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ar_flags) == FAILURE) { return; } @@ -1330,12 +1330,12 @@ SPL_METHOD(Array, exchangeArray) spl_array_object *intern = Z_SPLARRAY_P(object); ZVAL_NEW_ARR(return_value); - zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC)); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &array) == FAILURE) { + zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0)); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &array) == FAILURE) { return; } - spl_array_set_array(object, intern, array, 0L, 1 TSRMLS_CC); + spl_array_set_array(object, intern, array, 0L, 1); } /* }}} */ @@ -1345,18 +1345,18 @@ SPL_METHOD(Array, getIterator) { zval *object = getThis(); spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (zend_parse_parameters_none() == FAILURE) { return; } if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); + php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array"); return; } - ZVAL_OBJ(return_value, spl_array_object_new_ex(intern->ce_get_iterator, object, 0 TSRMLS_CC)); + ZVAL_OBJ(return_value, spl_array_object_new_ex(intern->ce_get_iterator, object, 0)); Z_SET_REFCOUNT_P(return_value, 1); //!!!PZ_SET_ISREF_P(return_value); } @@ -1373,7 +1373,7 @@ SPL_METHOD(Array, rewind) return; } - spl_array_rewind(intern TSRMLS_CC); + spl_array_rewind(intern); } /* }}} */ @@ -1384,40 +1384,40 @@ SPL_METHOD(Array, seek) zend_long opos, position; zval *object = getThis(); spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); int result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &position) == FAILURE) { return; } if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); + php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array"); return; } opos = position; if (position >= 0) { /* negative values are not supported */ - spl_array_rewind(intern TSRMLS_CC); + spl_array_rewind(intern); result = SUCCESS; - while (position-- > 0 && (result = spl_array_next(intern TSRMLS_CC)) == SUCCESS); + while (position-- > 0 && (result = spl_array_next(intern)) == SUCCESS); if (result == SUCCESS && zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS) { return; /* ok */ } } - zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %pd is out of range", opos); + zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position %pd is out of range", opos); } /* }}} */ -int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count TSRMLS_DC) /* {{{ */ +int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count) /* {{{ */ { - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); HashPosition pos; if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); + php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array"); *count = 0; return FAILURE; } @@ -1427,8 +1427,8 @@ int static spl_array_object_count_elements_helper(spl_array_object *intern, zend * we're going to call and which do not support 'pos' as parameter. */ pos = intern->pos; *count = 0; - spl_array_rewind(intern TSRMLS_CC); - while(intern->pos != INVALID_IDX && spl_array_next(intern TSRMLS_CC) == SUCCESS) { + spl_array_rewind(intern); + while(intern->pos != INVALID_IDX && spl_array_next(intern) == SUCCESS) { (*count)++; } spl_array_set_pos(intern, aht, pos); @@ -1439,7 +1439,7 @@ int static spl_array_object_count_elements_helper(spl_array_object *intern, zend } } /* }}} */ -int spl_array_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */ +int spl_array_object_count_elements(zval *object, zend_long *count) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); @@ -1456,7 +1456,7 @@ int spl_array_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* *count = 0; return FAILURE; } - return spl_array_object_count_elements_helper(intern, count TSRMLS_CC); + return spl_array_object_count_elements_helper(intern, count); } /* }}} */ /* {{{ proto int ArrayObject::count() @@ -1471,7 +1471,7 @@ SPL_METHOD(Array, count) return; } - spl_array_object_count_elements_helper(intern, &count TSRMLS_CC); + spl_array_object_count_elements_helper(intern, &count); RETURN_LONG(count); } /* }}} */ @@ -1479,7 +1479,7 @@ SPL_METHOD(Array, count) static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fname_len, int use_arg) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(getThis()); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); zval tmp, *arg = NULL; zval retval; @@ -1490,25 +1490,25 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam if (!use_arg) { aht->u.v.nApplyCount++; - zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 1, &tmp, NULL TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 1, &tmp, NULL); aht->u.v.nApplyCount--; } else if (use_arg == SPL_ARRAY_METHOD_MAY_USER_ARG) { - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) { zval_ptr_dtor(&tmp); - zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0); return; } aht->u.v.nApplyCount++; - zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, arg? 2 : 1, &tmp, arg TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, arg? 2 : 1, &tmp, arg); aht->u.v.nApplyCount--; } else { - if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { zval_ptr_dtor(&tmp); - zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0); return; } aht->u.v.nApplyCount++; - zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 2, &tmp, arg TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 2, &tmp, arg); aht->u.v.nApplyCount--; } /* A tricky way to pass "aht" by reference, copy back and cleanup */ @@ -1566,13 +1566,13 @@ SPL_METHOD(Array, current) zval *object = getThis(); spl_array_object *intern = Z_SPLARRAY_P(object); zval *entry; - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (zend_parse_parameters_none() == FAILURE) { return; } - if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos(intern, aht) == FAILURE) { return; } @@ -1597,15 +1597,15 @@ SPL_METHOD(Array, key) return; } - spl_array_iterator_key(getThis(), return_value TSRMLS_CC); + spl_array_iterator_key(getThis(), return_value); } /* }}} */ -void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC) /* {{{ */ +void spl_array_iterator_key(zval *object, zval *return_value) /* {{{ */ { spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); - if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos(intern, aht) == FAILURE) { return; } @@ -1619,17 +1619,17 @@ SPL_METHOD(Array, next) { zval *object = getThis(); spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (zend_parse_parameters_none() == FAILURE) { return; } - if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos(intern, aht) == FAILURE) { return; } - spl_array_next_no_verify(intern, aht TSRMLS_CC); + spl_array_next_no_verify(intern, aht); } /* }}} */ @@ -1639,13 +1639,13 @@ SPL_METHOD(Array, valid) { zval *object = getThis(); spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (zend_parse_parameters_none() == FAILURE) { return; } - if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos(intern, aht) == FAILURE) { RETURN_FALSE; } else { RETURN_BOOL(zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS); @@ -1659,13 +1659,13 @@ SPL_METHOD(Array, hasChildren) { zval *object = getThis(), *entry; spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (zend_parse_parameters_none() == FAILURE) { return; } - if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos(intern, aht) == FAILURE) { RETURN_FALSE; } @@ -1683,13 +1683,13 @@ SPL_METHOD(Array, getChildren) { zval *object = getThis(), *entry, flags; spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); if (zend_parse_parameters_none() == FAILURE) { return; } - if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { + if (spl_array_object_verify_pos(intern, aht) == FAILURE) { return; } @@ -1701,13 +1701,13 @@ SPL_METHOD(Array, getChildren) if ((intern->ar_flags & SPL_ARRAY_CHILD_ARRAYS_ONLY) != 0) { return; } - if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) { + if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE_P(getThis()))) { RETURN_ZVAL(entry, 1, 0); } } ZVAL_LONG(&flags, SPL_ARRAY_USE_OTHER | intern->ar_flags); - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, entry, &flags TSRMLS_CC); + spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, entry, &flags); } /* }}} */ @@ -1717,7 +1717,7 @@ SPL_METHOD(Array, serialize) { zval *object = getThis(); spl_array_object *intern = Z_SPLARRAY_P(object); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + HashTable *aht = spl_array_get_hash_table(intern, 0); zval members, flags; php_serialize_data_t var_hash; smart_str buf = {0}; @@ -1727,7 +1727,7 @@ SPL_METHOD(Array, serialize) } if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); + php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array"); return; } @@ -1738,10 +1738,10 @@ SPL_METHOD(Array, serialize) /* storage */ smart_str_appendl(&buf, "x:", 2); //!!! php_var_serialize need to be modified - php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &flags, &var_hash); if (!(intern->ar_flags & SPL_ARRAY_IS_SELF)) { - php_var_serialize(&buf, &intern->array, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &intern->array, &var_hash); smart_str_appendc(&buf, ';'); } @@ -1754,7 +1754,7 @@ SPL_METHOD(Array, serialize) ZVAL_NEW_ARR(&members); zend_array_dup(Z_ARRVAL(members), intern->std.properties); - php_var_serialize(&buf, &members, &var_hash TSRMLS_CC); /* finishes the string */ + php_var_serialize(&buf, &members, &var_hash); /* finishes the string */ zval_ptr_dtor(&members); @@ -1783,7 +1783,7 @@ SPL_METHOD(Array, unserialize) HashTable *aht; zend_long flags; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) { return; } @@ -1791,7 +1791,7 @@ SPL_METHOD(Array, unserialize) return; } - aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); + aht = spl_array_get_hash_table(intern, 0); if (aht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; @@ -1806,7 +1806,7 @@ SPL_METHOD(Array, unserialize) } ++p; - if (!php_var_unserialize(&zflags, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(zflags) != IS_LONG) { + if (!php_var_unserialize(&zflags, &p, s + buf_len, &var_hash) || Z_TYPE(zflags) != IS_LONG) { goto outexcept; } @@ -1829,7 +1829,7 @@ SPL_METHOD(Array, unserialize) intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK; intern->ar_flags |= flags & SPL_ARRAY_CLONE_MASK; zval_ptr_dtor(&intern->array); - if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash)) { goto outexcept; } } @@ -1845,13 +1845,13 @@ SPL_METHOD(Array, unserialize) ++p; ZVAL_UNDEF(&members); - if (!php_var_unserialize(&members, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(members) != IS_ARRAY) { + if (!php_var_unserialize(&members, &p, s + buf_len, &var_hash) || Z_TYPE(members) != IS_ARRAY) { zval_ptr_dtor(&members); goto outexcept; } /* copy members */ - object_properties_load(&intern->std, Z_ARRVAL(members) TSRMLS_CC); + object_properties_load(&intern->std, Z_ARRVAL(members)); zval_ptr_dtor(&members); /* done reading $serialized */ @@ -1861,7 +1861,7 @@ SPL_METHOD(Array, unserialize) outexcept: PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len); return; } /* }}} */ diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h index c27e55bbec..189038032e 100644 --- a/ext/spl/spl_array.h +++ b/ext/spl/spl_array.h @@ -31,8 +31,8 @@ extern PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator; PHP_MINIT_FUNCTION(spl_array); -extern void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC); -extern void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC); +extern void spl_array_iterator_append(zval *object, zval *append_value); +extern void spl_array_iterator_key(zval *object, zval *return_value); #endif /* SPL_ARRAY_H */ diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 8da1d1165f..8e67e8af90 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -60,7 +60,7 @@ PHPAPI zend_class_entry *spl_ce_GlobIterator; PHPAPI zend_class_entry *spl_ce_SplFileObject; PHPAPI zend_class_entry *spl_ce_SplTempFileObject; -static void spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ +static void spl_filesystem_file_free_line(spl_filesystem_object *intern) /* {{{ */ { if (intern->u.file.current_line) { efree(intern->u.file.current_line); @@ -72,15 +72,15 @@ static void spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_D } } /* }}} */ -static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ +static void spl_filesystem_object_free_storage(zend_object *object) /* {{{ */ { spl_filesystem_object *intern = spl_filesystem_from_obj(object); if (intern->oth_handler && intern->oth_handler->dtor) { - intern->oth_handler->dtor(intern TSRMLS_CC); + intern->oth_handler->dtor(intern); } - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); if (intern->_path) { efree(intern->_path); @@ -119,7 +119,7 @@ static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /* efree(intern->orig_path); } } - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); break; } @@ -139,7 +139,7 @@ static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /* - clone - new */ -static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type) { spl_filesystem_object *intern; @@ -148,7 +148,7 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TS intern->file_class = spl_ce_SplFileObject; intern->info_class = spl_ce_SplFileInfo; - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); intern->std.handlers = &spl_filesystem_object_handlers; @@ -158,22 +158,22 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TS /* {{{ spl_filesystem_object_new */ /* See spl_filesystem_object_new_ex */ -static zend_object *spl_filesystem_object_new(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_filesystem_object_new(zend_class_entry *class_type) { - return spl_filesystem_object_new_ex(class_type TSRMLS_CC); + return spl_filesystem_object_new_ex(class_type); } /* }}} */ /* {{{ spl_filesystem_object_new_check */ -static zend_object *spl_filesystem_object_new_check(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_filesystem_object_new_check(zend_class_entry *class_type) { - spl_filesystem_object *ret = spl_filesystem_from_obj(spl_filesystem_object_new_ex(class_type TSRMLS_CC)); + spl_filesystem_object *ret = spl_filesystem_from_obj(spl_filesystem_object_new_ex(class_type)); ret->std.handlers = &spl_filesystem_object_check_handlers; return &ret->std; } /* }}} */ -PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC) /* {{{ */ +PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len) /* {{{ */ { #ifdef HAVE_GLOB if (intern->type == SPL_FS_DIR) { @@ -188,7 +188,7 @@ PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_ return intern->_path; } /* }}} */ -static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ +static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern) /* {{{ */ { char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH; @@ -196,18 +196,18 @@ static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *in switch (intern->type) { case SPL_FS_INFO: case SPL_FS_FILE: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Object not initialized"); + php_error_docref(NULL, E_ERROR, "Object not initialized"); break; case SPL_FS_DIR: intern->file_name_len = (int)spprintf(&intern->file_name, 0, "%s%c%s", - spl_filesystem_object_get_path(intern, NULL TSRMLS_CC), + spl_filesystem_object_get_path(intern, NULL), slash, intern->u.dir.entry.d_name); break; } } } /* }}} */ -static int spl_filesystem_dir_read(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ +static int spl_filesystem_dir_read(spl_filesystem_object *intern) /* {{{ */ { if (!intern->u.dir.dirp || !php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) { intern->u.dir.entry.d_name[0] = '\0'; @@ -228,7 +228,7 @@ static inline int spl_filesystem_is_dot(const char * d_name) /* {{{ */ /* {{{ spl_filesystem_dir_open */ /* open a directory resource */ -static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TSRMLS_DC) +static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path) { int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS); @@ -252,23 +252,23 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TS } } else { do { - spl_filesystem_dir_read(intern TSRMLS_CC); + spl_filesystem_dir_read(intern); } while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name)); } } /* }}} */ -static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent) /* {{{ */ { zval tmp; intern->type = SPL_FS_FILE; - php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp TSRMLS_CC); + php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp); if (Z_TYPE(tmp) == IS_TRUE) { intern->u.file.open_mode = NULL; intern->file_name = NULL; - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Cannot use SplFileObject with directories"); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Cannot use SplFileObject with directories"); return FAILURE; } @@ -277,7 +277,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu if (!intern->file_name_len || !intern->u.file.stream) { if (!EG(exception)) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot open file '%s'", intern->file_name_len ? intern->file_name : ""); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot open file '%s'", intern->file_name_len ? intern->file_name : ""); } intern->file_name = NULL; /* until here it is not a copy */ intern->u.file.open_mode = NULL; @@ -322,7 +322,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu Open the directory Clone other members (properties) */ -static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC) +static zend_object *spl_filesystem_object_clone(zval *zobject) { zend_object *old_object; zend_object *new_object; @@ -332,7 +332,7 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC) old_object = Z_OBJ_P(zobject); source = spl_filesystem_from_obj(old_object); - new_object = spl_filesystem_object_new_ex(old_object->ce TSRMLS_CC); + new_object = spl_filesystem_object_new_ex(old_object->ce); intern = spl_filesystem_from_obj(new_object); intern->flags = source->flags; @@ -345,18 +345,18 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC) intern->file_name = estrndup(source->file_name, intern->file_name_len); break; case SPL_FS_DIR: - spl_filesystem_dir_open(intern, source->_path TSRMLS_CC); + spl_filesystem_dir_open(intern, source->_path); /* read until we hit the position in which we were before */ skip_dots = SPL_HAS_FLAG(source->flags, SPL_FILE_DIR_SKIPDOTS); for(index = 0; index < source->u.dir.index; ++index) { do { - spl_filesystem_dir_read(intern TSRMLS_CC); + spl_filesystem_dir_read(intern); } while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name)); } intern->u.dir.index = index; break; case SPL_FS_FILE: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "An object of class %s cannot be cloned", old_object->ce->name->val); + php_error_docref(NULL, E_ERROR, "An object of class %s cannot be cloned", old_object->ce->name->val); break; } @@ -365,17 +365,17 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC) intern->oth = source->oth; intern->oth_handler = source->oth_handler; - zend_objects_clone_members(new_object, old_object TSRMLS_CC); + zend_objects_clone_members(new_object, old_object); if (intern->oth_handler && intern->oth_handler->clone) { - intern->oth_handler->clone(source, intern TSRMLS_CC); + intern->oth_handler->clone(source, intern); } return new_object; } /* }}} */ -void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, size_t len, size_t use_copy TSRMLS_DC) /* {{{ */ +void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, size_t len, size_t use_copy) /* {{{ */ { char *p1, *p2; @@ -409,7 +409,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, intern->_path = estrndup(path, intern->_path_len); } /* }}} */ -static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_object *source, char *file_path, int file_path_len, int use_copy, zend_class_entry *ce, zval *return_value TSRMLS_DC) /* {{{ */ +static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_object *source, char *file_path, int file_path_len, int use_copy, zend_class_entry *ce, zval *return_value) /* {{{ */ { spl_filesystem_object *intern; zval arg1; @@ -417,7 +417,7 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o if (!file_path || !file_path_len) { #if defined(PHP_WIN32) - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot create SplFileInfo for empty path"); if (file_path && !use_copy) { efree(file_path); } @@ -431,13 +431,13 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o return NULL; } - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling); ce = ce ? ce : source->info_class; - zend_update_class_constants(ce TSRMLS_CC); + zend_update_class_constants(ce); - intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC)); + intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce)); ZVAL_OBJ(return_value, &intern->std); if (ce->constructor->common.scope != spl_ce_SplFileInfo) { @@ -445,21 +445,21 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o zend_call_method_with_1_params(return_value, ce, &ce->constructor, "__construct", NULL, &arg1); zval_ptr_dtor(&arg1); } else { - spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy TSRMLS_CC); + spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy); } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); return intern; } /* }}} */ -static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value TSRMLS_DC) /* {{{ */ +static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value) /* {{{ */ { spl_filesystem_object *intern; zend_bool use_include_path = 0; zval arg1, arg2; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling); switch (source->type) { case SPL_FS_INFO: @@ -467,8 +467,8 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file break; case SPL_FS_DIR: if (!source->u.dir.entry.d_name[0]) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Could not open file"); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Could not open file"); + zend_restore_error_handling(&error_handling); return NULL; } } @@ -477,12 +477,12 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file case SPL_FS_INFO: ce = ce ? ce : source->info_class; - zend_update_class_constants(ce TSRMLS_CC); + zend_update_class_constants(ce); - intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC)); + intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce)); ZVAL_OBJ(return_value, &intern->std); - spl_filesystem_object_get_file_name(source TSRMLS_CC); + spl_filesystem_object_get_file_name(source); if (ce->constructor->common.scope != spl_ce_SplFileInfo) { ZVAL_STRINGL(&arg1, source->file_name, source->file_name_len); zend_call_method_with_1_params(return_value, ce, &ce->constructor, "__construct", NULL, &arg1); @@ -490,20 +490,20 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file } else { intern->file_name = estrndup(source->file_name, source->file_name_len); intern->file_name_len = source->file_name_len; - intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len TSRMLS_CC); + intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len); intern->_path = estrndup(intern->_path, intern->_path_len); } break; case SPL_FS_FILE: ce = ce ? ce : source->file_class; - zend_update_class_constants(ce TSRMLS_CC); + zend_update_class_constants(ce); - intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC)); + intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce)); ZVAL_OBJ(return_value, &intern->std); - spl_filesystem_object_get_file_name(source TSRMLS_CC); + spl_filesystem_object_get_file_name(source); if (ce->constructor->common.scope != spl_ce_SplFileObject) { ZVAL_STRINGL(&arg1, source->file_name, source->file_name_len); @@ -514,16 +514,16 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file } else { intern->file_name = source->file_name; intern->file_name_len = source->file_name_len; - intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len TSRMLS_CC); + intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len); intern->_path = estrndup(intern->_path, intern->_path_len); intern->u.file.open_mode = "r"; intern->u.file.open_mode_len = 1; - if (ht && zend_parse_parameters(ht TSRMLS_CC, "|sbr", + if (ht && zend_parse_parameters(ht, "|sbr", &intern->u.file.open_mode, &intern->u.file.open_mode_len, &use_include_path, &intern->u.file.zcontext) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); intern->u.file.open_mode = NULL; intern->file_name = NULL; zval_ptr_dtor(return_value); @@ -531,8 +531,8 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file return NULL; } - if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (spl_filesystem_file_open(intern, use_include_path, 0) == FAILURE) { + zend_restore_error_handling(&error_handling); zval_ptr_dtor(return_value); ZVAL_NULL(return_value); return NULL; @@ -540,11 +540,11 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file } break; case SPL_FS_DIR: - zend_restore_error_handling(&error_handling TSRMLS_CC); - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Operation not supported"); + zend_restore_error_handling(&error_handling); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Operation not supported"); return NULL; } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); return NULL; } /* }}} */ @@ -554,7 +554,7 @@ static int spl_filesystem_is_invalid_or_dot(const char * d_name) /* {{{ */ } /* }}} */ -static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, size_t *len TSRMLS_DC) { /* {{{ */ +static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, size_t *len) { /* {{{ */ switch (intern->type) { case SPL_FS_INFO: case SPL_FS_FILE: @@ -562,7 +562,7 @@ static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, s return intern->file_name; case SPL_FS_DIR: if (intern->u.dir.entry.d_name[0]) { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); + spl_filesystem_object_get_file_name(intern); *len = intern->file_name_len; return intern->file_name; } @@ -572,7 +572,7 @@ static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, s } /* }}} */ -static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */ +static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_temp) /* {{{ */ { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(object); zval tmp; @@ -592,15 +592,15 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem zend_array_dup(rv, intern->std.properties); - pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "pathName", sizeof("pathName")-1 TSRMLS_CC); - path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "pathName", sizeof("pathName")-1); + path = spl_filesystem_object_get_pathname(intern, &path_len); ZVAL_STRINGL(&tmp, path, path_len); zend_symtable_update(rv, pnstr, &tmp); zend_string_release(pnstr); if (intern->file_name) { - pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "fileName", sizeof("fileName")-1 TSRMLS_CC); - spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "fileName", sizeof("fileName")-1); + spl_filesystem_object_get_path(intern, &path_len); if (path_len && path_len < intern->file_name_len) { ZVAL_STRINGL(&tmp, intern->file_name + path_len + 1, intern->file_name_len - (path_len + 1)); @@ -612,7 +612,7 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem } if (intern->type == SPL_FS_DIR) { #ifdef HAVE_GLOB - pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1); if (php_stream_is(intern->u.dir.dirp ,&php_glob_stream_ops)) { ZVAL_STRINGL(&tmp, intern->_path, intern->_path_len); } else { @@ -621,7 +621,7 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem zend_symtable_update(rv, pnstr, &tmp); zend_string_release(pnstr); #endif - pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1); if (intern->u.dir.sub_path) { ZVAL_STRINGL(&tmp, intern->u.dir.sub_path, intern->u.dir.sub_path_len); } else { @@ -631,18 +631,18 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem zend_string_release(pnstr); } if (intern->type == SPL_FS_FILE) { - pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "openMode", sizeof("openMode")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "openMode", sizeof("openMode")-1); ZVAL_STRINGL(&tmp, intern->u.file.open_mode, intern->u.file.open_mode_len); zend_symtable_update(rv, pnstr, &tmp); zend_string_release(pnstr); stmp[1] = '\0'; stmp[0] = intern->u.file.delimiter; - pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "delimiter", sizeof("delimiter")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "delimiter", sizeof("delimiter")-1); ZVAL_STRINGL(&tmp, stmp, 1); zend_symtable_update(rv, pnstr, &tmp); zend_string_release(pnstr); stmp[0] = intern->u.file.enclosure; - pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "enclosure", sizeof("enclosure")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "enclosure", sizeof("enclosure")-1); ZVAL_STRINGL(&tmp, stmp, 1); zend_symtable_update(rv, pnstr, &tmp); zend_string_release(pnstr); @@ -652,19 +652,19 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem } /* }}} */ -zend_function *spl_filesystem_object_get_method_check(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */ +zend_function *spl_filesystem_object_get_method_check(zend_object **object, zend_string *method, const zval *key) /* {{{ */ { spl_filesystem_object *fsobj = spl_filesystem_from_obj(*object); if (fsobj->u.dir.entry.d_name[0] == '\0' && fsobj->orig_path == NULL) { zend_function *func; zend_string *tmp = zend_string_init("_bad_state_ex", sizeof("_bad_state_ex") - 1, 0); - func = zend_get_std_object_handlers()->get_method(object, tmp, NULL TSRMLS_CC); + func = zend_get_std_object_handlers()->get_method(object, tmp, NULL); zend_string_release(tmp); return func; } - return zend_get_std_object_handlers()->get_method(object, method, key TSRMLS_CC); + return zend_get_std_object_handlers()->get_method(object, method, key); } /* }}} */ @@ -679,14 +679,14 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto zend_long flags; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_FLAGS)) { flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO; - parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &len, &flags); + parsed = zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &path, &len, &flags); } else { flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF; - parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len); + parsed = zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &len); } if (SPL_HAS_FLAG(ctor_flags, SPL_FILE_DIR_SKIPDOTS)) { flags |= SPL_FILE_DIR_SKIPDOTS; @@ -695,38 +695,38 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto flags |= SPL_FILE_DIR_UNIXPATHS; } if (parsed == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); return; } if (!len) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Directory name must not be empty."); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Directory name must not be empty."); + zend_restore_error_handling(&error_handling); return; } intern = Z_SPLFILESYSTEM_P(getThis()); if (intern->_path) { /* object is alreay initialized */ - zend_restore_error_handling(&error_handling TSRMLS_CC); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory object is already initialized"); + zend_restore_error_handling(&error_handling); + php_error_docref(NULL, E_WARNING, "Directory object is already initialized"); return; } intern->flags = flags; #ifdef HAVE_GLOB if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && strstr(path, "glob://") != path) { spprintf(&path, 0, "glob://%s", path); - spl_filesystem_dir_open(intern, path TSRMLS_CC); + spl_filesystem_dir_open(intern, path); efree(path); } else #endif { - spl_filesystem_dir_open(intern, path TSRMLS_CC); + spl_filesystem_dir_open(intern, path); } - intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0; + intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator) ? 1 : 0; - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -752,7 +752,7 @@ SPL_METHOD(DirectoryIterator, rewind) if (intern->u.dir.dirp) { php_stream_rewinddir(intern->u.dir.dirp); } - spl_filesystem_dir_read(intern TSRMLS_CC); + spl_filesystem_dir_read(intern); } /* }}} */ @@ -798,7 +798,7 @@ SPL_METHOD(DirectoryIterator, next) intern->u.dir.index++; do { - spl_filesystem_dir_read(intern TSRMLS_CC); + spl_filesystem_dir_read(intern); } while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name)); if (intern->file_name) { efree(intern->file_name); @@ -815,7 +815,7 @@ SPL_METHOD(DirectoryIterator, seek) zval retval; zend_long pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pos) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pos) == FAILURE) { return; } @@ -828,7 +828,7 @@ SPL_METHOD(DirectoryIterator, seek) int valid = 0; zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_valid, "valid", &retval); if (!Z_ISUNDEF(retval)) { - valid = zend_is_true(&retval TSRMLS_CC); + valid = zend_is_true(&retval); zval_ptr_dtor(&retval); } if (!valid) { @@ -864,7 +864,7 @@ SPL_METHOD(SplFileInfo, getPath) return; } - path = spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC); + path = spl_filesystem_object_get_path(intern, &path_len); RETURN_STRINGL(path, path_len); } /* }}} */ @@ -880,7 +880,7 @@ SPL_METHOD(SplFileInfo, getFilename) return; } - spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC); + spl_filesystem_object_get_path(intern, &path_len); if (path_len && path_len < intern->file_name_len) { RETURN_STRINGL(intern->file_name + path_len + 1, intern->file_name_len - (path_len + 1)); @@ -920,7 +920,7 @@ SPL_METHOD(SplFileInfo, getExtension) return; } - spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC); + spl_filesystem_object_get_path(intern, &path_len); if (path_len && path_len < intern->file_name_len) { fname = intern->file_name + path_len + 1; @@ -930,7 +930,7 @@ SPL_METHOD(SplFileInfo, getExtension) flen = intern->file_name_len; } - ret = php_basename(fname, flen, NULL, 0 TSRMLS_CC); + ret = php_basename(fname, flen, NULL, 0); p = zend_memrchr(ret->val, '.', ret->len); if (p) { @@ -959,7 +959,7 @@ SPL_METHOD(DirectoryIterator, getExtension) return; } - fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), NULL, 0 TSRMLS_CC); + fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), NULL, 0); p = zend_memrchr(fname->val, '.', fname->len); if (p) { @@ -983,11 +983,11 @@ SPL_METHOD(SplFileInfo, getBasename) size_t flen; size_t slen = 0, path_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &suffix, &slen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &suffix, &slen) == FAILURE) { return; } - spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC); + spl_filesystem_object_get_path(intern, &path_len); if (path_len && path_len < intern->file_name_len) { fname = intern->file_name + path_len + 1; @@ -997,7 +997,7 @@ SPL_METHOD(SplFileInfo, getBasename) flen = intern->file_name_len; } - RETURN_STR(php_basename(fname, flen, suffix, slen TSRMLS_CC)); + RETURN_STR(php_basename(fname, flen, suffix, slen)); } /* }}}*/ @@ -1010,11 +1010,11 @@ SPL_METHOD(DirectoryIterator, getBasename) size_t slen = 0; zend_string *fname; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &suffix, &slen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &suffix, &slen) == FAILURE) { return; } - fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), suffix, slen TSRMLS_CC); + fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), suffix, slen); RETVAL_STR(fname); } @@ -1031,7 +1031,7 @@ SPL_METHOD(SplFileInfo, getPathname) if (zend_parse_parameters_none() == FAILURE) { return; } - path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC); + path = spl_filesystem_object_get_pathname(intern, &path_len); if (path != NULL) { RETURN_STRINGL(path, path_len); } else { @@ -1053,7 +1053,7 @@ SPL_METHOD(FilesystemIterator, key) if (SPL_FILE_DIR_KEY(intern, SPL_FILE_DIR_KEY_AS_FILENAME)) { RETURN_STRING(intern->u.dir.entry.d_name); } else { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); + spl_filesystem_object_get_file_name(intern); RETURN_STRINGL(intern->file_name, intern->file_name_len); } } @@ -1070,11 +1070,11 @@ SPL_METHOD(FilesystemIterator, current) } if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); + spl_filesystem_object_get_file_name(intern); RETURN_STRINGL(intern->file_name, intern->file_name_len); } else if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_FILEINFO)) { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); - spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, return_value TSRMLS_CC); + spl_filesystem_object_get_file_name(intern); + spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, return_value); } else { RETURN_ZVAL(getThis(), 1, 0); /*RETURN_STRING(intern->u.dir.entry.d_name, 1);*/ @@ -1112,18 +1112,18 @@ SPL_METHOD(SplFileInfo, __construct) size_t len; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &len) == FAILURE) { + zend_restore_error_handling(&error_handling); return; } intern = Z_SPLFILESYSTEM_P(getThis()); - spl_filesystem_info_set_filename(intern, path, len, 1 TSRMLS_CC); + spl_filesystem_info_set_filename(intern, path, len, 1); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); /* intern->type = SPL_FS_INFO; already set */ } @@ -1139,10 +1139,10 @@ SPL_METHOD(SplFileInfo, func_name) \ return; \ } \ \ - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);\ - spl_filesystem_object_get_file_name(intern TSRMLS_CC); \ - php_stat(intern->file_name, intern->file_name_len, func_num, return_value TSRMLS_CC); \ - zend_restore_error_handling(&error_handling TSRMLS_CC); \ + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);\ + spl_filesystem_object_get_file_name(intern); \ + php_stat(intern->file_name, intern->file_name_len, func_num, return_value); \ + zend_restore_error_handling(&error_handling); \ } /* }}} */ @@ -1234,16 +1234,16 @@ SPL_METHOD(SplFileInfo, getLinkTarget) return; } - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling); #if defined(PHP_WIN32) || HAVE_SYMLINK if (intern->file_name == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty filename"); + php_error_docref(NULL, E_WARNING, "Empty filename"); RETURN_FALSE; } else if (!IS_ABSOLUTE_PATH(intern->file_name, intern->file_name_len)) { char expanded_path[MAXPATHLEN]; - if (!expand_filepath_with_mode(intern->file_name, expanded_path, NULL, 0, CWD_EXPAND TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); + if (!expand_filepath_with_mode(intern->file_name, expanded_path, NULL, 0, CWD_EXPAND )) { + php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; } ret = php_sys_readlink(expanded_path, buff, MAXPATHLEN - 1); @@ -1255,7 +1255,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget) #endif if (ret == -1) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Unable to read link %s, error: %s", intern->file_name, strerror(errno)); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Unable to read link %s, error: %s", intern->file_name, strerror(errno)); RETVAL_FALSE; } else { /* Append NULL to the end of the string */ @@ -1264,7 +1264,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget) RETVAL_STRINGL(buff, ret); } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -1282,10 +1282,10 @@ SPL_METHOD(SplFileInfo, getRealPath) return; } - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling); if (intern->type == SPL_FS_DIR && !intern->file_name && intern->u.dir.entry.d_name[0]) { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); + spl_filesystem_object_get_file_name(intern); } if (intern->orig_path) { @@ -1306,7 +1306,7 @@ SPL_METHOD(SplFileInfo, getRealPath) RETVAL_FALSE; } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ #endif @@ -1317,7 +1317,7 @@ SPL_METHOD(SplFileInfo, openFile) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); - spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_FILE, NULL, return_value TSRMLS_CC); + spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_FILE, NULL, return_value); } /* }}} */ @@ -1329,13 +1329,13 @@ SPL_METHOD(SplFileInfo, setFileClass) zend_class_entry *ce = spl_ce_SplFileObject; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { intern->file_class = ce; } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -1347,13 +1347,13 @@ SPL_METHOD(SplFileInfo, setInfoClass) zend_class_entry *ce = spl_ce_SplFileInfo; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling ); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { intern->info_class = ce; } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -1365,13 +1365,13 @@ SPL_METHOD(SplFileInfo, getFileInfo) zend_class_entry *ce = intern->info_class; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { - spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { + spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value); } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -1383,27 +1383,27 @@ SPL_METHOD(SplFileInfo, getPathInfo) zend_class_entry *ce = intern->info_class; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { size_t path_len; - char *path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC); + char *path = spl_filesystem_object_get_pathname(intern, &path_len); if (path) { char *dpath = estrndup(path, path_len); path_len = php_dirname(dpath, path_len); - spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value TSRMLS_CC); + spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value); efree(dpath); } } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ /* {{{ proto SplFileInfo::_bad_state_ex(void) */ SPL_METHOD(SplFileInfo, _bad_state_ex) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, + zend_throw_exception_ex(spl_ce_LogicException, 0, "The parent constructor was not called: the object is in an " "invalid state "); } @@ -1433,7 +1433,7 @@ SPL_METHOD(FilesystemIterator, rewind) php_stream_rewinddir(intern->u.dir.dirp); } do { - spl_filesystem_dir_read(intern TSRMLS_CC); + spl_filesystem_dir_read(intern); } while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name)); } /* }}} */ @@ -1458,7 +1458,7 @@ SPL_METHOD(FilesystemIterator, setFlags) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); zend_long flags; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) { return; } @@ -1473,20 +1473,20 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren) zend_bool allow_links = 0; spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &allow_links) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &allow_links) == FAILURE) { return; } if (spl_filesystem_is_invalid_or_dot(intern->u.dir.entry.d_name)) { RETURN_FALSE; } else { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); + spl_filesystem_object_get_file_name(intern); if (!allow_links && !(intern->flags & SPL_FILE_DIR_FOLLOW_SYMLINKS)) { - php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC); - if (zend_is_true(return_value TSRMLS_CC)) { + php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value); + if (zend_is_true(return_value)) { RETURN_FALSE; } } - php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, return_value TSRMLS_CC); + php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, return_value); } } /* }}} */ @@ -1504,11 +1504,11 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren) return; } - spl_filesystem_object_get_file_name(intern TSRMLS_CC); + spl_filesystem_object_get_file_name(intern); ZVAL_LONG(&zflags, intern->flags); ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len); - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &zpath, &zflags TSRMLS_CC); + spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &zpath, &zflags); zval_ptr_dtor(&zpath); zval_ptr_dtor(&zflags); @@ -1599,19 +1599,19 @@ SPL_METHOD(GlobIterator, count) RETURN_LONG(php_glob_stream_get_count(intern->u.dir.dirp, NULL)); } else { /* should not happen */ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "GlobIterator lost glob state"); + php_error_docref(NULL, E_ERROR, "GlobIterator lost glob state"); } } /* }}} */ #endif /* HAVE_GLOB */ /* {{{ forward declarations to the iterator handlers */ -static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC); -static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC); -static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRMLS_DC); -static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC); -static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC); -static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC); +static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter); +static int spl_filesystem_dir_it_valid(zend_object_iterator *iter); +static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter); +static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key); +static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter); +static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter); /* iterator handler table */ zend_object_iterator_funcs spl_filesystem_dir_it_funcs = { @@ -1625,7 +1625,7 @@ zend_object_iterator_funcs spl_filesystem_dir_it_funcs = { /* }}} */ /* {{{ spl_ce_dir_get_iterator */ -zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) +zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object, int by_ref) { spl_filesystem_iterator *iterator; spl_filesystem_object *dir_object; @@ -1634,7 +1634,7 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); } dir_object = Z_SPLFILESYSTEM_P(object); - iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC); + iterator = spl_filesystem_object_to_iterator(dir_object); ZVAL_COPY(&iterator->intern.data, object); iterator->intern.funcs = &spl_filesystem_dir_it_funcs; /* ->current must be initialized; rewind doesn't set it and valid @@ -1646,7 +1646,7 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval /* }}} */ /* {{{ spl_filesystem_dir_it_dtor */ -static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC) +static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter) { spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter; @@ -1663,16 +1663,16 @@ static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* }}} */ /* {{{ spl_filesystem_dir_it_valid */ -static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC) +static int spl_filesystem_dir_it_valid(zend_object_iterator *iter) { - spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter); return object->u.dir.entry.d_name[0] != '\0' ? SUCCESS : FAILURE; } /* }}} */ /* {{{ spl_filesystem_dir_it_current_data */ -static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRMLS_DC) +static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter) { spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter; @@ -1681,21 +1681,21 @@ static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRML /* }}} */ /* {{{ spl_filesystem_dir_it_current_key */ -static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) +static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key) { - spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter); ZVAL_LONG(key, object->u.dir.index); } /* }}} */ /* {{{ spl_filesystem_dir_it_move_forward */ -static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC) +static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter) { - spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter); object->u.dir.index++; - spl_filesystem_dir_read(object TSRMLS_CC); + spl_filesystem_dir_read(object); if (object->file_name) { efree(object->file_name); object->file_name = NULL; @@ -1704,20 +1704,20 @@ static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS /* }}} */ /* {{{ spl_filesystem_dir_it_rewind */ -static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC) +static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter) { - spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter); object->u.dir.index = 0; if (object->u.dir.dirp) { php_stream_rewinddir(object->u.dir.dirp); } - spl_filesystem_dir_read(object TSRMLS_CC); + spl_filesystem_dir_read(object); } /* }}} */ /* {{{ spl_filesystem_tree_it_dtor */ -static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC) +static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter) { spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter; @@ -1734,21 +1734,21 @@ static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* }}} */ /* {{{ spl_filesystem_tree_it_current_data */ -static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRMLS_DC) +static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter) { spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter; - spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator); if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) { if (Z_ISUNDEF(iterator->current)) { - spl_filesystem_object_get_file_name(object TSRMLS_CC); + spl_filesystem_object_get_file_name(object); ZVAL_STRINGL(&iterator->current, object->file_name, object->file_name_len); } return &iterator->current; } else if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_FILEINFO)) { if (Z_ISUNDEF(iterator->current)) { - spl_filesystem_object_get_file_name(object TSRMLS_CC); - spl_filesystem_object_create_type(0, object, SPL_FS_INFO, NULL, &iterator->current TSRMLS_CC); + spl_filesystem_object_get_file_name(object); + spl_filesystem_object_create_type(0, object, SPL_FS_INFO, NULL, &iterator->current); } return &iterator->current; } else { @@ -1758,28 +1758,28 @@ static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRM /* }}} */ /* {{{ spl_filesystem_tree_it_current_key */ -static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) +static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key) { - spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter); if (SPL_FILE_DIR_KEY(object, SPL_FILE_DIR_KEY_AS_FILENAME)) { ZVAL_STRING(key, object->u.dir.entry.d_name); } else { - spl_filesystem_object_get_file_name(object TSRMLS_CC); + spl_filesystem_object_get_file_name(object); ZVAL_STRINGL(key, object->file_name, object->file_name_len); } } /* }}} */ /* {{{ spl_filesystem_tree_it_move_forward */ -static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRMLS_DC) +static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter) { spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter; - spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator); object->u.dir.index++; do { - spl_filesystem_dir_read(object TSRMLS_CC); + spl_filesystem_dir_read(object); } while (spl_filesystem_is_dot(object->u.dir.entry.d_name)); if (object->file_name) { efree(object->file_name); @@ -1793,17 +1793,17 @@ static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRML /* }}} */ /* {{{ spl_filesystem_tree_it_rewind */ -static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter TSRMLS_DC) +static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter) { spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter; - spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC); + spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator); object->u.dir.index = 0; if (object->u.dir.dirp) { php_stream_rewinddir(object->u.dir.dirp); } do { - spl_filesystem_dir_read(object TSRMLS_CC); + spl_filesystem_dir_read(object); } while (spl_filesystem_is_dot(object->u.dir.entry.d_name)); if (!Z_ISUNDEF(iterator->current)) { zval_ptr_dtor(&iterator->current); @@ -1824,7 +1824,7 @@ zend_object_iterator_funcs spl_filesystem_tree_it_funcs = { /* }}} */ /* {{{ spl_ce_dir_get_iterator */ -zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) +zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref) { spl_filesystem_iterator *iterator; spl_filesystem_object *dir_object; @@ -1833,7 +1833,7 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); } dir_object = Z_SPLFILESYSTEM_P(object); - iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC); + iterator = spl_filesystem_object_to_iterator(dir_object); ZVAL_COPY(&iterator->intern.data, object); iterator->intern.funcs = &spl_filesystem_tree_it_funcs; @@ -1843,13 +1843,13 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva /* }}} */ /* {{{ spl_filesystem_object_cast */ -static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) +static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(readobj); if (type == IS_STRING) { if (Z_OBJCE_P(readobj)->__tostring) { - return std_object_handlers.cast_object(readobj, writeobj, type TSRMLS_CC); + return std_object_handlers.cast_object(readobj, writeobj, type); } switch (intern->type) { @@ -2020,17 +2020,17 @@ static const zend_function_entry spl_GlobIterator_functions[] = { #endif /* }}} */ -static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent) /* {{{ */ { char *buf; size_t line_len = 0; zend_long line_add = (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) ? 1 : 0; - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); if (php_stream_eof(intern->u.file.stream)) { if (!silent) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %s", intern->file_name); } return FAILURE; } @@ -2064,7 +2064,7 @@ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TS return SUCCESS; } /* }}} */ -static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function *func_ptr, int pass_num_args, zval *return_value, zval *arg2 TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function *func_ptr, int pass_num_args, zval *return_value, zval *arg2) /* {{{ */ { zend_fcall_info fci; zend_fcall_info_cache fcic; @@ -2100,7 +2100,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function fcic.called_scope = NULL; fcic.object = NULL; - result = zend_call_function(&fci, &fcic TSRMLS_CC); + result = zend_call_function(&fci, &fcic); if (result == FAILURE || Z_ISUNDEF(retval)) { RETVAL_FALSE; @@ -2117,18 +2117,18 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function zend_function *func_ptr; \ func_ptr = (zend_function *)zend_hash_str_find_ptr(EG(function_table), #func_name, sizeof(#func_name) - 1); \ if (func_ptr == NULL) { \ - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Internal error, function '%s' not found. Please report", #func_name); \ + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Internal error, function '%s' not found. Please report", #func_name); \ return; \ } \ - spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2 TSRMLS_CC); \ + spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2); \ } /* }}} */ -static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, char escape, zval *return_value TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, char escape, zval *return_value) /* {{{ */ { int ret = SUCCESS; do { - ret = spl_filesystem_file_read(intern, 1 TSRMLS_CC); + ret = spl_filesystem_file_read(intern, 1); } while (ret == SUCCESS && !intern->u.file.current_line_len && SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY)); if (ret == SUCCESS) { @@ -2140,7 +2140,7 @@ static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char deli ZVAL_UNDEF(&intern->u.file.current_zval); } - php_fgetcsv(intern->u.file.stream, delimiter, enclosure, escape, buf_len, buf, &intern->u.file.current_zval TSRMLS_CC); + php_fgetcsv(intern->u.file.stream, delimiter, enclosure, escape, buf_len, buf, &intern->u.file.current_zval); if (return_value) { if (Z_TYPE_P(return_value) != IS_NULL) { zval_dtor(return_value); @@ -2153,7 +2153,7 @@ static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char deli } /* }}} */ -static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */ { zval retval; @@ -2161,12 +2161,12 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || intern->u.file.func_getCurr->common.scope != spl_ce_SplFileObject) { if (php_stream_eof(intern->u.file.stream)) { if (!silent) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %s", intern->file_name); } return FAILURE; } if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV)) { - return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL TSRMLS_CC); + return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL); } else { zend_execute_data *execute_data = EG(current_execute_data); zend_call_method_with_0_params(this_ptr, Z_OBJCE(EX(This)), &intern->u.file.func_getCurr, "getCurrentLine", &retval); @@ -2175,7 +2175,7 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje if (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) { intern->u.file.current_line_num++; } - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); if (Z_TYPE(retval) == IS_STRING) { intern->u.file.current_line = estrndup(Z_STRVAL(retval), Z_STRLEN(retval)); intern->u.file.current_line_len = Z_STRLEN(retval); @@ -2188,11 +2188,11 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje return FAILURE; } } else { - return spl_filesystem_file_read(intern, silent TSRMLS_CC); + return spl_filesystem_file_read(intern, silent); } } /* }}} */ -static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern) /* {{{ */ { if (intern->u.file.current_line) { return intern->u.file.current_line_len == 0; @@ -2224,33 +2224,33 @@ static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern TSRML } /* }}} */ -static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */ { - int ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC); + int ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent); - while (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY) && ret == SUCCESS && spl_filesystem_file_is_empty_line(intern TSRMLS_CC)) { - spl_filesystem_file_free_line(intern TSRMLS_CC); - ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC); + while (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY) && ret == SUCCESS && spl_filesystem_file_is_empty_line(intern)) { + spl_filesystem_file_free_line(intern); + ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent); } return ret; } /* }}} */ -static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ +static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *intern) /* {{{ */ { if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } if (-1 == php_stream_rewind(intern->u.file.stream)) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot rewind file %s", intern->file_name); } else { - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); intern->u.file.current_line_num = 0; } if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { - spl_filesystem_file_read_line(this_ptr, intern, 1 TSRMLS_CC); + spl_filesystem_file_read_line(this_ptr, intern, 1); } } /* }}} */ @@ -2265,18 +2265,18 @@ SPL_METHOD(SplFileObject, __construct) size_t tmp_path_len; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling); intern->u.file.open_mode = NULL; intern->u.file.open_mode_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbr!", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sbr!", &intern->file_name, &intern->file_name_len, &intern->u.file.open_mode, &intern->u.file.open_mode_len, &use_include_path, &intern->u.file.zcontext) == FAILURE) { intern->u.file.open_mode = NULL; intern->file_name = NULL; - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); return; } @@ -2285,7 +2285,7 @@ SPL_METHOD(SplFileObject, __construct) intern->u.file.open_mode_len = 1; } - if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == SUCCESS) { + if (spl_filesystem_file_open(intern, use_include_path, 0) == SUCCESS) { tmp_path_len = strlen(intern->u.file.stream->orig_path); if (tmp_path_len > 1 && IS_SLASH_AT(intern->u.file.stream->orig_path, tmp_path_len-1)) { @@ -2311,7 +2311,7 @@ SPL_METHOD(SplFileObject, __construct) intern->_path = estrndup(intern->u.file.stream->orig_path, intern->_path_len); } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -2324,10 +2324,10 @@ SPL_METHOD(SplTempFileObject, __construct) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_memory) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &max_memory) == FAILURE) { + zend_restore_error_handling(&error_handling); return; } @@ -2344,11 +2344,11 @@ SPL_METHOD(SplTempFileObject, __construct) intern->u.file.open_mode = "wb"; intern->u.file.open_mode_len = 1; - if (spl_filesystem_file_open(intern, 0, 0 TSRMLS_CC) == SUCCESS) { + if (spl_filesystem_file_open(intern, 0, 0) == SUCCESS) { intern->_path_len = 0; intern->_path = estrndup("", 0); } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ /* {{{ proto void SplFileObject::rewind() @@ -2361,7 +2361,7 @@ SPL_METHOD(SplFileObject, rewind) return; } - spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC); + spl_filesystem_file_rewind(getThis(), intern); } /* }}} */ /* {{{ proto void SplFileObject::eof() @@ -2375,7 +2375,7 @@ SPL_METHOD(SplFileObject, eof) } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } @@ -2413,11 +2413,11 @@ SPL_METHOD(SplFileObject, fgets) } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } - if (spl_filesystem_file_read(intern, 0 TSRMLS_CC) == FAILURE) { + if (spl_filesystem_file_read(intern, 0) == FAILURE) { RETURN_FALSE; } RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len); @@ -2434,12 +2434,12 @@ SPL_METHOD(SplFileObject, current) } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } if (!intern->u.file.current_line && Z_ISUNDEF(intern->u.file.current_zval)) { - spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC); + spl_filesystem_file_read_line(getThis(), intern, 1); } if (intern->u.file.current_line && (!SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || Z_ISUNDEF(intern->u.file.current_zval))) { RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len); @@ -2461,7 +2461,7 @@ SPL_METHOD(SplFileObject, key) /* Do not read the next line to support correct counting with fgetc() if (!intern->current_line) { - spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC); + spl_filesystem_file_read_line(getThis(), intern, 1); } */ RETURN_LONG(intern->u.file.current_line_num); } /* }}} */ @@ -2476,9 +2476,9 @@ SPL_METHOD(SplFileObject, next) return; } - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { - spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC); + spl_filesystem_file_read_line(getThis(), intern, 1); } intern->u.file.current_line_num++; } /* }}} */ @@ -2489,7 +2489,7 @@ SPL_METHOD(SplFileObject, setFlags) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) { return; } } /* }}} */ @@ -2515,12 +2515,12 @@ SPL_METHOD(SplFileObject, setMaxLineLen) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &max_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &max_len) == FAILURE) { return; } if (max_len < 0) { - zend_throw_exception_ex(spl_ce_DomainException, 0 TSRMLS_CC, "Maximum line length must be greater than or equal zero"); + zend_throw_exception_ex(spl_ce_DomainException, 0, "Maximum line length must be greater than or equal zero"); return; } @@ -2579,10 +2579,10 @@ SPL_METHOD(SplFileObject, fgetcsv) char *delim = NULL, *enclo = NULL, *esc = NULL; size_t d_len = 0, e_len = 0, esc_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } @@ -2590,21 +2590,21 @@ SPL_METHOD(SplFileObject, fgetcsv) { case 3: if (esc_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character"); + php_error_docref(NULL, E_WARNING, "escape must be a character"); RETURN_FALSE; } escape = esc[0]; /* no break */ case 2: if (e_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character"); + php_error_docref(NULL, E_WARNING, "enclosure must be a character"); RETURN_FALSE; } enclosure = enclo[0]; /* no break */ case 1: if (d_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character"); + php_error_docref(NULL, E_WARNING, "delimiter must be a character"); RETURN_FALSE; } delimiter = delim[0]; @@ -2612,7 +2612,7 @@ SPL_METHOD(SplFileObject, fgetcsv) case 0: break; } - spl_filesystem_file_read_csv(intern, delimiter, enclosure, escape, return_value TSRMLS_CC); + spl_filesystem_file_read_csv(intern, delimiter, enclosure, escape, return_value); } } /* }}} */ @@ -2628,26 +2628,26 @@ SPL_METHOD(SplFileObject, fputcsv) zend_long ret; zval *fields = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|sss", &fields, &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|sss", &fields, &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { switch(ZEND_NUM_ARGS()) { case 4: if (esc_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character"); + php_error_docref(NULL, E_WARNING, "escape must be a character"); RETURN_FALSE; } escape = esc[0]; /* no break */ case 3: if (e_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character"); + php_error_docref(NULL, E_WARNING, "enclosure must be a character"); RETURN_FALSE; } enclosure = enclo[0]; /* no break */ case 2: if (d_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character"); + php_error_docref(NULL, E_WARNING, "delimiter must be a character"); RETURN_FALSE; } delimiter = delim[0]; @@ -2656,7 +2656,7 @@ SPL_METHOD(SplFileObject, fputcsv) case 0: break; } - ret = php_fputcsv(intern->u.file.stream, fields, delimiter, enclosure, escape TSRMLS_CC); + ret = php_fputcsv(intern->u.file.stream, fields, delimiter, enclosure, escape); RETURN_LONG(ret); } } @@ -2671,26 +2671,26 @@ SPL_METHOD(SplFileObject, setCsvControl) char *delim = NULL, *enclo = NULL, *esc = NULL; size_t d_len = 0, e_len = 0, esc_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { switch(ZEND_NUM_ARGS()) { case 3: if (esc_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character"); + php_error_docref(NULL, E_WARNING, "escape must be a character"); RETURN_FALSE; } escape = esc[0]; /* no break */ case 2: if (e_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character"); + php_error_docref(NULL, E_WARNING, "enclosure must be a character"); RETURN_FALSE; } enclosure = enclo[0]; /* no break */ case 1: if (d_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character"); + php_error_docref(NULL, E_WARNING, "delimiter must be a character"); RETURN_FALSE; } delimiter = delim[0]; @@ -2736,7 +2736,7 @@ SPL_METHOD(SplFileObject, fflush) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } @@ -2751,7 +2751,7 @@ SPL_METHOD(SplFileObject, ftell) zend_long ret; if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } @@ -2771,16 +2771,16 @@ SPL_METHOD(SplFileObject, fseek) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); zend_long pos, whence = SEEK_SET; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &pos, &whence) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &pos, &whence) == FAILURE) { return; } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, (int)whence)); } /* }}} */ @@ -2793,11 +2793,11 @@ SPL_METHOD(SplFileObject, fgetc) int result; if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); result = php_stream_getc(intern->u.file.stream); @@ -2822,7 +2822,7 @@ SPL_METHOD(SplFileObject, fgetss) zval arg2; if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } @@ -2832,7 +2832,7 @@ SPL_METHOD(SplFileObject, fgetss) ZVAL_LONG(&arg2, 1024); } - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); intern->u.file.current_line_num++; FileFunctionCall(fgetss, ZEND_NUM_ARGS(), &arg2); @@ -2845,7 +2845,7 @@ SPL_METHOD(SplFileObject, fpassthru) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } @@ -2859,11 +2859,11 @@ SPL_METHOD(SplFileObject, fscanf) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } - spl_filesystem_file_free_line(intern TSRMLS_CC); + spl_filesystem_file_free_line(intern); intern->u.file.current_line_num++; FileFunctionCall(fscanf, ZEND_NUM_ARGS(), NULL); @@ -2879,12 +2879,12 @@ SPL_METHOD(SplFileObject, fwrite) size_t str_len; zend_long length = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &length) == FAILURE) { return; } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } @@ -2908,17 +2908,17 @@ SPL_METHOD(SplFileObject, fread) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); zend_long length = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) { return; } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } if (length <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0"); + php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0"); RETURN_FALSE; } @@ -2941,17 +2941,17 @@ SPL_METHOD(SplFileObject, ftruncate) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); zend_long size; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) { return; } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } if (!php_stream_truncate_supported(intern->u.file.stream)) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't truncate file %s", intern->file_name); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't truncate file %s", intern->file_name); RETURN_FALSE; } @@ -2965,23 +2965,23 @@ SPL_METHOD(SplFileObject, seek) spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); zend_long line_pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_pos) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &line_pos) == FAILURE) { return; } if(!intern->u.file.stream) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized"); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized"); return; } if (line_pos < 0) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't seek file %s to negative line %pd", intern->file_name, line_pos); + zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't seek file %s to negative line %pd", intern->file_name, line_pos); RETURN_FALSE; } - spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC); + spl_filesystem_file_rewind(getThis(), intern); while(intern->u.file.current_line_num < line_pos) { - if (spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC) == FAILURE) { + if (spl_filesystem_file_read_line(getThis(), intern, 1) == FAILURE) { break; } } @@ -3117,7 +3117,7 @@ PHP_MINIT_FUNCTION(spl_directory) REGISTER_SPL_SUB_CLASS_EX(DirectoryIterator, SplFileInfo, spl_filesystem_object_new, spl_DirectoryIterator_functions); - zend_class_implements(spl_ce_DirectoryIterator TSRMLS_CC, 1, zend_ce_iterator); + zend_class_implements(spl_ce_DirectoryIterator, 1, zend_ce_iterator); REGISTER_SPL_IMPLEMENTS(DirectoryIterator, SeekableIterator); spl_ce_DirectoryIterator->get_iterator = spl_filesystem_dir_get_iterator; diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h index b6c8b72933..f62306c2c6 100644 --- a/ext/spl/spl_directory.h +++ b/ext/spl/spl_directory.h @@ -42,10 +42,10 @@ typedef enum { typedef struct _spl_filesystem_object spl_filesystem_object; -typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object TSRMLS_DC); -typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC); +typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object); +typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst); -PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC); +PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len); typedef struct _spl_other_handler { spl_foreign_dtor_t dtor; @@ -112,15 +112,15 @@ static inline spl_filesystem_object *spl_filesystem_from_obj(zend_object *obj) / #define Z_SPLFILESYSTEM_P(zv) spl_filesystem_from_obj(Z_OBJ_P((zv))) -static inline spl_filesystem_iterator* spl_filesystem_object_to_iterator(spl_filesystem_object *obj TSRMLS_DC) +static inline spl_filesystem_iterator* spl_filesystem_object_to_iterator(spl_filesystem_object *obj) { obj->it = ecalloc(1, sizeof(spl_filesystem_iterator)); obj->it->object = (void *)obj; - zend_iterator_init(&obj->it->intern TSRMLS_CC); + zend_iterator_init(&obj->it->intern); return obj->it; } -static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_filesystem_iterator *it TSRMLS_DC) +static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_filesystem_iterator *it) { return (spl_filesystem_object*)it->object; } diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 8a61407589..b08623eb4d 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -68,8 +68,8 @@ typedef struct _spl_ptr_llist_element { zval data; } spl_ptr_llist_element; -typedef void (*spl_ptr_llist_dtor_func)(spl_ptr_llist_element * TSRMLS_DC); -typedef void (*spl_ptr_llist_ctor_func)(spl_ptr_llist_element * TSRMLS_DC); +typedef void (*spl_ptr_llist_dtor_func)(spl_ptr_llist_element *); +typedef void (*spl_ptr_llist_ctor_func)(spl_ptr_llist_element *); typedef struct _spl_ptr_llist { spl_ptr_llist_element *head; @@ -113,7 +113,7 @@ static inline spl_dllist_object *spl_dllist_from_obj(zend_object *obj) /* {{{ */ #define Z_SPLDLLIST_P(zv) spl_dllist_from_obj(Z_OBJ_P((zv))) /* {{{ spl_ptr_llist */ -static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */ +static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem) { /* {{{ */ if (!Z_ISUNDEF(elem->data)) { zval_ptr_dtor(&elem->data); ZVAL_UNDEF(&elem->data); @@ -121,7 +121,7 @@ static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem TSRMLS_DC) { /* } /* }}} */ -static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */ +static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem) { /* {{{ */ if (Z_REFCOUNTED(elem->data)) { Z_ADDREF(elem->data); } @@ -148,7 +148,7 @@ static zend_long spl_ptr_llist_count(spl_ptr_llist *llist) /* {{{ */ } /* }}} */ -static void spl_ptr_llist_destroy(spl_ptr_llist *llist TSRMLS_DC) /* {{{ */ +static void spl_ptr_llist_destroy(spl_ptr_llist *llist) /* {{{ */ { spl_ptr_llist_element *current = llist->head, *next; spl_ptr_llist_dtor_func dtor = llist->dtor; @@ -156,7 +156,7 @@ static void spl_ptr_llist_destroy(spl_ptr_llist *llist TSRMLS_DC) /* {{{ */ while (current) { next = current->next; if(current && dtor) { - dtor(current TSRMLS_CC); + dtor(current); } SPL_LLIST_DELREF(current); current = next; @@ -191,7 +191,7 @@ static spl_ptr_llist_element *spl_ptr_llist_offset(spl_ptr_llist *llist, zend_lo } /* }}} */ -static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{{ */ +static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data) /* {{{ */ { spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); @@ -210,12 +210,12 @@ static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* llist->count++; if (llist->ctor) { - llist->ctor(elem TSRMLS_CC); + llist->ctor(elem); } } /* }}} */ -static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{{ */ +static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data) /* {{{ */ { spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); @@ -234,12 +234,12 @@ static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{ llist->count++; if (llist->ctor) { - llist->ctor(elem TSRMLS_CC); + llist->ctor(elem); } } /* }}} */ -static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{ */ +static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret) /* {{{ */ { spl_ptr_llist_element *tail = llist->tail; @@ -259,7 +259,7 @@ static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{ ZVAL_COPY(ret, &tail->data); if (llist->dtor) { - llist->dtor(tail TSRMLS_CC); + llist->dtor(tail); } ZVAL_UNDEF(&tail->data); @@ -292,7 +292,7 @@ static zval *spl_ptr_llist_first(spl_ptr_llist *llist) /* {{{ */ } /* }}} */ -static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{ */ +static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret) /* {{{ */ { spl_ptr_llist_element *head = llist->head; @@ -312,7 +312,7 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{ ZVAL_COPY(ret, &head->data); if (llist->dtor) { - llist->dtor(head TSRMLS_CC); + llist->dtor(head); } ZVAL_UNDEF(&head->data); @@ -320,7 +320,7 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{ } /* }}} */ -static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /* {{{ */ +static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to) /* {{{ */ { spl_ptr_llist_element *current = from->head, *next; //??? spl_ptr_llist_ctor_func ctor = from->ctor; @@ -330,11 +330,11 @@ static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /*??? FIXME if (ctor) { - ctor(current TSRMLS_CC); + ctor(current); } */ - spl_ptr_llist_push(to, ¤t->data TSRMLS_CC); + spl_ptr_llist_push(to, ¤t->data); current = next; } @@ -343,19 +343,19 @@ static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /* }}} */ -static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ +static void spl_dllist_object_free_storage(zend_object *object) /* {{{ */ { spl_dllist_object *intern = spl_dllist_from_obj(object); zval tmp; - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); while (intern->llist->count > 0) { - spl_ptr_llist_pop(intern->llist, &tmp TSRMLS_CC); + spl_ptr_llist_pop(intern->llist, &tmp); zval_ptr_dtor(&tmp); } - spl_ptr_llist_destroy(intern->llist TSRMLS_CC); + spl_ptr_llist_destroy(intern->llist); SPL_LLIST_CHECK_DELREF(intern->traverse_pointer); if (intern->debug_info != NULL) { @@ -365,9 +365,9 @@ static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ } /* }}} */ -zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); +zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref); -static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */ +static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */ { spl_dllist_object *intern; zend_class_entry *parent = class_type; @@ -375,7 +375,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval intern = ecalloc(1, sizeof(spl_dllist_object) + sizeof(zval) * (parent->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); intern->flags = 0; @@ -388,7 +388,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval if (clone_orig) { intern->llist = (spl_ptr_llist *)spl_ptr_llist_init(other->llist->ctor, other->llist->dtor); - spl_ptr_llist_copy(other->llist, intern->llist TSRMLS_CC); + spl_ptr_llist_copy(other->llist, intern->llist); intern->traverse_pointer = intern->llist->head; SPL_LLIST_CHECK_ADDREF(intern->traverse_pointer); } else { @@ -423,7 +423,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval } if (!parent) { /* this must never happen */ - php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplDoublyLinkedList"); + php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplDoublyLinkedList"); } if (inherited) { intern->fptr_offset_get = zend_hash_str_find_ptr(&class_type->function_table, "offsetget", sizeof("offsetget") - 1); @@ -452,27 +452,27 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval } /* }}} */ -static zend_object *spl_dllist_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *spl_dllist_object_new(zend_class_entry *class_type) /* {{{ */ { - return spl_dllist_object_new_ex(class_type, NULL, 0 TSRMLS_CC); + return spl_dllist_object_new_ex(class_type, NULL, 0); } /* }}} */ -static zend_object *spl_dllist_object_clone(zval *zobject TSRMLS_DC) /* {{{ */ +static zend_object *spl_dllist_object_clone(zval *zobject) /* {{{ */ { zend_object *old_object; zend_object *new_object; old_object = Z_OBJ_P(zobject); - new_object = spl_dllist_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC); + new_object = spl_dllist_object_new_ex(old_object->ce, zobject, 1); - zend_objects_clone_members(new_object, old_object TSRMLS_CC); + zend_objects_clone_members(new_object, old_object); return new_object; } /* }}} */ -static int spl_dllist_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */ +static int spl_dllist_object_count_elements(zval *object, zend_long *count) /* {{{ */ { spl_dllist_object *intern = Z_SPLDLLIST_P(object); @@ -493,7 +493,7 @@ static int spl_dllist_object_count_elements(zval *object, zend_long *count TSRML } /* }}} */ -static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{{ */ +static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp) /* {{{{ */ { spl_dllist_object *intern = Z_SPLDLLIST_P(obj); spl_ptr_llist_element *current = intern->llist->head, *next; @@ -515,7 +515,7 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRML } zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref); - pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1); ZVAL_LONG(&tmp, intern->flags); zend_hash_add(intern->debug_info, pnstr, &tmp); zend_string_release(pnstr); @@ -534,7 +534,7 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRML current = next; } - pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "dllist", sizeof("dllist")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "dllist", sizeof("dllist")-1); zend_hash_add(intern->debug_info, pnstr, &dllist_array); zend_string_release(pnstr); } @@ -550,12 +550,12 @@ SPL_METHOD(SplDoublyLinkedList, push) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); - spl_ptr_llist_push(intern->llist, value TSRMLS_CC); + spl_ptr_llist_push(intern->llist, value); RETURN_TRUE; } @@ -568,12 +568,12 @@ SPL_METHOD(SplDoublyLinkedList, unshift) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); - spl_ptr_llist_unshift(intern->llist, value TSRMLS_CC); + spl_ptr_llist_unshift(intern->llist, value); RETURN_TRUE; } @@ -590,10 +590,10 @@ SPL_METHOD(SplDoublyLinkedList, pop) } intern = Z_SPLDLLIST_P(getThis()); - spl_ptr_llist_pop(intern->llist, return_value TSRMLS_CC); + spl_ptr_llist_pop(intern->llist, return_value); if (Z_ISUNDEF_P(return_value)) { - zend_throw_exception(spl_ce_RuntimeException, "Can't pop from an empty datastructure", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't pop from an empty datastructure", 0); RETURN_NULL(); } } @@ -610,10 +610,10 @@ SPL_METHOD(SplDoublyLinkedList, shift) } intern = Z_SPLDLLIST_P(getThis()); - spl_ptr_llist_shift(intern->llist, return_value TSRMLS_CC); + spl_ptr_llist_shift(intern->llist, return_value); if (Z_ISUNDEF_P(return_value)) { - zend_throw_exception(spl_ce_RuntimeException, "Can't shift from an empty datastructure", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't shift from an empty datastructure", 0); RETURN_NULL(); } } @@ -634,7 +634,7 @@ SPL_METHOD(SplDoublyLinkedList, top) value = spl_ptr_llist_last(intern->llist); if (value == NULL || Z_ISUNDEF_P(value)) { - zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0); return; } @@ -657,7 +657,7 @@ SPL_METHOD(SplDoublyLinkedList, bottom) value = spl_ptr_llist_first(intern->llist); if (value == NULL || Z_ISUNDEF_P(value)) { - zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0); return; } @@ -691,7 +691,7 @@ SPL_METHOD(SplDoublyLinkedList, isEmpty) return; } - spl_dllist_object_count_elements(getThis(), &count TSRMLS_CC); + spl_dllist_object_count_elements(getThis(), &count); RETURN_BOOL(count == 0); } /* }}} */ @@ -703,7 +703,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode) zend_long value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) { return; } @@ -711,7 +711,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode) if (intern->flags & SPL_DLLIST_IT_FIX && (intern->flags & SPL_DLLIST_IT_LIFO) != (value & SPL_DLLIST_IT_LIFO)) { - zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0); return; } @@ -745,12 +745,12 @@ SPL_METHOD(SplDoublyLinkedList, offsetExists) spl_dllist_object *intern; zend_long index; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); - index = spl_offset_convert_to_long(zindex TSRMLS_CC); + index = spl_offset_convert_to_long(zindex); RETURN_BOOL(index >= 0 && index < intern->llist->count); } /* }}} */ @@ -764,15 +764,15 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet) spl_dllist_object *intern; spl_ptr_llist_element *element; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); - index = spl_offset_convert_to_long(zindex TSRMLS_CC); + index = spl_offset_convert_to_long(zindex); if (index < 0 || index >= intern->llist->count) { - zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0); return; } @@ -781,7 +781,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet) if (element != NULL) { RETURN_ZVAL(&element->data, 1, 0); } else { - zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0); return; } } /* }}} */ @@ -793,7 +793,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet) zval *zindex, *value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) { return; } @@ -801,17 +801,17 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet) if (Z_TYPE_P(zindex) == IS_NULL) { /* $obj[] = ... */ - spl_ptr_llist_push(intern->llist, value TSRMLS_CC); + spl_ptr_llist_push(intern->llist, value); } else { /* $obj[$foo] = ... */ zend_long index; spl_ptr_llist_element *element; - index = spl_offset_convert_to_long(zindex TSRMLS_CC); + index = spl_offset_convert_to_long(zindex); if (index < 0 || index >= intern->llist->count) { zval_ptr_dtor(value); - zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0); return; } @@ -820,7 +820,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet) if (element != NULL) { /* call dtor on the old element as in spl_ptr_llist_pop */ if (intern->llist->dtor) { - intern->llist->dtor(element TSRMLS_CC); + intern->llist->dtor(element); } /* the element is replaced, delref the old one as in @@ -830,11 +830,11 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet) /* new element, call ctor as in spl_ptr_llist_push */ if (intern->llist->ctor) { - intern->llist->ctor(element TSRMLS_CC); + intern->llist->ctor(element); } } else { zval_ptr_dtor(value); - zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0); return; } } @@ -850,16 +850,16 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset) spl_ptr_llist_element *element; spl_ptr_llist *llist; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); - index = spl_offset_convert_to_long(zindex TSRMLS_CC); + index = spl_offset_convert_to_long(zindex); llist = intern->llist; if (index < 0 || index >= intern->llist->count) { - zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of range", 0); return; } @@ -888,7 +888,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset) llist->count--; if(llist->dtor) { - llist->dtor(element TSRMLS_CC); + llist->dtor(element); } if (intern->traverse_pointer == element) { @@ -900,23 +900,23 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset) SPL_LLIST_DELREF(element); } else { - zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0); return; } } /* }}} */ -static void spl_dllist_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_dllist_it_dtor(zend_object_iterator *iter) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; SPL_LLIST_CHECK_DELREF(iterator->traverse_pointer); - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); zval_ptr_dtor(&iterator->intern.it.data); } /* }}} */ -static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */ +static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{ */ { SPL_LLIST_CHECK_DELREF(*traverse_pointer_ptr); @@ -932,7 +932,7 @@ static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer } /* }}} */ -static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */ +static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{ */ { if (*traverse_pointer_ptr) { spl_ptr_llist_element *old = *traverse_pointer_ptr; @@ -943,7 +943,7 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p if (flags & SPL_DLLIST_IT_DELETE) { zval prev; - spl_ptr_llist_pop(llist, &prev TSRMLS_CC); + spl_ptr_llist_pop(llist, &prev); zval_ptr_dtor(&prev); } @@ -952,7 +952,7 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p if (flags & SPL_DLLIST_IT_DELETE) { zval prev; - spl_ptr_llist_shift(llist, &prev TSRMLS_CC); + spl_ptr_llist_shift(llist, &prev); zval_ptr_dtor(&prev); } else { @@ -966,17 +966,17 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p } /* }}} */ -static void spl_dllist_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_dllist_it_rewind(zend_object_iterator *iter) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; spl_dllist_object *object = Z_SPLDLLIST_P(&iter->data); spl_ptr_llist *llist = object->llist; - spl_dllist_it_helper_rewind(&iterator->traverse_pointer, &iterator->traverse_position, llist, object->flags TSRMLS_CC); + spl_dllist_it_helper_rewind(&iterator->traverse_pointer, &iterator->traverse_position, llist, object->flags); } /* }}} */ -static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static int spl_dllist_it_valid(zend_object_iterator *iter) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; spl_ptr_llist_element *element = iterator->traverse_pointer; @@ -985,7 +985,7 @@ static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ } /* }}} */ -static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; spl_ptr_llist_element *element = iterator->traverse_pointer; @@ -998,7 +998,7 @@ static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter TSRMLS_DC } /* }}} */ -static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */ +static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; @@ -1006,14 +1006,14 @@ static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key } /* }}} */ -static void spl_dllist_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_dllist_it_move_forward(zend_object_iterator *iter) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; spl_dllist_object *object = Z_SPLDLLIST_P(&iter->data); - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); - spl_dllist_it_helper_move_forward(&iterator->traverse_pointer, &iterator->traverse_position, object->llist, object->flags TSRMLS_CC); + spl_dllist_it_helper_move_forward(&iterator->traverse_pointer, &iterator->traverse_position, object->llist, object->flags); } /* }}} */ @@ -1041,7 +1041,7 @@ SPL_METHOD(SplDoublyLinkedList, prev) return; } - spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ SPL_DLLIST_IT_LIFO TSRMLS_CC); + spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ SPL_DLLIST_IT_LIFO); } /* }}} */ @@ -1055,7 +1055,7 @@ SPL_METHOD(SplDoublyLinkedList, next) return; } - spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags TSRMLS_CC); + spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags); } /* }}} */ @@ -1083,7 +1083,7 @@ SPL_METHOD(SplDoublyLinkedList, rewind) return; } - spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags TSRMLS_CC); + spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags); } /* }}} */ @@ -1124,7 +1124,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize) /* flags */ ZVAL_LONG(&flags, intern->flags); - php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &flags, &var_hash); zval_ptr_dtor(&flags); /* elements */ @@ -1132,7 +1132,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize) smart_str_appendc(&buf, ':'); next = current->next; - php_var_serialize(&buf, ¤t->data, &var_hash TSRMLS_CC); + php_var_serialize(&buf, ¤t->data, &var_hash); current = next; } @@ -1161,7 +1161,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize) const unsigned char *p, *s; php_unserialize_data_t var_hash; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) { return; } @@ -1173,7 +1173,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize) PHP_VAR_UNSERIALIZE_INIT(var_hash); /* flags */ - if (!php_var_unserialize(&flags, &p, s + buf_len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&flags, &p, s + buf_len, &var_hash)) { goto error; } @@ -1188,11 +1188,11 @@ SPL_METHOD(SplDoublyLinkedList, unserialize) /* elements */ while(*p == ':') { ++p; - if (!php_var_unserialize(&elem, &p, s + buf_len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&elem, &p, s + buf_len, &var_hash)) { goto error; } - spl_ptr_llist_push(intern->llist, &elem TSRMLS_CC); + spl_ptr_llist_push(intern->llist, &elem); zval_ptr_dtor(&elem); } @@ -1205,7 +1205,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize) error: PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len); return; } /* }}} */ @@ -1219,15 +1219,15 @@ SPL_METHOD(SplDoublyLinkedList, add) spl_ptr_llist_element *element; zend_long index; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); - index = spl_offset_convert_to_long(zindex TSRMLS_CC); + index = spl_offset_convert_to_long(zindex); if (index < 0 || index > intern->llist->count) { - zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0); return; } @@ -1236,7 +1236,7 @@ SPL_METHOD(SplDoublyLinkedList, add) } if (index == intern->llist->count) { /* If index is the last entry+1 then we do a push because we're not inserting before any entry */ - spl_ptr_llist_push(intern->llist, value TSRMLS_CC); + spl_ptr_llist_push(intern->llist, value); } else { /* Create the new element we want to insert */ spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); @@ -1261,7 +1261,7 @@ SPL_METHOD(SplDoublyLinkedList, add) intern->llist->count++; if (intern->llist->ctor) { - intern->llist->ctor(elem TSRMLS_CC); + intern->llist->ctor(elem); } } } /* }}} */ @@ -1276,19 +1276,19 @@ zend_object_iterator_funcs spl_dllist_it_funcs = { spl_dllist_it_rewind }; /* }}} */ -zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ +zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ { spl_dllist_it *iterator; spl_dllist_object *dllist_object = Z_SPLDLLIST_P(object); if (by_ref) { - zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0); return NULL; } iterator = emalloc(sizeof(spl_dllist_it)); - zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC); + zend_iterator_init((zend_object_iterator*)iterator); ZVAL_COPY(&iterator->intern.it.data, object); iterator->intern.it.funcs = &spl_dllist_it_funcs; diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c index 1e51484394..753ea2cd91 100644 --- a/ext/spl/spl_engine.c +++ b/ext/spl/spl_engine.c @@ -32,7 +32,7 @@ #include "spl_array.h" /* {{{ spl_instantiate */ -PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) +PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object) { object_init_ex(object, pce); Z_SET_REFCOUNT_P(object, 1); @@ -40,7 +40,7 @@ PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) } /* }}} */ -PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */ +PHPAPI zend_long spl_offset_convert_to_long(zval *offset) /* {{{ */ { zend_ulong idx; diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index 8fa5539ba5..5666033d75 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -25,41 +25,41 @@ #include "php_spl.h" #include "zend_interfaces.h" -PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC); +PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object); -PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC); +PHPAPI zend_long spl_offset_convert_to_long(zval *offset); /* {{{ spl_instantiate_arg_ex1 */ -static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1 TSRMLS_DC) +static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1) { zend_function *func = pce->constructor; - spl_instantiate(pce, retval TSRMLS_CC); + spl_instantiate(pce, retval); - zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 1, arg1, NULL TSRMLS_CC); + zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 1, arg1, NULL); return 0; } /* }}} */ /* {{{ spl_instantiate_arg_ex2 */ -static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2 TSRMLS_DC) +static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2) { zend_function *func = pce->constructor; - spl_instantiate(pce, retval TSRMLS_CC); + spl_instantiate(pce, retval); - zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 2, arg1, arg2 TSRMLS_CC); + zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 2, arg1, arg2); return 0; } /* }}} */ /* {{{ spl_instantiate_arg_n */ -static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv TSRMLS_DC) +static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv) { zend_function *func = pce->constructor; zend_fcall_info fci; zend_fcall_info_cache fcc; zval dummy; - spl_instantiate(pce, retval TSRMLS_CC); + spl_instantiate(pce, retval); fci.size = sizeof(zend_fcall_info); fci.function_table = &pce->function_table; @@ -77,7 +77,7 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in fcc.called_scope = pce; fcc.object = Z_OBJ_P(retval); - zend_call_function(&fci, &fcc TSRMLS_CC); + zend_call_function(&fci, &fcc); } /* }}} */ diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c index 3c6b724b5c..e0cc164c13 100644 --- a/ext/spl/spl_exceptions.c +++ b/ext/spl/spl_exceptions.c @@ -47,7 +47,7 @@ PHPAPI zend_class_entry *spl_ce_RangeException; PHPAPI zend_class_entry *spl_ce_UnderflowException; PHPAPI zend_class_entry *spl_ce_UnexpectedValueException; -#define spl_ce_Exception zend_exception_get_default(TSRMLS_C) +#define spl_ce_Exception zend_exception_get_default() /* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */ PHP_MINIT_FUNCTION(spl_exceptions) diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index d63ac2e6e6..d2105fb0fa 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -81,7 +81,7 @@ static inline spl_fixedarray_object *spl_fixed_array_from_obj(zend_object *obj) #define Z_SPLFIXEDARRAY_P(zv) spl_fixed_array_from_obj(Z_OBJ_P((zv))) -static void spl_fixedarray_init(spl_fixedarray *array, zend_long size TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_init(spl_fixedarray *array, zend_long size) /* {{{ */ { if (size > 0) { array->size = 0; /* reset size in case ecalloc() fails */ @@ -94,7 +94,7 @@ static void spl_fixedarray_init(spl_fixedarray *array, zend_long size TSRMLS_DC) } /* }}} */ -static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size) /* {{{ */ { if (size == array->size) { /* nothing to do */ @@ -103,7 +103,7 @@ static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_D /* first initialization */ if (array->size == 0) { - spl_fixedarray_init(array, size TSRMLS_CC); + spl_fixedarray_init(array, size); return; } @@ -135,7 +135,7 @@ static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_D } /* }}} */ -static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from) /* {{{ */ { int i; for (i = 0; i < from->size; i++) { @@ -144,10 +144,10 @@ static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from TSRMLS_ } /* }}} */ -static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{{ */ +static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n) /* {{{{ */ { spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj); - HashTable *ht = zend_std_get_properties(obj TSRMLS_CC); + HashTable *ht = zend_std_get_properties(obj); if (intern->array) { *table = intern->array->elements; @@ -161,10 +161,10 @@ static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n T } /* }}}} */ -static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {{{{ */ +static HashTable* spl_fixedarray_object_get_properties(zval *obj) /* {{{{ */ { spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj); - HashTable *ht = zend_std_get_properties(obj TSRMLS_CC); + HashTable *ht = zend_std_get_properties(obj); zend_long i = 0; if (intern->array) { @@ -191,7 +191,7 @@ static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* { } /* }}}} */ -static void spl_fixedarray_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_object_free_storage(zend_object *object) /* {{{ */ { spl_fixedarray_object *intern = spl_fixed_array_from_obj(object); zend_long i; @@ -207,14 +207,14 @@ static void spl_fixedarray_object_free_storage(zend_object *object TSRMLS_DC) /* efree(intern->array); } - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); zval_ptr_dtor(&intern->retval); } /* }}} */ -zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); +zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref); -static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */ +static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */ { spl_fixedarray_object *intern; zend_class_entry *parent = class_type; @@ -222,7 +222,7 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z intern = ecalloc(1, sizeof(spl_fixedarray_object) + (sizeof(zval) * parent->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); intern->current = 0; @@ -233,11 +233,11 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z intern->ce_get_iterator = other->ce_get_iterator; if (!other->array) { /* leave a empty object, will be dtor later by CLONE handler */ - zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0); } else { intern->array = emalloc(sizeof(spl_fixedarray)); - spl_fixedarray_init(intern->array, other->array->size TSRMLS_CC); - spl_fixedarray_copy(intern->array, other->array TSRMLS_CC); + spl_fixedarray_init(intern->array, other->array->size); + spl_fixedarray_copy(intern->array, other->array); } } @@ -253,7 +253,7 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z } if (!parent) { /* this must never happen */ - php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplFixedArray"); + php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplFixedArray"); } if (!class_type->iterator_funcs.zf_current) { @@ -306,45 +306,45 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z } /* }}} */ -static zend_object *spl_fixedarray_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *spl_fixedarray_new(zend_class_entry *class_type) /* {{{ */ { - return spl_fixedarray_object_new_ex(class_type, NULL, 0 TSRMLS_CC); + return spl_fixedarray_object_new_ex(class_type, NULL, 0); } /* }}} */ -static zend_object *spl_fixedarray_object_clone(zval *zobject TSRMLS_DC) /* {{{ */ +static zend_object *spl_fixedarray_object_clone(zval *zobject) /* {{{ */ { zend_object *old_object; zend_object *new_object; old_object = Z_OBJ_P(zobject); - new_object = spl_fixedarray_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC); + new_object = spl_fixedarray_object_new_ex(old_object->ce, zobject, 1); - zend_objects_clone_members(new_object, old_object TSRMLS_CC); + zend_objects_clone_members(new_object, old_object); return new_object; } /* }}} */ -static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset TSRMLS_DC) /* {{{ */ +static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */ { zend_long index; /* we have to return NULL on error here to avoid memleak because of * ZE duplicating uninitialized_zval_ptr */ if (!offset) { - zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0); return NULL; } if (Z_TYPE_P(offset) != IS_LONG) { - index = spl_offset_convert_to_long(offset TSRMLS_CC); + index = spl_offset_convert_to_long(offset); } else { index = Z_LVAL_P(offset); } if (index < 0 || intern->array == NULL || index >= intern->array->size) { - zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0); return NULL; } else if (Z_ISUNDEF(intern->array->elements[index])) { return NULL; @@ -354,7 +354,7 @@ static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_o } /* }}} */ -static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */ +static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */ { spl_fixedarray_object *intern; @@ -378,28 +378,28 @@ static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, in return &EG(uninitialized_zval); } - return spl_fixedarray_object_read_dimension_helper(intern, offset TSRMLS_CC); + return spl_fixedarray_object_read_dimension_helper(intern, offset); } /* }}} */ -static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value TSRMLS_DC) /* {{{ */ +static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value) /* {{{ */ { zend_long index; if (!offset) { /* '$array[] = value' syntax is not supported */ - zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0); return; } if (Z_TYPE_P(offset) != IS_LONG) { - index = spl_offset_convert_to_long(offset TSRMLS_CC); + index = spl_offset_convert_to_long(offset); } else { index = Z_LVAL_P(offset); } if (index < 0 || intern->array == NULL || index >= intern->array->size) { - zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0); return; } else { if (!Z_ISUNDEF(intern->array->elements[index])) { @@ -411,7 +411,7 @@ static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_o } /* }}} */ -static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */ { spl_fixedarray_object *intern; @@ -432,22 +432,22 @@ static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zv return; } - spl_fixedarray_object_write_dimension_helper(intern, offset, value TSRMLS_CC); + spl_fixedarray_object_write_dimension_helper(intern, offset, value); } /* }}} */ -static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset TSRMLS_DC) /* {{{ */ +static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */ { zend_long index; if (Z_TYPE_P(offset) != IS_LONG) { - index = spl_offset_convert_to_long(offset TSRMLS_CC); + index = spl_offset_convert_to_long(offset); } else { index = Z_LVAL_P(offset); } if (index < 0 || intern->array == NULL || index >= intern->array->size) { - zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0); return; } else { zval_ptr_dtor(&(intern->array->elements[index])); @@ -456,7 +456,7 @@ static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_o } /* }}} */ -static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset) /* {{{ */ { spl_fixedarray_object *intern; @@ -469,18 +469,18 @@ static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset TSR return; } - spl_fixedarray_object_unset_dimension_helper(intern, offset TSRMLS_CC); + spl_fixedarray_object_unset_dimension_helper(intern, offset); } /* }}} */ -static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ +static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty) /* {{{ */ { zend_long index; int retval; if (Z_TYPE_P(offset) != IS_LONG) { - index = spl_offset_convert_to_long(offset TSRMLS_CC); + index = spl_offset_convert_to_long(offset); } else { index = Z_LVAL_P(offset); } @@ -491,7 +491,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje if (Z_ISUNDEF(intern->array->elements[index])) { retval = 0; } else if (check_empty) { - if (zend_is_true(&intern->array->elements[index] TSRMLS_CC)) { + if (zend_is_true(&intern->array->elements[index])) { retval = 1; } else { retval = 0; @@ -505,7 +505,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje } /* }}} */ -static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ +static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */ { spl_fixedarray_object *intern; @@ -519,16 +519,16 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c if (!Z_ISUNDEF(rv)) { zval_ptr_dtor(&intern->retval); ZVAL_ZVAL(&intern->retval, &rv, 0, 0); - return zend_is_true(&intern->retval TSRMLS_CC); + return zend_is_true(&intern->retval); } return 0; } - return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty TSRMLS_CC); + return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty); } /* }}} */ -static int spl_fixedarray_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */ +static int spl_fixedarray_object_count_elements(zval *object, zend_long *count) /* {{{ */ { spl_fixedarray_object *intern; @@ -561,12 +561,12 @@ SPL_METHOD(SplFixedArray, __construct) spl_fixedarray_object *intern; zend_long size = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &size) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &size) == FAILURE) { return; } if (size < 0) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array size cannot be less than zero"); + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array size cannot be less than zero"); return; } @@ -578,7 +578,7 @@ SPL_METHOD(SplFixedArray, __construct) } intern->array = emalloc(sizeof(spl_fixedarray)); - spl_fixedarray_init(intern->array, size TSRMLS_CC); + spl_fixedarray_init(intern->array, size); } /* }}} */ @@ -587,7 +587,7 @@ SPL_METHOD(SplFixedArray, __construct) SPL_METHOD(SplFixedArray, __wakeup) { spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(getThis()); - HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC); + HashTable *intern_ht = zend_std_get_properties(getThis()); zval *data; if (zend_parse_parameters_none() == FAILURE) { @@ -599,7 +599,7 @@ SPL_METHOD(SplFixedArray, __wakeup) int size = zend_hash_num_elements(intern_ht); intern->array = emalloc(sizeof(spl_fixedarray)); - spl_fixedarray_init(intern->array, size TSRMLS_CC); + spl_fixedarray_init(intern->array, size); ZEND_HASH_FOREACH_VAL(intern_ht, data) { if (Z_REFCOUNTED_P(data)) { @@ -674,7 +674,7 @@ SPL_METHOD(SplFixedArray, fromArray) int num; zend_bool save_indexes = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &data, &save_indexes) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &data, &save_indexes) == FAILURE) { return; } @@ -690,7 +690,7 @@ SPL_METHOD(SplFixedArray, fromArray) ZEND_HASH_FOREACH_KEY(Z_ARRVAL_P(data), num_index, str_index) { if (str_index != NULL || (zend_long)num_index < 0) { efree(array); - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array must contain only positive integer keys"); + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array must contain only positive integer keys"); return; } @@ -702,10 +702,10 @@ SPL_METHOD(SplFixedArray, fromArray) tmp = max_index + 1; if (tmp <= 0) { efree(array); - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "integer overflow detected"); + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "integer overflow detected"); return; } - spl_fixedarray_init(array, tmp TSRMLS_CC); + spl_fixedarray_init(array, tmp); ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_index, str_index, element) { ZVAL_DEREF(element); @@ -716,7 +716,7 @@ SPL_METHOD(SplFixedArray, fromArray) zval *element; zend_long i = 0; - spl_fixedarray_init(array, num TSRMLS_CC); + spl_fixedarray_init(array, num); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(data), element) { ZVAL_DEREF(element); @@ -724,7 +724,7 @@ SPL_METHOD(SplFixedArray, fromArray) i++; } ZEND_HASH_FOREACH_END(); } else { - spl_fixedarray_init(array, 0 TSRMLS_CC); + spl_fixedarray_init(array, 0); } object_init_ex(return_value, spl_ce_SplFixedArray); @@ -761,12 +761,12 @@ SPL_METHOD(SplFixedArray, setSize) spl_fixedarray_object *intern; zend_long size; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) { return; } if (size < 0) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array size cannot be less than zero"); + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array size cannot be less than zero"); return; } @@ -775,7 +775,7 @@ SPL_METHOD(SplFixedArray, setSize) intern->array = ecalloc(1, sizeof(spl_fixedarray)); } - spl_fixedarray_resize(intern->array, size TSRMLS_CC); + spl_fixedarray_resize(intern->array, size); RETURN_TRUE; } /* }}} */ @@ -787,13 +787,13 @@ SPL_METHOD(SplFixedArray, offsetExists) zval *zindex; spl_fixedarray_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) { return; } intern = Z_SPLFIXEDARRAY_P(getThis()); - RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0 TSRMLS_CC)); + RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0)); } /* }}} */ /* {{{ proto mixed SplFixedArray::offsetGet(mixed $index) @@ -803,12 +803,12 @@ SPL_METHOD(SplFixedArray, offsetGet) zval *zindex, *value; spl_fixedarray_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) { return; } intern = Z_SPLFIXEDARRAY_P(getThis()); - value = spl_fixedarray_object_read_dimension_helper(intern, zindex TSRMLS_CC); + value = spl_fixedarray_object_read_dimension_helper(intern, zindex); if (value) { RETURN_ZVAL(value, 1, 0); @@ -823,12 +823,12 @@ SPL_METHOD(SplFixedArray, offsetSet) zval *zindex, *value; spl_fixedarray_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) { return; } intern = Z_SPLFIXEDARRAY_P(getThis()); - spl_fixedarray_object_write_dimension_helper(intern, zindex, value TSRMLS_CC); + spl_fixedarray_object_write_dimension_helper(intern, zindex, value); } /* }}} */ @@ -839,42 +839,42 @@ SPL_METHOD(SplFixedArray, offsetUnset) zval *zindex; spl_fixedarray_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) { return; } intern = Z_SPLFIXEDARRAY_P(getThis()); - spl_fixedarray_object_unset_dimension_helper(intern, zindex TSRMLS_CC); + spl_fixedarray_object_unset_dimension_helper(intern, zindex); } /* }}} */ -static void spl_fixedarray_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_it_dtor(zend_object_iterator *iter) /* {{{ */ { spl_fixedarray_it *iterator = (spl_fixedarray_it *)iter; - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); zval_ptr_dtor(&iterator->intern.it.data); } /* }}} */ -static void spl_fixedarray_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_it_rewind(zend_object_iterator *iter) /* {{{ */ { spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); if (object->flags & SPL_FIXEDARRAY_OVERLOADED_REWIND) { - zend_user_it_rewind(iter TSRMLS_CC); + zend_user_it_rewind(iter); } else { object->current = 0; } } /* }}} */ -static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static int spl_fixedarray_it_valid(zend_object_iterator *iter) /* {{{ */ { spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); if (object->flags & SPL_FIXEDARRAY_OVERLOADED_VALID) { - return zend_user_it_valid(iter TSRMLS_CC); + return zend_user_it_valid(iter); } if (object->current >= 0 && object->array && object->current < object->array->size) { @@ -885,19 +885,19 @@ static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ } /* }}} */ -static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter) /* {{{ */ { zval zindex; spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); if (object->flags & SPL_FIXEDARRAY_OVERLOADED_CURRENT) { - return zend_user_it_get_current_data(iter TSRMLS_CC); + return zend_user_it_get_current_data(iter); } else { zval *data; ZVAL_LONG(&zindex, object->current); - data = spl_fixedarray_object_read_dimension_helper(object, &zindex TSRMLS_CC); + data = spl_fixedarray_object_read_dimension_helper(object, &zindex); zval_ptr_dtor(&zindex); if (data == NULL) { @@ -908,26 +908,26 @@ static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRML } /* }}} */ -static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */ { spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); if (object->flags & SPL_FIXEDARRAY_OVERLOADED_KEY) { - zend_user_it_get_current_key(iter, key TSRMLS_CC); + zend_user_it_get_current_key(iter, key); } else { ZVAL_LONG(key, object->current); } } /* }}} */ -static void spl_fixedarray_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_fixedarray_it_move_forward(zend_object_iterator *iter) /* {{{ */ { spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); if (object->flags & SPL_FIXEDARRAY_OVERLOADED_NEXT) { - zend_user_it_move_forward(iter TSRMLS_CC); + zend_user_it_move_forward(iter); } else { - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); object->current++; } } @@ -1002,7 +1002,7 @@ SPL_METHOD(SplFixedArray, current) ZVAL_LONG(&zindex, intern->current); - value = spl_fixedarray_object_read_dimension_helper(intern, &zindex TSRMLS_CC); + value = spl_fixedarray_object_read_dimension_helper(intern, &zindex); zval_ptr_dtor(&zindex); @@ -1023,18 +1023,18 @@ zend_object_iterator_funcs spl_fixedarray_it_funcs = { spl_fixedarray_it_rewind }; -zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ +zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ { spl_fixedarray_it *iterator; if (by_ref) { - zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0); return NULL; } iterator = emalloc(sizeof(spl_fixedarray_it)); - zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC); + zend_iterator_init((zend_object_iterator*)iterator); ZVAL_COPY(&iterator->intern.it.data, object); iterator->intern.it.funcs = &spl_fixedarray_it_funcs; diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c index f409927271..c9b9642c6e 100644 --- a/ext/spl/spl_functions.c +++ b/ext/spl/spl_functions.c @@ -28,22 +28,22 @@ #include "php_spl.h" /* {{{ spl_register_interface */ -void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry * functions TSRMLS_DC) +void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry * functions) { zend_class_entry ce; INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), functions); - *ppce = zend_register_internal_interface(&ce TSRMLS_CC); + *ppce = zend_register_internal_interface(&ce); } /* }}} */ /* {{{ spl_register_std_class */ -PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void * obj_ctor, const zend_function_entry * function_list TSRMLS_DC) +PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void * obj_ctor, const zend_function_entry * function_list) { zend_class_entry ce; INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), function_list); - *ppce = zend_register_internal_class(&ce TSRMLS_CC); + *ppce = zend_register_internal_class(&ce); /* entries changed by initialize */ if (obj_ctor) { @@ -53,12 +53,12 @@ PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name, /* }}} */ /* {{{ spl_register_sub_class */ -PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, void *obj_ctor, const zend_function_entry * function_list TSRMLS_DC) +PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, void *obj_ctor, const zend_function_entry * function_list) { zend_class_entry ce; INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), function_list); - *ppce = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC); + *ppce = zend_register_internal_class_ex(&ce, parent_ce); /* entries changed by initialize */ if (obj_ctor) { @@ -70,14 +70,14 @@ PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * /* }}} */ /* {{{ spl_register_property */ -void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC) +void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags) { - zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags TSRMLS_CC); + zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags); } /* }}} */ /* {{{ spl_add_class_name */ -void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags TSRMLS_DC) +void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags) { if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) { zval *tmp; @@ -92,47 +92,47 @@ void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_fla /* }}} */ /* {{{ spl_add_interfaces */ -void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC) +void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags) { uint32_t num_interfaces; for (num_interfaces = 0; num_interfaces < pce->num_interfaces; num_interfaces++) { - spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags TSRMLS_CC); + spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags); } } /* }}} */ /* {{{ spl_add_traits */ -void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC) +void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags) { uint32_t num_traits; for (num_traits = 0; num_traits < pce->num_traits; num_traits++) { - spl_add_class_name(list, pce->traits[num_traits], allow, ce_flags TSRMLS_CC); + spl_add_class_name(list, pce->traits[num_traits], allow, ce_flags); } } /* }}} */ /* {{{ spl_add_classes */ -int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC) +int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags) { if (!pce) { return 0; } - spl_add_class_name(list, pce, allow, ce_flags TSRMLS_CC); + spl_add_class_name(list, pce, allow, ce_flags); if (sub) { - spl_add_interfaces(list, pce, allow, ce_flags TSRMLS_CC); + spl_add_interfaces(list, pce, allow, ce_flags); while (pce->parent) { pce = pce->parent; - spl_add_classes(pce, list, sub, allow, ce_flags TSRMLS_CC); + spl_add_classes(pce, list, sub, allow, ce_flags); } } return 0; } /* }}} */ -zend_string * spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len TSRMLS_DC) /* {{{ */ +zend_string * spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len) /* {{{ */ { return zend_mangle_property_name(ce->name->val, ce->name->len, prop_name, prop_len, 0); } diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h index 3381975e6c..942aed27e2 100644 --- a/ext/spl/spl_functions.h +++ b/ext/spl/spl_functions.h @@ -23,50 +23,50 @@ #include "php.h" -typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type TSRMLS_DC); +typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type); #define REGISTER_SPL_STD_CLASS(class_name, obj_ctor) \ - spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, NULL TSRMLS_CC); + spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, NULL); #define REGISTER_SPL_STD_CLASS_EX(class_name, obj_ctor, funcs) \ - spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, funcs TSRMLS_CC); + spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, funcs); #define REGISTER_SPL_SUB_CLASS_EX(class_name, parent_class_name, obj_ctor, funcs) \ - spl_register_sub_class(&spl_ce_ ## class_name, spl_ce_ ## parent_class_name, # class_name, obj_ctor, funcs TSRMLS_CC); + spl_register_sub_class(&spl_ce_ ## class_name, spl_ce_ ## parent_class_name, # class_name, obj_ctor, funcs); #define REGISTER_SPL_INTERFACE(class_name) \ - spl_register_interface(&spl_ce_ ## class_name, # class_name, spl_funcs_ ## class_name TSRMLS_CC); + spl_register_interface(&spl_ce_ ## class_name, # class_name, spl_funcs_ ## class_name); #define REGISTER_SPL_IMPLEMENTS(class_name, interface_name) \ - zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, spl_ce_ ## interface_name); + zend_class_implements(spl_ce_ ## class_name, 1, spl_ce_ ## interface_name); #define REGISTER_SPL_ITERATOR(class_name) \ - zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, zend_ce_iterator); + zend_class_implements(spl_ce_ ## class_name, 1, zend_ce_iterator); #define REGISTER_SPL_PROPERTY(class_name, prop_name, prop_flags) \ - spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags TSRMLS_CC); + spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags); #define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \ - zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC); + zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value); -void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list TSRMLS_DC); -void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list TSRMLS_DC); -void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry *functions TSRMLS_DC); +void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list); +void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list); +void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry *functions); -void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC); +void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags); /* sub: whether to allow subclasses/interfaces allow = 0: allow all classes and interfaces allow > 0: allow all that match and mask ce_flags allow < 0: disallow all that match and mask ce_flags */ -void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC); -void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC); -void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC); -int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC); +void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags); +void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags); +void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags); +int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags); /* caller must efree(return) */ -zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len TSRMLS_DC); +zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len); #define SPL_ME(class_name, function_name, arg_info, flags) \ PHP_ME( spl_ ## class_name, function_name, arg_info, flags) diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index b421c03757..c13cd2f298 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -50,9 +50,9 @@ PHPAPI zend_class_entry *spl_ce_SplMinHeap; PHPAPI zend_class_entry *spl_ce_SplPriorityQueue; -typedef void (*spl_ptr_heap_dtor_func)(zval * TSRMLS_DC); -typedef void (*spl_ptr_heap_ctor_func)(zval * TSRMLS_DC); -typedef int (*spl_ptr_heap_cmp_func)(zval *, zval *, zval * TSRMLS_DC); +typedef void (*spl_ptr_heap_dtor_func)(zval *); +typedef void (*spl_ptr_heap_ctor_func)(zval *); +typedef int (*spl_ptr_heap_cmp_func)(zval *, zval *, zval *); typedef struct _spl_ptr_heap { zval *elements; @@ -91,21 +91,21 @@ static inline spl_heap_object *spl_heap_from_obj(zend_object *obj) /* {{{ */ { #define Z_SPLHEAP_P(zv) spl_heap_from_obj(Z_OBJ_P((zv))) -static void spl_ptr_heap_zval_dtor(zval *elem TSRMLS_DC) { /* {{{ */ +static void spl_ptr_heap_zval_dtor(zval *elem) { /* {{{ */ if (!Z_ISUNDEF_P(elem)) { zval_ptr_dtor(elem); } } /* }}} */ -static void spl_ptr_heap_zval_ctor(zval *elem TSRMLS_DC) { /* {{{ */ +static void spl_ptr_heap_zval_ctor(zval *elem) { /* {{{ */ if (Z_REFCOUNTED_P(elem)) { Z_ADDREF_P(elem); } } /* }}} */ -static int spl_ptr_heap_cmp_cb_helper(zval *object, spl_heap_object *heap_object, zval *a, zval *b, zend_long *result TSRMLS_DC) { /* {{{ */ +static int spl_ptr_heap_cmp_cb_helper(zval *object, spl_heap_object *heap_object, zval *a, zval *b, zend_long *result) { /* {{{ */ zval zresult; zend_call_method_with_2_params(object, heap_object->std.ce, &heap_object->fptr_cmp, "compare", &zresult, a, b); @@ -145,7 +145,7 @@ static zval *spl_pqueue_extract_helper(zval *value, int flags) /* {{{ */ } /* }}} */ -static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */ +static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object) { /* {{{ */ zval result; if (EG(exception)) { @@ -156,7 +156,7 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { spl_heap_object *heap_object = Z_SPLHEAP_P(object); if (heap_object->fptr_cmp) { zend_long lval = 0; - if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval TSRMLS_CC) == FAILURE) { + if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval) == FAILURE) { /* exception or call failure */ return 0; } @@ -164,12 +164,12 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { } } - compare_function(&result, a, b TSRMLS_CC); + compare_function(&result, a, b); return (int)Z_LVAL(result); } /* }}} */ -static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */ +static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object) { /* {{{ */ zval result; if (EG(exception)) { @@ -180,7 +180,7 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { spl_heap_object *heap_object = Z_SPLHEAP_P(object); if (heap_object->fptr_cmp) { zend_long lval = 0; - if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval TSRMLS_CC) == FAILURE) { + if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval) == FAILURE) { /* exception or call failure */ return 0; } @@ -188,12 +188,12 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { } } - compare_function(&result, b, a TSRMLS_CC); + compare_function(&result, b, a); return (int)Z_LVAL(result); } /* }}} */ -static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */ +static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object) { /* {{{ */ zval result; zval *a_priority_p = spl_pqueue_extract_helper(a, SPL_PQUEUE_EXTR_PRIORITY); zval *b_priority_p = spl_pqueue_extract_helper(b, SPL_PQUEUE_EXTR_PRIORITY); @@ -211,7 +211,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { / spl_heap_object *heap_object = Z_SPLHEAP_P(object); if (heap_object->fptr_cmp) { zend_long lval = 0; - if (spl_ptr_heap_cmp_cb_helper((zval *)object, heap_object, a_priority_p, b_priority_p, &lval TSRMLS_CC) == FAILURE) { + if (spl_ptr_heap_cmp_cb_helper((zval *)object, heap_object, a_priority_p, b_priority_p, &lval) == FAILURE) { /* exception or call failure */ return 0; } @@ -219,7 +219,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { / } } - compare_function(&result, a_priority_p, b_priority_p TSRMLS_CC); + compare_function(&result, a_priority_p, b_priority_p); return (int)Z_LVAL(result); } /* }}} */ @@ -240,7 +240,7 @@ static spl_ptr_heap *spl_ptr_heap_init(spl_ptr_heap_cmp_func cmp, spl_ptr_heap_c } /* }}} */ -static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */ +static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userdata) { /* {{{ */ int i; if (heap->count+1 > heap->max_size) { @@ -250,10 +250,10 @@ static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userda heap->max_size *= 2; } - heap->ctor(elem TSRMLS_CC); + heap->ctor(elem); /* sifting up */ - for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata TSRMLS_CC) < 0; i = (i-1)/2) { + for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata) < 0; i = (i-1)/2) { heap->elements[i] = heap->elements[(i-1)/2]; } @@ -275,7 +275,7 @@ static zval *spl_ptr_heap_top(spl_ptr_heap *heap) { /* {{{ */ } /* }}} */ -static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */ +static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_userdata) { /* {{{ */ int i, j; const int limit = (heap->count-1)/2; zval *bottom; @@ -291,12 +291,12 @@ static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_us for (i = 0; i < limit; i = j) { /* Find smaller child */ j = i * 2 + 1; - if(j != heap->count && heap->cmp(&heap->elements[j+1], &heap->elements[j], cmp_userdata TSRMLS_CC) > 0) { + if(j != heap->count && heap->cmp(&heap->elements[j+1], &heap->elements[j], cmp_userdata) > 0) { j++; /* next child is bigger */ } /* swap elements between two levels */ - if(heap->cmp(bottom, &heap->elements[j], cmp_userdata TSRMLS_CC) < 0) { + if(heap->cmp(bottom, &heap->elements[j], cmp_userdata) < 0) { heap->elements[i] = heap->elements[j]; } else { break; @@ -309,11 +309,11 @@ static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_us } ZVAL_COPY_VALUE(&heap->elements[i], bottom); - heap->dtor(elem TSRMLS_CC); + heap->dtor(elem); } /* }}} */ -static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from TSRMLS_DC) { /* {{{ */ +static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from) { /* {{{ */ int i; spl_ptr_heap *heap = emalloc(sizeof(spl_ptr_heap)); @@ -329,18 +329,18 @@ static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from TSRMLS_DC) { /* {{{ * memcpy(heap->elements, from->elements, sizeof(zval)*from->max_size); for (i=0; i < heap->count; ++i) { - heap->ctor(&heap->elements[i] TSRMLS_CC); + heap->ctor(&heap->elements[i]); } return heap; } /* }}} */ -static void spl_ptr_heap_destroy(spl_ptr_heap *heap TSRMLS_DC) { /* {{{ */ +static void spl_ptr_heap_destroy(spl_ptr_heap *heap) { /* {{{ */ int i; for (i=0; i < heap->count; ++i) { - heap->dtor(&heap->elements[i] TSRMLS_CC); + heap->dtor(&heap->elements[i]); } efree(heap->elements); @@ -354,14 +354,14 @@ static int spl_ptr_heap_count(spl_ptr_heap *heap) { /* {{{ */ /* }}} */ /* }}} */ -zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); +zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref); -static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ +static void spl_heap_object_free_storage(zend_object *object) /* {{{ */ { int i; spl_heap_object *intern = spl_heap_from_obj(object); - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); for (i = 0; i < intern->heap->count; ++i) { if (!Z_ISUNDEF(intern->heap->elements[i])) { @@ -369,7 +369,7 @@ static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ * } } - spl_ptr_heap_destroy(intern->heap TSRMLS_CC); + spl_ptr_heap_destroy(intern->heap); zval_ptr_dtor(&intern->retval); @@ -380,7 +380,7 @@ static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ * } /* }}} */ -static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */ +static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */ { spl_heap_object *intern; zend_class_entry *parent = class_type; @@ -388,7 +388,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o intern = ecalloc(1, sizeof(spl_heap_object) + sizeof(zval) * (parent->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); intern->flags = 0; @@ -401,7 +401,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o if (clone_orig) { int i; - intern->heap = spl_ptr_heap_clone(other->heap TSRMLS_CC); + intern->heap = spl_ptr_heap_clone(other->heap); for (i = 0; i < intern->heap->count; ++i) { if (Z_REFCOUNTED(intern->heap->elements[i])) { Z_ADDREF(intern->heap->elements[i]); @@ -445,7 +445,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o } if (!parent) { /* this must never happen */ - php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplHeap"); + php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplHeap"); } if (inherited) { @@ -463,27 +463,27 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o } /* }}} */ -static zend_object *spl_heap_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *spl_heap_object_new(zend_class_entry *class_type) /* {{{ */ { - return spl_heap_object_new_ex(class_type, NULL, 0 TSRMLS_CC); + return spl_heap_object_new_ex(class_type, NULL, 0); } /* }}} */ -static zend_object *spl_heap_object_clone(zval *zobject TSRMLS_DC) /* {{{ */ +static zend_object *spl_heap_object_clone(zval *zobject) /* {{{ */ { zend_object *old_object; zend_object *new_object; old_object = Z_OBJ_P(zobject); - new_object = spl_heap_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC); + new_object = spl_heap_object_new_ex(old_object->ce, zobject, 1); - zend_objects_clone_members(new_object, old_object TSRMLS_CC); + zend_objects_clone_members(new_object, old_object); return new_object; } /* }}} */ -static int spl_heap_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */ +static int spl_heap_object_count_elements(zval *object, zend_long *count) /* {{{ */ { spl_heap_object *intern = Z_SPLHEAP_P(object); @@ -507,7 +507,7 @@ static int spl_heap_object_count_elements(zval *object, zend_long *count TSRMLS_ } /* }}} */ -static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zval *obj, int *is_temp TSRMLS_DC) { /* {{{ */ +static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zval *obj, int *is_temp) { /* {{{ */ spl_heap_object *intern = Z_SPLHEAP_P(obj); zval tmp, heap_array; zend_string *pnstr; @@ -528,12 +528,12 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref); - pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1); ZVAL_LONG(&tmp, intern->flags); zend_hash_update(intern->debug_info, pnstr, &tmp); zend_string_release(pnstr); - pnstr = spl_gen_private_prop_name(ce, "isCorrupted", sizeof("isCorrupted")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(ce, "isCorrupted", sizeof("isCorrupted")-1); ZVAL_BOOL(&tmp, intern->heap->flags&SPL_HEAP_CORRUPTED); zend_hash_update(intern->debug_info, pnstr, &tmp); zend_string_release(pnstr); @@ -547,7 +547,7 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv } } - pnstr = spl_gen_private_prop_name(ce, "heap", sizeof("heap")-1 TSRMLS_CC); + pnstr = spl_gen_private_prop_name(ce, "heap", sizeof("heap")-1); zend_hash_update(intern->debug_info, pnstr, &heap_array); zend_string_release(pnstr); } @@ -556,15 +556,15 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv } /* }}} */ -static HashTable* spl_heap_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ +static HashTable* spl_heap_object_get_debug_info(zval *obj, int *is_temp) /* {{{ */ { - return spl_heap_object_get_debug_info_helper(spl_ce_SplHeap, obj, is_temp TSRMLS_CC); + return spl_heap_object_get_debug_info_helper(spl_ce_SplHeap, obj, is_temp); } /* }}} */ -static HashTable* spl_pqueue_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ +static HashTable* spl_pqueue_object_get_debug_info(zval *obj, int *is_temp) /* {{{ */ { - return spl_heap_object_get_debug_info_helper(spl_ce_SplPriorityQueue, obj, is_temp TSRMLS_CC); + return spl_heap_object_get_debug_info_helper(spl_ce_SplPriorityQueue, obj, is_temp); } /* }}} */ @@ -605,19 +605,19 @@ SPL_METHOD(SplHeap, insert) zval *value; spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } intern = Z_SPLHEAP_P(getThis()); if (intern->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return; } if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); - spl_ptr_heap_insert(intern->heap, value, getThis() TSRMLS_CC); + spl_ptr_heap_insert(intern->heap, value, getThis()); RETURN_TRUE; } @@ -637,14 +637,14 @@ SPL_METHOD(SplHeap, extract) intern = Z_SPLHEAP_P(getThis()); if (intern->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return; } - spl_ptr_heap_delete_top(intern->heap, &value, getThis() TSRMLS_CC); + spl_ptr_heap_delete_top(intern->heap, &value, getThis()); if (Z_ISUNDEF(value)) { - zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0); return; } @@ -659,14 +659,14 @@ SPL_METHOD(SplPriorityQueue, insert) zval *data, *priority, elem; spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &data, &priority) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &data, &priority) == FAILURE) { return; } intern = Z_SPLHEAP_P(getThis()); if (intern->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return; } @@ -677,7 +677,7 @@ SPL_METHOD(SplPriorityQueue, insert) add_assoc_zval_ex(&elem, "data", sizeof("data") - 1, data); add_assoc_zval_ex(&elem, "priority", sizeof("priority") - 1, priority); - spl_ptr_heap_insert(intern->heap, &elem, getThis() TSRMLS_CC); + spl_ptr_heap_insert(intern->heap, &elem, getThis()); RETURN_TRUE; } @@ -697,14 +697,14 @@ SPL_METHOD(SplPriorityQueue, extract) intern = Z_SPLHEAP_P(getThis()); if (intern->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return; } - spl_ptr_heap_delete_top(intern->heap, &value, getThis() TSRMLS_CC); + spl_ptr_heap_delete_top(intern->heap, &value, getThis()); if (Z_ISUNDEF(value)) { - zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0); return; } @@ -739,14 +739,14 @@ SPL_METHOD(SplPriorityQueue, top) intern = Z_SPLHEAP_P(getThis()); if (intern->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return; } value = spl_ptr_heap_top(intern->heap); if (!value) { - zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0); return; } @@ -769,7 +769,7 @@ SPL_METHOD(SplPriorityQueue, setExtractFlags) zend_long value; spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) { return; } @@ -837,11 +837,11 @@ SPL_METHOD(SplPriorityQueue, compare) { zval *a, *b; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) { return; } - RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL TSRMLS_CC)); + RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL)); } /* }}} */ @@ -859,14 +859,14 @@ SPL_METHOD(SplHeap, top) intern = Z_SPLHEAP_P(getThis()); if (intern->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return; } value = spl_ptr_heap_top(intern->heap); if (!value) { - zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0); return; } @@ -880,11 +880,11 @@ SPL_METHOD(SplMinHeap, compare) { zval *a, *b; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) { return; } - RETURN_LONG(spl_ptr_heap_zval_min_cmp(a, b, NULL TSRMLS_CC)); + RETURN_LONG(spl_ptr_heap_zval_min_cmp(a, b, NULL)); } /* }}} */ @@ -894,42 +894,42 @@ SPL_METHOD(SplMaxHeap, compare) { zval *a, *b; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) { return; } - RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL TSRMLS_CC)); + RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL)); } /* }}} */ -static void spl_heap_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_heap_it_dtor(zend_object_iterator *iter) /* {{{ */ { spl_heap_it *iterator = (spl_heap_it *)iter; - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); zval_ptr_dtor(&iterator->intern.it.data); } /* }}} */ -static void spl_heap_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_heap_it_rewind(zend_object_iterator *iter) /* {{{ */ { /* do nothing, the iterator always points to the top element */ } /* }}} */ -static int spl_heap_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static int spl_heap_it_valid(zend_object_iterator *iter) /* {{{ */ { return ((Z_SPLHEAP_P(&iter->data))->heap->count != 0 ? SUCCESS : FAILURE); } /* }}} */ -static zval *spl_heap_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static zval *spl_heap_it_get_current_data(zend_object_iterator *iter) /* {{{ */ { spl_heap_object *object = Z_SPLHEAP_P(&iter->data); zval *element = &object->heap->elements[0]; if (object->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return NULL; } @@ -941,13 +941,13 @@ static zval *spl_heap_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) } /* }}} */ -static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter) /* {{{ */ { spl_heap_object *object = Z_SPLHEAP_P(&iter->data); zval *element = &object->heap->elements[0]; if (object->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return NULL; } @@ -963,7 +963,7 @@ static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter TSRMLS_DC } /* }}} */ -static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */ +static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */ { spl_heap_object *object = Z_SPLHEAP_P(&iter->data); @@ -971,21 +971,21 @@ static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key TS } /* }}} */ -static void spl_heap_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +static void spl_heap_it_move_forward(zend_object_iterator *iter) /* {{{ */ { spl_heap_object *object = Z_SPLHEAP_P(&iter->data); zval elem; if (object->heap->flags & SPL_HEAP_CORRUPTED) { - zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0); return; } - spl_ptr_heap_delete_top(object->heap, &elem, &iter->data TSRMLS_CC); + spl_ptr_heap_delete_top(object->heap, &elem, &iter->data); zval_ptr_dtor(&elem); - zend_user_it_invalidate_current(iter TSRMLS_CC); + zend_user_it_invalidate_current(iter); } /* }}} */ @@ -1009,7 +1009,7 @@ SPL_METHOD(SplHeap, next) { spl_heap_object *intern = Z_SPLHEAP_P(getThis()); zval elem; - spl_ptr_heap_delete_top(intern->heap, &elem, getThis() TSRMLS_CC); + spl_ptr_heap_delete_top(intern->heap, &elem, getThis()); if (zend_parse_parameters_none() == FAILURE) { return; @@ -1108,19 +1108,19 @@ zend_object_iterator_funcs spl_pqueue_it_funcs = { spl_heap_it_rewind }; -zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ +zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ { spl_heap_it *iterator; spl_heap_object *heap_object = Z_SPLHEAP_P(object); if (by_ref) { - zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0); return NULL; } iterator = emalloc(sizeof(spl_heap_it)); - zend_iterator_init(&iterator->intern.it TSRMLS_CC); + zend_iterator_init(&iterator->intern.it); ZVAL_COPY(&iterator->intern.it.data, object); iterator->intern.it.funcs = &spl_heap_it_funcs; @@ -1132,19 +1132,19 @@ zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, } /* }}} */ -zend_object_iterator *spl_pqueue_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ +zend_object_iterator *spl_pqueue_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ { spl_heap_it *iterator; spl_heap_object *heap_object = Z_SPLHEAP_P(object); if (by_ref) { - zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0); return NULL; } iterator = emalloc(sizeof(spl_heap_it)); - zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC); + zend_iterator_init((zend_object_iterator*)iterator); ZVAL_COPY(&iterator->intern.it.data, object); iterator->intern.it.funcs = &spl_pqueue_it_funcs; diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index c129115eeb..02bdcf8e61 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -138,7 +138,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob do { \ spl_dual_it_object *it = Z_SPLDUAL_IT_P(objzval); \ if (it->dit_type == DIT_Unknown) { \ - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \ + zend_throw_exception_ex(spl_ce_LogicException, 0, \ "The object is in an invalid state as the parent constructor was not called"); \ return; \ } \ @@ -148,7 +148,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob #define SPL_FETCH_SUB_ELEMENT(var, object, element) \ do { \ if(!(object)->iterators) { \ - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \ + zend_throw_exception_ex(spl_ce_LogicException, 0, \ "The object is in an invalid state as the parent constructor was not called"); \ return; \ } \ @@ -158,7 +158,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob #define SPL_FETCH_SUB_ELEMENT_ADDR(var, object, element) \ do { \ if(!(object)->iterators) { \ - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \ + zend_throw_exception_ex(spl_ce_LogicException, 0, \ "The object is in an invalid state as the parent constructor was not called"); \ return; \ } \ @@ -168,7 +168,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob #define SPL_FETCH_SUB_ITERATOR(var, object) SPL_FETCH_SUB_ELEMENT(var, object, iterator) -static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC) +static void spl_recursive_it_dtor(zend_object_iterator *_iter) { spl_recursive_it_iterator *iter = (spl_recursive_it_iterator*)_iter; spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->intern.data); @@ -176,7 +176,7 @@ static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC) while (object->level > 0) { sub_iter = object->iterators[object->level].iterator; - zend_iterator_dtor(sub_iter TSRMLS_CC); + zend_iterator_dtor(sub_iter); zval_ptr_dtor(&object->iterators[object->level--].zobject); } object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator)); @@ -185,7 +185,7 @@ static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC) zval_ptr_dtor(&iter->intern.data); } -static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC) +static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis) { zend_object_iterator *sub_iter; int level = object->level; @@ -195,7 +195,7 @@ static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthi } while (level >=0) { sub_iter = object->iterators[level].iterator; - if (sub_iter->funcs->valid(sub_iter TSRMLS_CC) == SUCCESS) { + if (sub_iter->funcs->valid(sub_iter) == SUCCESS) { return SUCCESS; } level--; @@ -207,32 +207,32 @@ static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthi return FAILURE; } -static int spl_recursive_it_valid(zend_object_iterator *iter TSRMLS_DC) +static int spl_recursive_it_valid(zend_object_iterator *iter) { - return spl_recursive_it_valid_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC); + return spl_recursive_it_valid_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data); } -static zval *spl_recursive_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) +static zval *spl_recursive_it_get_current_data(zend_object_iterator *iter) { spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->data); zend_object_iterator *sub_iter = object->iterators[object->level].iterator; - return sub_iter->funcs->get_current_data(sub_iter TSRMLS_CC); + return sub_iter->funcs->get_current_data(sub_iter); } -static void spl_recursive_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) +static void spl_recursive_it_get_current_key(zend_object_iterator *iter, zval *key) { spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->data); zend_object_iterator *sub_iter = object->iterators[object->level].iterator; if (sub_iter->funcs->get_current_key) { - sub_iter->funcs->get_current_key(sub_iter, key TSRMLS_CC); + sub_iter->funcs->get_current_key(sub_iter, key); } else { ZVAL_LONG(key, iter->index); } } -static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC) +static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis) { zend_object_iterator *iterator; zval *zobject; @@ -248,17 +248,17 @@ next_step: iterator = object->iterators[object->level].iterator; switch (object->iterators[object->level].state) { case RS_NEXT: - iterator->funcs->move_forward(iterator TSRMLS_CC); + iterator->funcs->move_forward(iterator); if (EG(exception)) { if (!(object->flags & RIT_CATCH_GET_CHILD)) { return; } else { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } } /* fall through */ case RS_START: - if (iterator->funcs->valid(iterator TSRMLS_CC) == FAILURE) { + if (iterator->funcs->valid(iterator) == FAILURE) { break; } object->iterators[object->level].state = RS_TEST; @@ -276,11 +276,11 @@ next_step: object->iterators[object->level].state = RS_NEXT; return; } else { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } } if (Z_TYPE(retval) != IS_UNDEF) { - has_children = zend_is_true(&retval TSRMLS_CC); + has_children = zend_is_true(&retval); zval_ptr_dtor(&retval); if (has_children) { if (object->max_depth == -1 || object->max_depth > object->level) { @@ -311,7 +311,7 @@ next_step: if (!(object->flags & RIT_CATCH_GET_CHILD)) { return; } else { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } } return /* self */; @@ -338,7 +338,7 @@ next_step: if (!(object->flags & RIT_CATCH_GET_CHILD)) { return; } else { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); zval_ptr_dtor(&child); object->iterators[object->level].state = RS_NEXT; goto next_step; @@ -346,9 +346,9 @@ next_step: } if (Z_TYPE(child) == IS_UNDEF || Z_TYPE(child) != IS_OBJECT || - !((ce = Z_OBJCE(child)) && instanceof_function(ce, spl_ce_RecursiveIterator TSRMLS_CC))) { + !((ce = Z_OBJCE(child)) && instanceof_function(ce, spl_ce_RecursiveIterator))) { zval_ptr_dtor(&child); - zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0); return; } @@ -358,13 +358,13 @@ next_step: object->iterators[object->level].state = RS_NEXT; } object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator) * (++object->level+1)); - sub_iter = ce->get_iterator(ce, &child, 0 TSRMLS_CC); + sub_iter = ce->get_iterator(ce, &child, 0); ZVAL_COPY_VALUE(&object->iterators[object->level].zobject, &child); object->iterators[object->level].iterator = sub_iter; object->iterators[object->level].ce = ce; object->iterators[object->level].state = RS_START; if (sub_iter->funcs->rewind) { - sub_iter->funcs->rewind(sub_iter TSRMLS_CC); + sub_iter->funcs->rewind(sub_iter); } if (object->beginChildren) { zend_call_method_with_0_params(zthis, object->ce, &object->beginChildren, "beginchildren", NULL); @@ -372,7 +372,7 @@ next_step: if (!(object->flags & RIT_CATCH_GET_CHILD)) { return; } else { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } } } @@ -386,11 +386,11 @@ next_step: if (!(object->flags & RIT_CATCH_GET_CHILD)) { return; } else { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } } } - zend_iterator_dtor(iterator TSRMLS_CC); + zend_iterator_dtor(iterator); zval_ptr_dtor(&object->iterators[object->level].zobject); object->level--; } else { @@ -399,7 +399,7 @@ next_step: } } -static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC) +static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis) { zend_object_iterator *sub_iter; @@ -407,7 +407,7 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt while (object->level) { sub_iter = object->iterators[object->level].iterator; - zend_iterator_dtor(sub_iter TSRMLS_CC); + zend_iterator_dtor(sub_iter); zval_ptr_dtor(&object->iterators[object->level--].zobject); if (!EG(exception) && (!object->endChildren || object->endChildren->common.scope != spl_ce_RecursiveIteratorIterator)) { zend_call_method_with_0_params(zthis, object->ce, &object->endChildren, "endchildren", NULL); @@ -417,26 +417,26 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt object->iterators[0].state = RS_START; sub_iter = object->iterators[0].iterator; if (sub_iter->funcs->rewind) { - sub_iter->funcs->rewind(sub_iter TSRMLS_CC); + sub_iter->funcs->rewind(sub_iter); } if (!EG(exception) && object->beginIteration && !object->in_iteration) { zend_call_method_with_0_params(zthis, object->ce, &object->beginIteration, "beginIteration", NULL); } object->in_iteration = 1; - spl_recursive_it_move_forward_ex(object, zthis TSRMLS_CC); + spl_recursive_it_move_forward_ex(object, zthis); } -static void spl_recursive_it_move_forward(zend_object_iterator *iter TSRMLS_DC) +static void spl_recursive_it_move_forward(zend_object_iterator *iter) { - spl_recursive_it_move_forward_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC); + spl_recursive_it_move_forward_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data); } -static void spl_recursive_it_rewind(zend_object_iterator *iter TSRMLS_DC) +static void spl_recursive_it_rewind(zend_object_iterator *iter) { - spl_recursive_it_rewind_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC); + spl_recursive_it_rewind_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data); } -static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref TSRMLS_DC) +static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref) { spl_recursive_it_iterator *iterator; spl_recursive_it_object *object; @@ -451,7 +451,7 @@ static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, "the parent constructor has not been called"); } - zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC); + zend_iterator_init((zend_object_iterator*)iterator); ZVAL_COPY(&iterator->intern.data, zobject); iterator->intern.funcs = ce->iterator_funcs.funcs; @@ -477,7 +477,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla int inc_refcount = 1; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling); switch (rit_type) { case RIT_RecursiveTreeIterator: { @@ -486,8 +486,8 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla mode = RIT_SELF_FIRST; flags = RTIT_BYPASS_KEY; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) { - if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) { + if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) { zval *aggregate = iterator; zend_call_method_with_0_params(aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", iterator); //??? inc_refcount = 0; @@ -498,7 +498,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla } else { ZVAL_LONG(&caching_it_flags, CIT_CATCH_GET_CHILD); } - spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &caching_it, iterator, &caching_it_flags TSRMLS_CC); + spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &caching_it, iterator, &caching_it_flags); zval_ptr_dtor(&caching_it_flags); if (inc_refcount == 0 && iterator) { zval_ptr_dtor(iterator); @@ -515,8 +515,8 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla mode = RIT_LEAVES_ONLY; flags = 0; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|ll", &iterator, &mode, &flags) == SUCCESS) { - if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|ll", &iterator, &mode, &flags) == SUCCESS) { + if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) { zval *aggregate = iterator; zend_call_method_with_0_params(aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", iterator); //??? inc_refcount = 0; @@ -527,12 +527,12 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla break; } } - if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator TSRMLS_CC)) { + if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator)) { if (iterator && !inc_refcount) { zval_ptr_dtor(iterator); } - zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0); + zend_restore_error_handling(&error_handling); return; } @@ -575,7 +575,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla } ce_iterator = Z_OBJCE_P(iterator); /* respect inheritance, don't use spl_ce_RecursiveIterator */ - intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator, 0 TSRMLS_CC); + intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator, 0); //??? if (inc_refcount) { ZVAL_COPY(&intern->iterators[0].zobject, iterator); //??? } else { @@ -584,14 +584,14 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla intern->iterators[0].ce = ce_iterator; intern->iterators[0].state = RS_START; - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); if (EG(exception)) { zend_object_iterator *sub_iter; while (intern->level >= 0) { sub_iter = intern->iterators[intern->level].iterator; - zend_iterator_dtor(sub_iter TSRMLS_CC); + zend_iterator_dtor(sub_iter); zval_ptr_dtor(&intern->iterators[intern->level--].zobject); } efree(intern->iterators); @@ -616,7 +616,7 @@ SPL_METHOD(RecursiveIteratorIterator, rewind) return; } - spl_recursive_it_rewind_ex(object, getThis() TSRMLS_CC); + spl_recursive_it_rewind_ex(object, getThis()); } /* }}} */ /* {{{ proto bool RecursiveIteratorIterator::valid() @@ -629,7 +629,7 @@ SPL_METHOD(RecursiveIteratorIterator, valid) return; } - RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis() TSRMLS_CC) == SUCCESS); + RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis()) == SUCCESS); } /* }}} */ /* {{{ proto mixed RecursiveIteratorIterator::key() @@ -646,7 +646,7 @@ SPL_METHOD(RecursiveIteratorIterator, key) SPL_FETCH_SUB_ITERATOR(iterator, object); if (iterator->funcs->get_current_key) { - iterator->funcs->get_current_key(iterator, return_value TSRMLS_CC); + iterator->funcs->get_current_key(iterator, return_value); } else { RETURN_NULL(); } @@ -666,7 +666,7 @@ SPL_METHOD(RecursiveIteratorIterator, current) SPL_FETCH_SUB_ITERATOR(iterator, object); - data = iterator->funcs->get_current_data(iterator TSRMLS_CC); + data = iterator->funcs->get_current_data(iterator); if (data) { RETURN_ZVAL(data, 1, 0); } @@ -682,7 +682,7 @@ SPL_METHOD(RecursiveIteratorIterator, next) return; } - spl_recursive_it_move_forward_ex(object, getThis() TSRMLS_CC); + spl_recursive_it_move_forward_ex(object, getThis()); } /* }}} */ /* {{{ proto int RecursiveIteratorIterator::getDepth() @@ -705,7 +705,7 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator) spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis()); zend_long level = object->level; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &level) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &level) == FAILURE) { return; } if (level < 0 || level > object->level) { @@ -713,7 +713,7 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator) } if(!object->iterators) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, + zend_throw_exception_ex(spl_ce_LogicException, 0, "The object is in an invalid state as the parent constructor was not called"); return; } @@ -848,11 +848,11 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth) spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis()); zend_long max_depth = -1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_depth) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &max_depth) == FAILURE) { return; } if (max_depth < -1) { - zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0); return; } else if (max_depth > INT_MAX) { max_depth = INT_MAX; @@ -878,7 +878,7 @@ SPL_METHOD(RecursiveIteratorIterator, getMaxDepth) } } /* }}} */ -static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key TSRMLS_DC) +static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key) { union _zend_function *function_handler; spl_recursive_it_object *object = spl_recursive_it_from_obj(*zobject); @@ -886,16 +886,16 @@ static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zval *zobj; if (!object->iterators) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val); + php_error_docref(NULL, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val); } zobj = &object->iterators[level].zobject; - function_handler = std_object_handlers.get_method(zobject, method, key TSRMLS_CC); + function_handler = std_object_handlers.get_method(zobject, method, key); if (!function_handler) { if ((function_handler = zend_hash_find_ptr(&Z_OBJCE_P(zobj)->function_table, method)) == NULL) { if (Z_OBJ_HT_P(zobj)->get_method) { *zobject = Z_OBJ_P(zobj); - function_handler = (*zobject)->handlers->get_method(zobject, method, key TSRMLS_CC); + function_handler = (*zobject)->handlers->get_method(zobject, method, key); } } else { *zobject = Z_OBJ_P(zobj); @@ -905,18 +905,18 @@ static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, } /* {{{ spl_RecursiveIteratorIterator_dtor */ -static void spl_RecursiveIteratorIterator_dtor(zend_object *_object TSRMLS_DC) +static void spl_RecursiveIteratorIterator_dtor(zend_object *_object) { spl_recursive_it_object *object = spl_recursive_it_from_obj(_object); zend_object_iterator *sub_iter; /* call standard dtor */ - zend_objects_destroy_object(_object TSRMLS_CC); + zend_objects_destroy_object(_object); if (object->iterators) { while (object->level >= 0) { sub_iter = object->iterators[object->level].iterator; - zend_iterator_dtor(sub_iter TSRMLS_CC); + zend_iterator_dtor(sub_iter); zval_ptr_dtor(&object->iterators[object->level--].zobject); } efree(object->iterators); @@ -926,11 +926,11 @@ static void spl_RecursiveIteratorIterator_dtor(zend_object *_object TSRMLS_DC) /* }}} */ /* {{{ spl_RecursiveIteratorIterator_free_storage */ -static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object TSRMLS_DC) +static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object) { spl_recursive_it_object *object = spl_recursive_it_from_obj(_object); - zend_object_std_dtor(&object->std TSRMLS_CC); + zend_object_std_dtor(&object->std); smart_str_free(&object->prefix[0]); smart_str_free(&object->prefix[1]); smart_str_free(&object->prefix[2]); @@ -943,7 +943,7 @@ static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object TSRM /* }}} */ /* {{{ spl_RecursiveIteratorIterator_new_ex */ -static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class_type, int init_prefix TSRMLS_DC) +static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class_type, int init_prefix) { spl_recursive_it_object *intern; @@ -960,7 +960,7 @@ static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class smart_str_appendl(&intern->postfix[0], "", 0); } - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); intern->std.handlers = &spl_handlers_rec_it_it; @@ -969,16 +969,16 @@ static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class /* }}} */ /* {{{ spl_RecursiveIteratorIterator_new */ -static zend_object *spl_RecursiveIteratorIterator_new(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_RecursiveIteratorIterator_new(zend_class_entry *class_type) { - return spl_RecursiveIteratorIterator_new_ex(class_type, 0 TSRMLS_CC); + return spl_RecursiveIteratorIterator_new_ex(class_type, 0); } /* }}} */ /* {{{ spl_RecursiveTreeIterator_new */ -static zend_object *spl_RecursiveTreeIterator_new(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_RecursiveTreeIterator_new(zend_class_entry *class_type) { - return spl_RecursiveIteratorIterator_new_ex(class_type, 1 TSRMLS_CC); + return spl_RecursiveIteratorIterator_new_ex(class_type, 1); } /* }}} */ @@ -1018,7 +1018,7 @@ static const zend_function_entry spl_funcs_RecursiveIteratorIterator[] = { PHP_FE_END }; -static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *object, zval *return_value TSRMLS_DC) +static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *object, zval *return_value) { smart_str str = {0}; zval has_next; @@ -1053,15 +1053,15 @@ static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *obje RETURN_STR(str.s); } -static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *object, zval *return_value TSRMLS_DC) +static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *object, zval *return_value) { zend_object_iterator *iterator = object->iterators[object->level].iterator; zval *data; zend_error_handling error_handling; - data = iterator->funcs->get_current_data(iterator TSRMLS_CC); + data = iterator->funcs->get_current_data(iterator); - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); if (data) { RETVAL_ZVAL(data, 1, 0); if (Z_TYPE_P(return_value) == IS_ARRAY) { @@ -1071,10 +1071,10 @@ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *objec convert_to_string(return_value); } } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } -static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object *object, zval *return_value TSRMLS_DC) +static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object *object, zval *return_value) { RETVAL_STR(object->postfix[0].s); Z_ADDREF_P(return_value); @@ -1096,12 +1096,12 @@ SPL_METHOD(RecursiveTreeIterator, setPrefixPart) size_t prefix_len; spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &part, &prefix, &prefix_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &part, &prefix, &prefix_len) == FAILURE) { return; } if (0 > part || part > 5) { - zend_throw_exception_ex(spl_ce_OutOfRangeException, 0 TSRMLS_CC, "Use RecursiveTreeIterator::PREFIX_* constant"); + zend_throw_exception_ex(spl_ce_OutOfRangeException, 0, "Use RecursiveTreeIterator::PREFIX_* constant"); return; } @@ -1120,12 +1120,12 @@ SPL_METHOD(RecursiveTreeIterator, getPrefix) } if(!object->iterators) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, + zend_throw_exception_ex(spl_ce_LogicException, 0, "The object is in an invalid state as the parent constructor was not called"); return; } - spl_recursive_tree_iterator_get_prefix(object, return_value TSRMLS_CC); + spl_recursive_tree_iterator_get_prefix(object, return_value); } /* }}} */ /* {{{ proto void RecursiveTreeIterator::setPostfix(string prefix) @@ -1136,7 +1136,7 @@ SPL_METHOD(RecursiveTreeIterator, setPostfix) char* postfix; size_t postfix_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &postfix, &postfix_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &postfix, &postfix_len) == FAILURE) { return; } @@ -1155,12 +1155,12 @@ SPL_METHOD(RecursiveTreeIterator, getEntry) } if(!object->iterators) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, + zend_throw_exception_ex(spl_ce_LogicException, 0, "The object is in an invalid state as the parent constructor was not called"); return; } - spl_recursive_tree_iterator_get_entry(object, return_value TSRMLS_CC); + spl_recursive_tree_iterator_get_entry(object, return_value); } /* }}} */ /* {{{ proto string RecursiveTreeIterator::getPostfix() @@ -1174,12 +1174,12 @@ SPL_METHOD(RecursiveTreeIterator, getPostfix) } if(!object->iterators) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, + zend_throw_exception_ex(spl_ce_LogicException, 0, "The object is in an invalid state as the parent constructor was not called"); return; } - spl_recursive_tree_iterator_get_postfix(object, return_value TSRMLS_CC); + spl_recursive_tree_iterator_get_postfix(object, return_value); } /* }}} */ /* {{{ proto mixed RecursiveTreeIterator::current() @@ -1196,7 +1196,7 @@ SPL_METHOD(RecursiveTreeIterator, current) } if(!object->iterators) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, + zend_throw_exception_ex(spl_ce_LogicException, 0, "The object is in an invalid state as the parent constructor was not called"); return; } @@ -1206,7 +1206,7 @@ SPL_METHOD(RecursiveTreeIterator, current) zval *data; SPL_FETCH_SUB_ITERATOR(iterator, object); - data = iterator->funcs->get_current_data(iterator TSRMLS_CC); + data = iterator->funcs->get_current_data(iterator); if (data) { RETURN_ZVAL(data, 1, 0); } else { @@ -1216,14 +1216,14 @@ SPL_METHOD(RecursiveTreeIterator, current) ZVAL_NULL(&prefix); ZVAL_NULL(&entry); - spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC); - spl_recursive_tree_iterator_get_entry(object, &entry TSRMLS_CC); + spl_recursive_tree_iterator_get_prefix(object, &prefix); + spl_recursive_tree_iterator_get_entry(object, &entry); if (Z_TYPE(entry) != IS_STRING) { zval_ptr_dtor(&prefix); zval_ptr_dtor(&entry); RETURN_NULL(); } - spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC); + spl_recursive_tree_iterator_get_postfix(object, &postfix); str = zend_string_alloc(Z_STRLEN(prefix) + Z_STRLEN(entry) + Z_STRLEN(postfix), 0); ptr = str->val; @@ -1260,7 +1260,7 @@ SPL_METHOD(RecursiveTreeIterator, key) SPL_FETCH_SUB_ITERATOR(iterator, object); if (iterator->funcs->get_current_key) { - iterator->funcs->get_current_key(iterator, &key TSRMLS_CC); + iterator->funcs->get_current_key(iterator, &key); } else { ZVAL_NULL(&key); } @@ -1273,13 +1273,13 @@ SPL_METHOD(RecursiveTreeIterator, key) } if (Z_TYPE(key) != IS_STRING) { - if (zend_make_printable_zval(&key, &key_copy TSRMLS_CC)) { + if (zend_make_printable_zval(&key, &key_copy)) { key = key_copy; } } - spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC); - spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC); + spl_recursive_tree_iterator_get_prefix(object, &prefix); + spl_recursive_tree_iterator_get_postfix(object, &postfix); str = zend_string_alloc(Z_STRLEN(prefix) + Z_STRLEN(key) + Z_STRLEN(postfix), 0); ptr = str->val; @@ -1334,7 +1334,7 @@ static const zend_function_entry spl_funcs_RecursiveTreeIterator[] = { }; #if MBO_0 -static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) +static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type) { class_type->iterator_funcs.zf_valid = NULL; class_type->iterator_funcs.zf_current = NULL; @@ -1349,19 +1349,19 @@ static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_ } #endif -static union _zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) +static union _zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key) { union _zend_function *function_handler; spl_dual_it_object *intern; intern = spl_dual_it_from_obj(*object); - function_handler = std_object_handlers.get_method(object, method, key TSRMLS_CC); + function_handler = std_object_handlers.get_method(object, method, key); if (!function_handler && intern->inner.ce) { if ((function_handler = zend_hash_find_ptr(&intern->inner.ce->function_table, method)) == NULL) { if (Z_OBJ_HT(intern->inner.zobject)->get_method) { *object = Z_OBJ(intern->inner.zobject); - function_handler = (*object)->handlers->get_method(object, method, key TSRMLS_CC); + function_handler = (*object)->handlers->get_method(object, method, key); } } else { *object = Z_OBJ(intern->inner.zobject); @@ -1384,8 +1384,8 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) intern = Z_SPLDUAL_IT_P(getThis()); ZVAL_STRING(&func, method, 0); - if (!zend_is_callable(&func, 0, &method TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Method %s::%s() does not exist", intern->inner.ce->name, method); + if (!zend_is_callable(&func, 0, &method)) { + php_error_docref(NULL, E_ERROR, "Method %s::%s() does not exist", intern->inner.ce->name, method); return FAILURE; } @@ -1401,12 +1401,12 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) } arg_count = current; /* restore */ - if (call_user_function_ex(EG(function_table), NULL, &func, &retval, arg_count, func_params, 0, NULL TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (call_user_function_ex(EG(function_table), NULL, &func, &retval, arg_count, func_params, 0, NULL) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { RETURN_ZVAL(&retval, 0, 0); success = SUCCESS; } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to call %s::%s()", intern->inner.ce->name, method); + php_error_docref(NULL, E_ERROR, "Unable to call %s::%s()", intern->inner.ce->name, method); success = FAILURE; } @@ -1417,14 +1417,14 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) #define SPL_CHECK_CTOR(intern, classname) \ if (intern->dit_type == DIT_Unknown) { \ - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Classes derived from %s must call %s::__construct()", \ + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Classes derived from %s must call %s::__construct()", \ (spl_ce_##classname)->name->val, (spl_ce_##classname)->name->val); \ return; \ } #define APPENDIT_CHECK_CTOR(intern) SPL_CHECK_CTOR(intern, AppendIterator) -static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC); +static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more); static inline int spl_cit_check_flags(zend_long flags) { @@ -1449,29 +1449,29 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z intern = Z_SPLDUAL_IT_P(getThis()); if (intern->dit_type != DIT_Unknown) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s::getIterator() must be called exactly once per instance", ce_base->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s::getIterator() must be called exactly once per instance", ce_base->name->val); return NULL; } - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling); intern->dit_type = dit_type; switch (dit_type) { case DIT_LimitIterator: { intern->u.limit.offset = 0; /* start at beginning */ intern->u.limit.count = -1; /* get all */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) { + zend_restore_error_handling(&error_handling); return NULL; } if (intern->u.limit.offset < 0) { - zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0); + zend_restore_error_handling(&error_handling); return NULL; } if (intern->u.limit.count < 0 && intern->u.limit.count != -1) { - zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0); + zend_restore_error_handling(&error_handling); return NULL; } break; @@ -1479,13 +1479,13 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z case DIT_CachingIterator: case DIT_RecursiveCachingIterator: { zend_long flags = CIT_CALL_TOSTRING; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &zobject, ce_inner, &flags) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &zobject, ce_inner, &flags) == FAILURE) { + zend_restore_error_handling(&error_handling); return NULL; } if (spl_cit_check_flags(flags) != SUCCESS) { - zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0); + zend_restore_error_handling(&error_handling); return NULL; } intern->u.caching.flags |= flags & CIT_PUBLIC; @@ -1496,33 +1496,33 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z zend_class_entry *ce_cast; zend_string *class_name; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|S", &zobject, ce_inner, &class_name) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|S", &zobject, ce_inner, &class_name) == FAILURE) { + zend_restore_error_handling(&error_handling); return NULL; } ce = Z_OBJCE_P(zobject); - if (!instanceof_function(ce, zend_ce_iterator TSRMLS_CC)) { + if (!instanceof_function(ce, zend_ce_iterator)) { if (ZEND_NUM_ARGS() > 1) { - if (!(ce_cast = zend_lookup_class(class_name TSRMLS_CC)) - || !instanceof_function(ce, ce_cast TSRMLS_CC) + if (!(ce_cast = zend_lookup_class(class_name)) + || !instanceof_function(ce, ce_cast) || !ce_cast->get_iterator ) { - zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0); + zend_restore_error_handling(&error_handling); return NULL; } ce = ce_cast; } - if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) { + if (instanceof_function(ce, zend_ce_aggregate)) { zend_call_method_with_0_params(zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); if (EG(exception)) { zval_ptr_dtor(&retval); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); return NULL; } - if (Z_TYPE(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE(retval), zend_ce_traversable TSRMLS_CC)) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "%s::getIterator() must return an object that implements Traversable", ce->name->val); - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (Z_TYPE(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE(retval), zend_ce_traversable)) { + zend_throw_exception_ex(spl_ce_LogicException, 0, "%s::getIterator() must return an object that implements Traversable", ce->name->val); + zend_restore_error_handling(&error_handling); return NULL; } zobject = &retval; @@ -1533,10 +1533,10 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z break; } case DIT_AppendIterator: - spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit TSRMLS_CC); + spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit); zend_call_method_with_0_params(&intern->u.append.zarrayit, spl_ce_ArrayIterator, &spl_ce_ArrayIterator->constructor, "__construct", NULL); - intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 0 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); + intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 0); + zend_restore_error_handling(&error_handling); return intern; #if HAVE_PCRE || HAVE_BUNDLED_PCRE case DIT_RegexIterator: @@ -1547,21 +1547,21 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z intern->u.regex.use_flags = ZEND_NUM_ARGS() >= 5; intern->u.regex.flags = 0; intern->u.regex.preg_flags = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OS|lll", &zobject, ce_inner, ®ex, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS|lll", &zobject, ce_inner, ®ex, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) { + zend_restore_error_handling(&error_handling); return NULL; } if (mode < 0 || mode >= REGIT_MODE_MAX) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %pd", mode); - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode); + zend_restore_error_handling(&error_handling); return NULL; } intern->u.regex.mode = mode; intern->u.regex.regex = zend_string_copy(regex); - intern->u.regex.pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC); + intern->u.regex.pce = pcre_get_compiled_regex_cache(regex); if (intern->u.regex.pce == NULL) { /* pcre_get_compiled_regex_cache has already sent error */ - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); return NULL; } intern->u.regex.pce->refcount++; @@ -1572,8 +1572,8 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z case DIT_RecursiveCallbackFilterIterator: { _spl_cbfilter_it_intern *cfi = emalloc(sizeof(*cfi)); cfi->fci.object = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Of", &zobject, ce_inner, &cfi->fci, &cfi->fcc) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Of", &zobject, ce_inner, &cfi->fci, &cfi->fcc) == FAILURE) { + zend_restore_error_handling(&error_handling); efree(cfi); return NULL; } @@ -1586,14 +1586,14 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z break; } default: - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobject, ce_inner) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zobject, ce_inner) == FAILURE) { + zend_restore_error_handling(&error_handling); return NULL; } break; } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); if (inc_refcount) { ZVAL_COPY(&intern->inner.zobject, zobject); @@ -1603,7 +1603,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z intern->inner.ce = dit_type == DIT_IteratorIterator ? ce : Z_OBJCE_P(zobject); intern->inner.object = Z_OBJ_P(zobject); - intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0 TSRMLS_CC); + intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0); return intern; } @@ -1644,17 +1644,17 @@ SPL_METHOD(dual_it, getInnerIterator) } } /* }}} */ -static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_dual_it_require(spl_dual_it_object *intern) { if (!intern->inner.iterator) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "The inner constructor wasn't initialized with an iterator instance"); + php_error_docref(NULL, E_ERROR, "The inner constructor wasn't initialized with an iterator instance"); } } -static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_dual_it_free(spl_dual_it_object *intern) { if (intern->inner.iterator && intern->inner.iterator->funcs->invalidate_current) { - intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator TSRMLS_CC); + intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator); } if (Z_TYPE(intern->current.data) != IS_UNDEF) { zval_ptr_dtor(&intern->current.data); @@ -1676,37 +1676,37 @@ static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC) } } -static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_dual_it_rewind(spl_dual_it_object *intern) { - spl_dual_it_free(intern TSRMLS_CC); + spl_dual_it_free(intern); intern->current.pos = 0; if (intern->inner.iterator->funcs->rewind) { - intern->inner.iterator->funcs->rewind(intern->inner.iterator TSRMLS_CC); + intern->inner.iterator->funcs->rewind(intern->inner.iterator); } } -static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC) +static inline int spl_dual_it_valid(spl_dual_it_object *intern) { if (!intern->inner.iterator) { return FAILURE; } /* FAILURE / SUCCESS */ - return intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC); + return intern->inner.iterator->funcs->valid(intern->inner.iterator); } -static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC) +static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more) { zval *data; - spl_dual_it_free(intern TSRMLS_CC); - if (!check_more || spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator TSRMLS_CC); + spl_dual_it_free(intern); + if (!check_more || spl_dual_it_valid(intern) == SUCCESS) { + data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator); if (data) { ZVAL_COPY(&intern->current.data, data); } if (intern->inner.iterator->funcs->get_current_key) { - intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.key TSRMLS_CC); + intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.key); if (EG(exception)) { zval_ptr_dtor(&intern->current.key); ZVAL_UNDEF(&intern->current.key); @@ -1719,14 +1719,14 @@ static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more T return FAILURE; } -static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free TSRMLS_DC) +static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free) { if (do_free) { - spl_dual_it_free(intern TSRMLS_CC); + spl_dual_it_free(intern); } else { - spl_dual_it_require(intern TSRMLS_CC); + spl_dual_it_require(intern); } - intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC); + intern->inner.iterator->funcs->move_forward(intern->inner.iterator); intern->current.pos++; } @@ -1744,8 +1744,8 @@ SPL_METHOD(dual_it, rewind) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_dual_it_rewind(intern TSRMLS_CC); - spl_dual_it_fetch(intern, 1 TSRMLS_CC); + spl_dual_it_rewind(intern); + spl_dual_it_fetch(intern, 1); } /* }}} */ /* {{{ proto bool FilterIterator::valid() @@ -1829,18 +1829,18 @@ SPL_METHOD(dual_it, next) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_dual_it_next(intern, 1 TSRMLS_CC); - spl_dual_it_fetch(intern, 1 TSRMLS_CC); + spl_dual_it_next(intern, 1); + spl_dual_it_fetch(intern, 1); } /* }}} */ -static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern) { zval retval; - while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) { + while (spl_dual_it_fetch(intern, 1) == SUCCESS) { zend_call_method_with_0_params(zthis, intern->std.ce, NULL, "accept", &retval); if (Z_TYPE(retval) != IS_UNDEF) { - if (zend_is_true(&retval TSRMLS_CC)) { + if (zend_is_true(&retval)) { zval_ptr_dtor(&retval); return; } @@ -1849,21 +1849,21 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T if (EG(exception)) { return; } - intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC); + intern->inner.iterator->funcs->move_forward(intern->inner.iterator); } - spl_dual_it_free(intern TSRMLS_CC); + spl_dual_it_free(intern); } -static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object *intern) { - spl_dual_it_rewind(intern TSRMLS_CC); - spl_filter_it_fetch(zthis, intern TSRMLS_CC); + spl_dual_it_rewind(intern); + spl_filter_it_fetch(zthis, intern); } -static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern) { - spl_dual_it_next(intern, 1 TSRMLS_CC); - spl_filter_it_fetch(zthis, intern TSRMLS_CC); + spl_dual_it_next(intern, 1); + spl_filter_it_fetch(zthis, intern); } /* {{{ proto void FilterIterator::rewind() @@ -1877,7 +1877,7 @@ SPL_METHOD(FilterIterator, rewind) } SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_filter_it_rewind(getThis(), intern TSRMLS_CC); + spl_filter_it_rewind(getThis(), intern); } /* }}} */ /* {{{ proto void FilterIterator::next() @@ -1891,7 +1891,7 @@ SPL_METHOD(FilterIterator, next) } SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_filter_it_next(getThis(), intern TSRMLS_CC); + spl_filter_it_next(getThis(), intern); } /* }}} */ /* {{{ proto void RecursiveCallbackFilterIterator::__construct(RecursiveIterator it, callback) @@ -1945,7 +1945,7 @@ SPL_METHOD(RecursiveFilterIterator, getChildren) zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) { - spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, &retval TSRMLS_CC); + spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, &retval); } zval_ptr_dtor(&retval); } /* }}} */ @@ -1965,7 +1965,7 @@ SPL_METHOD(RecursiveCallbackFilterIterator, getChildren) zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) { - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, &intern->u.cbfilter->fci.function_name TSRMLS_CC); + spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, &intern->u.cbfilter->fci.function_name); } zval_ptr_dtor(&retval); } /* }}} */ @@ -2011,7 +2011,7 @@ SPL_METHOD(CallbackFilterIterator, accept) fci->params = params; fci->no_separation = 0; - if (zend_call_function(fci, fcc TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { + if (zend_call_function(fci, fcc) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { RETURN_FALSE; } if (EG(exception)) { @@ -2051,7 +2051,7 @@ SPL_METHOD(RegexIterator, accept) } ZVAL_UNDEF(&subject_copy); - use_copy = zend_make_printable_zval(subject_ptr, &subject_copy TSRMLS_CC); + use_copy = zend_make_printable_zval(subject_ptr, &subject_copy); if (use_copy) { subject = Z_STRVAL(subject_copy); subject_len = (int)Z_STRLEN(subject_copy); @@ -2078,7 +2078,7 @@ SPL_METHOD(RegexIterator, accept) zval_ptr_dtor(&intern->current.data); ZVAL_UNDEF(&intern->current.data); php_pcre_match_impl(intern->u.regex.pce, subject, subject_len, &zcount, - &intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC); + &intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0); RETVAL_BOOL(Z_LVAL(zcount) > 0); break; @@ -2089,20 +2089,20 @@ SPL_METHOD(RegexIterator, accept) } zval_ptr_dtor(&intern->current.data); ZVAL_UNDEF(&intern->current.data); - php_pcre_split_impl(intern->u.regex.pce, subject, subject_len, &intern->current.data, -1, intern->u.regex.preg_flags TSRMLS_CC); + php_pcre_split_impl(intern->u.regex.pce, subject, subject_len, &intern->current.data, -1, intern->u.regex.preg_flags); count = zend_hash_num_elements(Z_ARRVAL(intern->current.data)); RETVAL_BOOL(count > 1); break; case REGIT_MODE_REPLACE: - replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1 TSRMLS_CC); + replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1); if (Z_TYPE_P(replacement) != IS_STRING) { tmp_replacement = *replacement; zval_copy_ctor(&tmp_replacement); convert_to_string(&tmp_replacement); replacement = &tmp_replacement; } - result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, -1, &count TSRMLS_CC); + result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, -1, &count); if (intern->u.regex.flags & REGIT_USE_KEY) { zval_ptr_dtor(&intern->current.key); @@ -2165,12 +2165,12 @@ SPL_METHOD(RegexIterator, setMode) spl_dual_it_object *intern; zend_long mode; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &mode) == FAILURE) { return; } if (mode < 0 || mode >= REGIT_MODE_MAX) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %pd", mode); + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode); return;/* NULL */ } @@ -2201,7 +2201,7 @@ SPL_METHOD(RegexIterator, setFlags) spl_dual_it_object *intern; zend_long flags; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) { return; } @@ -2236,7 +2236,7 @@ SPL_METHOD(RegexIterator, setPregFlags) spl_dual_it_object *intern; zend_long preg_flags; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &preg_flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &preg_flags) == FAILURE) { return; } @@ -2276,7 +2276,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren) ZVAL_LONG(&args[3], intern->u.regex.flags); ZVAL_LONG(&args[4], intern->u.regex.preg_flags); - spl_instantiate_arg_n(Z_OBJCE_P(getThis()), return_value, 5, args TSRMLS_CC); + spl_instantiate_arg_n(Z_OBJCE_P(getThis()), return_value, 5, args); zval_ptr_dtor(&args[1]); } @@ -2305,23 +2305,23 @@ SPL_METHOD(RecursiveRegexIterator, accept) #endif /* {{{ spl_dual_it_dtor */ -static void spl_dual_it_dtor(zend_object *_object TSRMLS_DC) +static void spl_dual_it_dtor(zend_object *_object) { spl_dual_it_object *object = spl_dual_it_from_obj(_object); /* call standard dtor */ - zend_objects_destroy_object(_object TSRMLS_CC); + zend_objects_destroy_object(_object); - spl_dual_it_free(object TSRMLS_CC); + spl_dual_it_free(object); if (object->inner.iterator) { - zend_iterator_dtor(object->inner.iterator TSRMLS_CC); + zend_iterator_dtor(object->inner.iterator); } } /* }}} */ /* {{{ spl_dual_it_free_storage */ -static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC) +static void spl_dual_it_free_storage(zend_object *_object) { spl_dual_it_object *object = spl_dual_it_from_obj(_object); @@ -2331,7 +2331,7 @@ static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC) } if (object->dit_type == DIT_AppendIterator) { - zend_iterator_dtor(object->u.append.iterator TSRMLS_CC); + zend_iterator_dtor(object->u.append.iterator); if (Z_TYPE(object->u.append.zarrayit) != IS_UNDEF) { zval_ptr_dtor(&object->u.append.zarrayit); } @@ -2367,19 +2367,19 @@ static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC) } } - zend_object_std_dtor(&object->std TSRMLS_CC); + zend_object_std_dtor(&object->std); } /* }}} */ /* {{{ spl_dual_it_new */ -static zend_object *spl_dual_it_new(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_dual_it_new(zend_class_entry *class_type) { spl_dual_it_object *intern; intern = ecalloc(1, sizeof(spl_dual_it_object) + sizeof(zval) * (class_type->default_properties_count - 1)); intern->dit_type = DIT_Unknown; - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); intern->std.handlers = &spl_handlers_dual_it; @@ -2494,51 +2494,51 @@ static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = { }; #endif -static inline int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC) +static inline int spl_limit_it_valid(spl_dual_it_object *intern) { /* FAILURE / SUCCESS */ if (intern->u.limit.count != -1 && intern->current.pos >= intern->u.limit.offset + intern->u.limit.count) { return FAILURE; } else { - return spl_dual_it_valid(intern TSRMLS_CC); + return spl_dual_it_valid(intern); } } -static inline void spl_limit_it_seek(spl_dual_it_object *intern, zend_long pos TSRMLS_DC) +static inline void spl_limit_it_seek(spl_dual_it_object *intern, zend_long pos) { zval zpos; - spl_dual_it_free(intern TSRMLS_CC); + spl_dual_it_free(intern); if (pos < intern->u.limit.offset) { - zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %pd which is below the offset %pd", pos, intern->u.limit.offset); + zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is below the offset %pd", pos, intern->u.limit.offset); return; } if (pos >= intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) { - zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %pd which is behind offset %pd plus count %pd", pos, intern->u.limit.offset, intern->u.limit.count); + zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is behind offset %pd plus count %pd", pos, intern->u.limit.offset, intern->u.limit.count); return; } - if (pos != intern->current.pos && instanceof_function(intern->inner.ce, spl_ce_SeekableIterator TSRMLS_CC)) { + if (pos != intern->current.pos && instanceof_function(intern->inner.ce, spl_ce_SeekableIterator)) { ZVAL_LONG(&zpos, pos); - spl_dual_it_free(intern TSRMLS_CC); + spl_dual_it_free(intern); zend_call_method_with_1_params(&intern->inner.zobject, intern->inner.ce, NULL, "seek", NULL, &zpos); zval_ptr_dtor(&zpos); if (!EG(exception)) { intern->current.pos = pos; - if (spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 0 TSRMLS_CC); + if (spl_limit_it_valid(intern) == SUCCESS) { + spl_dual_it_fetch(intern, 0); } } } else { /* emulate the forward seek, by next() calls */ /* a back ward seek is done by a previous rewind() */ if (pos < intern->current.pos) { - spl_dual_it_rewind(intern TSRMLS_CC); + spl_dual_it_rewind(intern); } - while (pos > intern->current.pos && spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_next(intern, 1 TSRMLS_CC); + while (pos > intern->current.pos && spl_dual_it_valid(intern) == SUCCESS) { + spl_dual_it_next(intern, 1); } - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 1 TSRMLS_CC); + if (spl_dual_it_valid(intern) == SUCCESS) { + spl_dual_it_fetch(intern, 1); } } } @@ -2557,8 +2557,8 @@ SPL_METHOD(LimitIterator, rewind) spl_dual_it_object *intern; SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_dual_it_rewind(intern TSRMLS_CC); - spl_limit_it_seek(intern, intern->u.limit.offset TSRMLS_CC); + spl_dual_it_rewind(intern); + spl_limit_it_seek(intern, intern->u.limit.offset); } /* }}} */ /* {{{ proto bool LimitIterator::valid() @@ -2569,7 +2569,7 @@ SPL_METHOD(LimitIterator, valid) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); -/* RETURN_BOOL(spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS);*/ +/* RETURN_BOOL(spl_limit_it_valid(intern) == SUCCESS);*/ RETURN_BOOL((intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) && Z_TYPE(intern->current.data) != IS_UNDEF); } /* }}} */ @@ -2581,9 +2581,9 @@ SPL_METHOD(LimitIterator, next) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_dual_it_next(intern, 1 TSRMLS_CC); + spl_dual_it_next(intern, 1); if (intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) { - spl_dual_it_fetch(intern, 1 TSRMLS_CC); + spl_dual_it_fetch(intern, 1); } } /* }}} */ @@ -2594,12 +2594,12 @@ SPL_METHOD(LimitIterator, seek) spl_dual_it_object *intern; zend_long pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pos) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pos) == FAILURE) { return; } SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_limit_it_seek(intern, pos TSRMLS_CC); + spl_limit_it_seek(intern, pos); RETURN_LONG(intern->current.pos); } /* }}} */ @@ -2644,19 +2644,19 @@ static const zend_function_entry spl_funcs_LimitIterator[] = { PHP_FE_END }; -static inline int spl_caching_it_valid(spl_dual_it_object *intern TSRMLS_DC) +static inline int spl_caching_it_valid(spl_dual_it_object *intern) { return intern->u.caching.flags & CIT_VALID ? SUCCESS : FAILURE; } -static inline int spl_caching_it_has_next(spl_dual_it_object *intern TSRMLS_DC) +static inline int spl_caching_it_has_next(spl_dual_it_object *intern) { - return spl_dual_it_valid(intern TSRMLS_CC); + return spl_dual_it_valid(intern); } -static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_caching_it_next(spl_dual_it_object *intern) { - if (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) { + if (spl_dual_it_fetch(intern, 1) == SUCCESS) { intern->u.caching.flags |= CIT_VALID; /* Full cache ? */ if (intern->u.caching.flags & CIT_FULL_CACHE) { @@ -2665,7 +2665,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) ZVAL_ZVAL(&zcacheval, &intern->current.data, 1, 0); - array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval TSRMLS_CC); + array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval); zval_ptr_dtor(&zcacheval); } @@ -2676,31 +2676,31 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) if (EG(exception)) { zval_ptr_dtor(&retval); if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } else { return; } } else { - if (zend_is_true(&retval TSRMLS_CC)) { + if (zend_is_true(&retval)) { zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren); if (EG(exception)) { zval_ptr_dtor(&zchildren); if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } else { zval_ptr_dtor(&retval); return; } } else { ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC); - spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, &zchildren, &zflags TSRMLS_CC); + spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, &zchildren, &zflags); zval_ptr_dtor(&zchildren); } } zval_ptr_dtor(&retval); if (EG(exception)) { if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) { - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } else { return; } @@ -2715,24 +2715,24 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) } else { ZVAL_COPY_VALUE(&intern->u.caching.zstr, &intern->current.data); } - use_copy = zend_make_printable_zval(&intern->u.caching.zstr, &expr_copy TSRMLS_CC); + use_copy = zend_make_printable_zval(&intern->u.caching.zstr, &expr_copy); if (use_copy) { ZVAL_COPY_VALUE(&intern->u.caching.zstr, &expr_copy); } else if (Z_REFCOUNTED(intern->u.caching.zstr)) { Z_ADDREF(intern->u.caching.zstr); } } - spl_dual_it_next(intern, 0 TSRMLS_CC); + spl_dual_it_next(intern, 0); } else { intern->u.caching.flags &= ~CIT_VALID; } } -static inline void spl_caching_it_rewind(spl_dual_it_object *intern TSRMLS_DC) +static inline void spl_caching_it_rewind(spl_dual_it_object *intern) { - spl_dual_it_rewind(intern TSRMLS_CC); + spl_dual_it_rewind(intern); zend_hash_clean(HASH_OF(&intern->u.caching.zcache)); - spl_caching_it_next(intern TSRMLS_CC); + spl_caching_it_next(intern); } /* {{{ proto void CachingIterator::__construct(Iterator it [, flags = CIT_CALL_TOSTRING]) @@ -2754,7 +2754,7 @@ SPL_METHOD(CachingIterator, rewind) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_caching_it_rewind(intern TSRMLS_CC); + spl_caching_it_rewind(intern); } /* }}} */ /* {{{ proto bool CachingIterator::valid() @@ -2769,7 +2769,7 @@ SPL_METHOD(CachingIterator, valid) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - RETURN_BOOL(spl_caching_it_valid(intern TSRMLS_CC) == SUCCESS); + RETURN_BOOL(spl_caching_it_valid(intern) == SUCCESS); } /* }}} */ /* {{{ proto void CachingIterator::next() @@ -2784,7 +2784,7 @@ SPL_METHOD(CachingIterator, next) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_caching_it_next(intern TSRMLS_CC); + spl_caching_it_next(intern); } /* }}} */ /* {{{ proto bool CachingIterator::hasNext() @@ -2799,7 +2799,7 @@ SPL_METHOD(CachingIterator, hasNext) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - RETURN_BOOL(spl_caching_it_has_next(intern TSRMLS_CC) == SUCCESS); + RETURN_BOOL(spl_caching_it_has_next(intern) == SUCCESS); } /* }}} */ /* {{{ proto string CachingIterator::__toString() @@ -2811,7 +2811,7 @@ SPL_METHOD(CachingIterator, __toString) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT|CIT_TOSTRING_USE_INNER))) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); return; } if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) { @@ -2841,11 +2841,11 @@ SPL_METHOD(CachingIterator, offsetSet) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &key, &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &key, &value) == FAILURE) { return; } @@ -2867,11 +2867,11 @@ SPL_METHOD(CachingIterator, offsetGet) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) { return; } @@ -2894,11 +2894,11 @@ SPL_METHOD(CachingIterator, offsetUnset) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) { return; } @@ -2916,11 +2916,11 @@ SPL_METHOD(CachingIterator, offsetExists) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) { return; } @@ -2941,7 +2941,7 @@ SPL_METHOD(CachingIterator, getCache) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); return; } @@ -2974,20 +2974,20 @@ SPL_METHOD(CachingIterator, setFlags) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) { return; } if (spl_cit_check_flags(flags) != SUCCESS) { - zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0); return; } if ((intern->u.caching.flags & CIT_CALL_TOSTRING) != 0 && (flags & CIT_CALL_TOSTRING) == 0) { - zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0); return; } if ((intern->u.caching.flags & CIT_TOSTRING_USE_INNER) != 0 && (flags & CIT_TOSTRING_USE_INNER) == 0) { - zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag TOSTRING_USE_INNER is not possible", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag TOSTRING_USE_INNER is not possible", 0); return; } if ((flags & CIT_FULL_CACHE) != 0 && (intern->u.caching.flags & CIT_FULL_CACHE) == 0) { @@ -3011,7 +3011,7 @@ SPL_METHOD(CachingIterator, count) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val); return; } @@ -3161,7 +3161,7 @@ SPL_METHOD(NoRewindIterator, valid) } SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC) == SUCCESS); + RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator) == SUCCESS); } /* }}} */ /* {{{ proto mixed NoRewindIterator::key() @@ -3177,7 +3177,7 @@ SPL_METHOD(NoRewindIterator, key) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); if (intern->inner.iterator->funcs->get_current_key) { - intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value TSRMLS_CC); + intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value); } else { RETURN_NULL(); } @@ -3195,7 +3195,7 @@ SPL_METHOD(NoRewindIterator, current) } SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator TSRMLS_CC); + data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator); if (data) { RETURN_ZVAL(data, 1, 0); } @@ -3212,7 +3212,7 @@ SPL_METHOD(NoRewindIterator, next) } SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC); + intern->inner.iterator->funcs->move_forward(intern->inner.iterator); } /* }}} */ ZEND_BEGIN_ARG_INFO(arginfo_norewind_it___construct, 0) @@ -3249,13 +3249,13 @@ SPL_METHOD(InfiniteIterator, next) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_dual_it_next(intern, 1 TSRMLS_CC); - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 0 TSRMLS_CC); + spl_dual_it_next(intern, 1); + if (spl_dual_it_valid(intern) == SUCCESS) { + spl_dual_it_fetch(intern, 0); } else { - spl_dual_it_rewind(intern TSRMLS_CC); - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 0 TSRMLS_CC); + spl_dual_it_rewind(intern); + if (spl_dual_it_valid(intern) == SUCCESS) { + spl_dual_it_fetch(intern, 0); } } } /* }}} */ @@ -3292,7 +3292,7 @@ SPL_METHOD(EmptyIterator, key) if (zend_parse_parameters_none() == FAILURE) { return; } - zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0); } /* }}} */ /* {{{ proto void EmptyIterator::current() @@ -3302,7 +3302,7 @@ SPL_METHOD(EmptyIterator, current) if (zend_parse_parameters_none() == FAILURE) { return; } - zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0); } /* }}} */ /* {{{ proto void EmptyIterator::next() @@ -3323,50 +3323,50 @@ static const zend_function_entry spl_funcs_EmptyIterator[] = { PHP_FE_END }; -int spl_append_it_next_iterator(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/ +int spl_append_it_next_iterator(spl_dual_it_object *intern) /* {{{*/ { - spl_dual_it_free(intern TSRMLS_CC); + spl_dual_it_free(intern); if (!Z_ISUNDEF(intern->inner.zobject)) { zval_ptr_dtor(&intern->inner.zobject); ZVAL_UNDEF(&intern->inner.zobject); intern->inner.ce = NULL; if (intern->inner.iterator) { - zend_iterator_dtor(intern->inner.iterator TSRMLS_CC); + zend_iterator_dtor(intern->inner.iterator); intern->inner.iterator = NULL; } } - if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) == SUCCESS) { + if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) == SUCCESS) { zval *it; - it = intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator TSRMLS_CC); + it = intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator); ZVAL_COPY(&intern->inner.zobject, it); intern->inner.ce = Z_OBJCE_P(it); - intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, it, 0 TSRMLS_CC); - spl_dual_it_rewind(intern TSRMLS_CC); + intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, it, 0); + spl_dual_it_rewind(intern); return SUCCESS; } else { return FAILURE; } } /* }}} */ -void spl_append_it_fetch(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/ +void spl_append_it_fetch(spl_dual_it_object *intern) /* {{{*/ { - while (spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) { - intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator TSRMLS_CC); - if (spl_append_it_next_iterator(intern TSRMLS_CC) != SUCCESS) { + while (spl_dual_it_valid(intern) != SUCCESS) { + intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator); + if (spl_append_it_next_iterator(intern) != SUCCESS) { return; } } - spl_dual_it_fetch(intern, 0 TSRMLS_CC); + spl_dual_it_fetch(intern, 0); } /* }}} */ -void spl_append_it_next(spl_dual_it_object *intern TSRMLS_DC) /* {{{ */ +void spl_append_it_next(spl_dual_it_object *intern) /* {{{ */ { - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_next(intern, 1 TSRMLS_CC); + if (spl_dual_it_valid(intern) == SUCCESS) { + spl_dual_it_next(intern, 1); } - spl_append_it_fetch(intern TSRMLS_CC); + spl_append_it_fetch(intern); } /* }}} */ /* {{{ proto void AppendIterator::__construct() @@ -3385,19 +3385,19 @@ SPL_METHOD(AppendIterator, append) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, zend_ce_iterator) == FAILURE) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &it, zend_ce_iterator) == FAILURE) { return; } - spl_array_iterator_append(&intern->u.append.zarrayit, it TSRMLS_CC); + spl_array_iterator_append(&intern->u.append.zarrayit, it); - if (!intern->inner.iterator || spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) { - if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) != SUCCESS) { - intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC); + if (!intern->inner.iterator || spl_dual_it_valid(intern) != SUCCESS) { + if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) != SUCCESS) { + intern->u.append.iterator->funcs->rewind(intern->u.append.iterator); } do { - spl_append_it_next_iterator(intern TSRMLS_CC); + spl_append_it_next_iterator(intern); } while (Z_OBJ(intern->inner.zobject) != Z_OBJ_P(it)); - spl_append_it_fetch(intern TSRMLS_CC); + spl_append_it_fetch(intern); } } /* }}} */ @@ -3413,9 +3413,9 @@ SPL_METHOD(AppendIterator, rewind) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC); - if (spl_append_it_next_iterator(intern TSRMLS_CC) == SUCCESS) { - spl_append_it_fetch(intern TSRMLS_CC); + intern->u.append.iterator->funcs->rewind(intern->u.append.iterator); + if (spl_append_it_next_iterator(intern) == SUCCESS) { + spl_append_it_fetch(intern); } } /* }}} */ @@ -3446,7 +3446,7 @@ SPL_METHOD(AppendIterator, next) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - spl_append_it_next(intern TSRMLS_CC); + spl_append_it_next(intern); } /* }}} */ /* {{{ proto int AppendIterator::getIteratorIndex() @@ -3462,7 +3462,7 @@ SPL_METHOD(AppendIterator, getIteratorIndex) SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); APPENDIT_CHECK_CTOR(intern); - spl_array_iterator_key(&intern->u.append.zarrayit, return_value TSRMLS_CC); + spl_array_iterator_key(&intern->u.append.zarrayit, return_value); } /* }}} */ /* {{{ proto ArrayIterator AppendIterator::getArrayIterator() @@ -3498,12 +3498,12 @@ static const zend_function_entry spl_funcs_AppendIterator[] = { PHP_FE_END }; -PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC) +PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser) { zend_object_iterator *iter; zend_class_entry *ce = Z_OBJCE_P(obj); - iter = ce->get_iterator(ce, obj, 0 TSRMLS_CC); + iter = ce->get_iterator(ce, obj, 0); if (EG(exception)) { goto done; @@ -3511,21 +3511,21 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v iter->index = 0; if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); + iter->funcs->rewind(iter); if (EG(exception)) { goto done; } } - while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) { + while (iter->funcs->valid(iter) == SUCCESS) { if (EG(exception)) { goto done; } - if (apply_func(iter, puser TSRMLS_CC) == ZEND_HASH_APPLY_STOP || EG(exception)) { + if (apply_func(iter, puser) == ZEND_HASH_APPLY_STOP || EG(exception)) { goto done; } iter->index++; - iter->funcs->move_forward(iter TSRMLS_CC); + iter->funcs->move_forward(iter); if (EG(exception)) { goto done; } @@ -3533,17 +3533,17 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v done: if (iter) { - zend_iterator_dtor(iter TSRMLS_CC); + zend_iterator_dtor(iter); } return EG(exception) ? FAILURE : SUCCESS; } /* }}} */ -static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ +static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser) /* {{{ */ { zval *data, *return_value = (zval*)puser; - data = iter->funcs->get_current_data(iter TSRMLS_CC); + data = iter->funcs->get_current_data(iter); if (EG(exception)) { return ZEND_HASH_APPLY_STOP; } @@ -3552,11 +3552,11 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T } if (iter->funcs->get_current_key) { zval key; - iter->funcs->get_current_key(iter, &key TSRMLS_CC); + iter->funcs->get_current_key(iter, &key); if (EG(exception)) { return ZEND_HASH_APPLY_STOP; } - array_set_zval_key(Z_ARRVAL_P(return_value), &key, data TSRMLS_CC); + array_set_zval_key(Z_ARRVAL_P(return_value), &key, data); zval_dtor(&key); } else { Z_TRY_ADDREF_P(data); @@ -3566,11 +3566,11 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T } /* }}} */ -static int spl_iterator_to_values_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ +static int spl_iterator_to_values_apply(zend_object_iterator *iter, void *puser) /* {{{ */ { zval *data, *return_value = (zval*)puser; - data = iter->funcs->get_current_data(iter TSRMLS_CC); + data = iter->funcs->get_current_data(iter); if (EG(exception)) { return ZEND_HASH_APPLY_STOP; } @@ -3592,19 +3592,19 @@ PHP_FUNCTION(iterator_to_array) zval *obj; zend_bool use_keys = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &obj, zend_ce_traversable, &use_keys) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, zend_ce_traversable, &use_keys) == FAILURE) { RETURN_FALSE; } array_init(return_value); - if (spl_iterator_apply(obj, use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply, (void*)return_value TSRMLS_CC) != SUCCESS) { + if (spl_iterator_apply(obj, use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply, (void*)return_value) != SUCCESS) { zval_dtor(return_value); RETURN_NULL(); } } /* }}} */ -static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ +static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser) /* {{{ */ { (*(zend_long*)puser)++; return ZEND_HASH_APPLY_KEEP; @@ -3618,11 +3618,11 @@ PHP_FUNCTION(iterator_count) zval *obj; zend_long count = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, zend_ce_traversable) == FAILURE) { RETURN_FALSE; } - if (spl_iterator_apply(obj, spl_iterator_count_apply, (void*)&count TSRMLS_CC) == SUCCESS) { + if (spl_iterator_apply(obj, spl_iterator_count_apply, (void*)&count) == SUCCESS) { RETURN_LONG(count); } } @@ -3636,16 +3636,16 @@ typedef struct { zend_fcall_info_cache fcc; } spl_iterator_apply_info; -static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ +static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser) /* {{{ */ { zval retval; spl_iterator_apply_info *apply_info = (spl_iterator_apply_info*)puser; int result; apply_info->count++; - zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC); + zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL); if (Z_TYPE(retval) != IS_UNDEF) { - result = zend_is_true(&retval TSRMLS_CC) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; + result = zend_is_true(&retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; zval_ptr_dtor(&retval); } else { result = ZEND_HASH_APPLY_STOP; @@ -3661,18 +3661,18 @@ PHP_FUNCTION(iterator_apply) spl_iterator_apply_info apply_info; apply_info.args = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Of|a!", &apply_info.obj, zend_ce_traversable, &apply_info.fci, &apply_info.fcc, &apply_info.args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Of|a!", &apply_info.obj, zend_ce_traversable, &apply_info.fci, &apply_info.fcc, &apply_info.args) == FAILURE) { return; } apply_info.count = 0; - zend_fcall_info_args(&apply_info.fci, apply_info.args TSRMLS_CC); - if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)&apply_info TSRMLS_CC) == SUCCESS) { + zend_fcall_info_args(&apply_info.fci, apply_info.args); + if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)&apply_info) == SUCCESS) { RETVAL_LONG(apply_info.count); } else { RETVAL_FALSE; } - zend_fcall_info_args(&apply_info.fci, NULL TSRMLS_CC); + zend_fcall_info_args(&apply_info.fci, NULL); } /* }}} */ diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h index 76f0b45e57..a0a2893ef5 100644 --- a/ext/spl/spl_iterators.h +++ b/ext/spl/spl_iterators.h @@ -173,9 +173,9 @@ static inline spl_dual_it_object *spl_dual_it_from_obj(zend_object *obj) /* {{{ #define Z_SPLDUAL_IT_P(zv) spl_dual_it_from_obj(Z_OBJ_P((zv))) -typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser TSRMLS_DC); +typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser); -PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC); +PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser); #endif /* SPL_ITERATORS_H */ diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index f7f884df18..4b63caaed0 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -102,11 +102,11 @@ static inline spl_SplObjectStorage *spl_object_storage_from_obj(zend_object *obj #define Z_SPLOBJSTORAGE_P(zv) spl_object_storage_from_obj(Z_OBJ_P((zv))) -void spl_SplObjectStorage_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ +void spl_SplObjectStorage_free_storage(zend_object *object) /* {{{ */ { spl_SplObjectStorage *intern = spl_object_storage_from_obj(object); - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); zend_hash_destroy(&intern->storage); @@ -116,7 +116,7 @@ void spl_SplObjectStorage_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ } } /* }}} */ -static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) { +static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zval *this, zval *obj) { if (intern->fptr_get_hash) { zval rv; zend_call_method_with_1_params(this, intern->std.ce, &intern->fptr_get_hash, "getHash", &rv, obj); @@ -124,7 +124,7 @@ static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zv if (Z_TYPE(rv) == IS_STRING) { return Z_STR(rv); } else { - zend_throw_exception(spl_ce_RuntimeException, "Hash needs to be a string", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Hash needs to be a string", 0); zval_ptr_dtor(&rv); return NULL; @@ -190,21 +190,21 @@ static void spl_object_storage_dtor(zval *element) /* {{{ */ efree(el); } /* }}} */ -spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, zend_string *hash TSRMLS_DC) /* {{{ */ +spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, zend_string *hash) /* {{{ */ { return (spl_SplObjectStorageElement*)zend_hash_find_ptr(&intern->storage, hash); } /* }}} */ -spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf TSRMLS_DC) /* {{{ */ +spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf) /* {{{ */ { spl_SplObjectStorageElement *pelement, element; - zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC); + zend_string *hash = spl_object_storage_get_hash(intern, this, obj); if (!hash) { return NULL; } - pelement = spl_object_storage_get(intern, hash TSRMLS_CC); + pelement = spl_object_storage_get(intern, hash); if (pelement) { zval_ptr_dtor(&pelement->inf); @@ -228,10 +228,10 @@ spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *int return pelement; } /* }}} */ -int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {{{ */ +int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */ { int ret = FAILURE; - zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC); + zend_string *hash = spl_object_storage_get_hash(intern, this, obj); if (!hash) { return ret; } @@ -241,17 +241,17 @@ int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *ob return ret; } /* }}}*/ -void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_SplObjectStorage *other TSRMLS_DC) { /* {{{ */ +void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_SplObjectStorage *other) { /* {{{ */ spl_SplObjectStorageElement *element; ZEND_HASH_FOREACH_PTR(&other->storage, element) { - spl_object_storage_attach(intern, this, &element->obj, &element->inf TSRMLS_CC); + spl_object_storage_attach(intern, this, &element->obj, &element->inf); } ZEND_HASH_FOREACH_END(); intern->index = 0; } /* }}} */ -static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval *orig TSRMLS_DC) /* {{{ */ +static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval *orig) /* {{{ */ { spl_SplObjectStorage *intern; zend_class_entry *parent = class_type; @@ -260,7 +260,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval memset(intern, 0, sizeof(spl_SplObjectStorage) - sizeof(zval)); intern->pos = INVALID_IDX; - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); zend_hash_init(&intern->storage, 0, NULL, spl_object_storage_dtor, 0); @@ -269,7 +269,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval if (orig) { spl_SplObjectStorage *other = Z_SPLOBJSTORAGE_P(orig); - spl_object_storage_addall(intern, orig, other TSRMLS_CC); + spl_object_storage_addall(intern, orig, other); } while (parent) { @@ -291,21 +291,21 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval /* }}} */ /* {{{ spl_object_storage_clone */ -static zend_object *spl_object_storage_clone(zval *zobject TSRMLS_DC) +static zend_object *spl_object_storage_clone(zval *zobject) { zend_object *old_object; zend_object *new_object; old_object = Z_OBJ_P(zobject); - new_object = spl_object_storage_new_ex(old_object->ce, zobject TSRMLS_CC); + new_object = spl_object_storage_new_ex(old_object->ce, zobject); - zend_objects_clone_members(new_object, old_object TSRMLS_CC); + zend_objects_clone_members(new_object, old_object); return new_object; } /* }}} */ -static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ +static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp) /* {{{ */ { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(obj); spl_SplObjectStorageElement *element; @@ -330,7 +330,7 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D array_init(&storage); ZEND_HASH_FOREACH_PTR(&intern->storage, element) { - md5str = php_spl_object_hash(&element->obj TSRMLS_CC); + md5str = php_spl_object_hash(&element->obj); array_init(&tmp); /* Incrementing the refcount of obj and inf would confuse the garbage collector. * Prefer to null the destructor */ @@ -341,7 +341,7 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D zend_string_release(md5str); } ZEND_HASH_FOREACH_END(); - zname = spl_gen_private_prop_name(spl_ce_SplObjectStorage, "storage", sizeof("storage")-1 TSRMLS_CC); + zname = spl_gen_private_prop_name(spl_ce_SplObjectStorage, "storage", sizeof("storage")-1); zend_symtable_update(intern->debug_info, zname, &storage); zend_string_release(zname); } @@ -352,14 +352,14 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D /* overriden for garbage collection * This is very hacky */ -static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{ */ +static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n) /* {{{ */ { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(obj); spl_SplObjectStorageElement *element; HashTable *props; zval *gcdata_arr, tmp; - props = std_object_handlers.get_properties(obj TSRMLS_CC); + props = std_object_handlers.get_properties(obj); *table = NULL; *n = 0; @@ -388,13 +388,13 @@ static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n TSRM } /* }}} */ -static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{ */ +static int spl_object_storage_compare_info(zval *e1, zval *e2) /* {{{ */ { spl_SplObjectStorageElement *s1 = (spl_SplObjectStorageElement*)Z_PTR_P(e1); spl_SplObjectStorageElement *s2 = (spl_SplObjectStorageElement*)Z_PTR_P(e2); zval result; - if (compare_function(&result, &s1->inf, &s2->inf TSRMLS_CC) == FAILURE) { + if (compare_function(&result, &s1->inf, &s2->inf) == FAILURE) { return 1; } @@ -402,7 +402,7 @@ static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{ } /* }}} */ -static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */ +static int spl_object_storage_compare_objects(zval *o1, zval *o2) /* {{{ */ { zend_object *zo1 = (zend_object *)Z_OBJ_P(o1); zend_object *zo2 = (zend_object *)Z_OBJ_P(o2); @@ -411,21 +411,21 @@ static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* { return 1; } - return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0 TSRMLS_CC); + return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0); } /* }}} */ /* {{{ spl_array_object_new */ -static zend_object *spl_SplObjectStorage_new(zend_class_entry *class_type TSRMLS_DC) +static zend_object *spl_SplObjectStorage_new(zend_class_entry *class_type) { - return spl_object_storage_new_ex(class_type, NULL TSRMLS_CC); + return spl_object_storage_new_ex(class_type, NULL); } /* }}} */ -int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {{{ */ +int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */ { int found; - zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC); + zend_string *hash = spl_object_storage_get_hash(intern, this, obj); if (!hash) { return 0; } @@ -443,10 +443,10 @@ SPL_METHOD(SplObjectStorage, attach) spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|z!", &obj, &inf) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|z!", &obj, &inf) == FAILURE) { return; } - spl_object_storage_attach(intern, getThis(), obj, inf TSRMLS_CC); + spl_object_storage_attach(intern, getThis(), obj, inf); } /* }}} */ /* {{{ proto void SplObjectStorage::detach($obj) @@ -456,10 +456,10 @@ SPL_METHOD(SplObjectStorage, detach) zval *obj; spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { return; } - spl_object_storage_detach(intern, getThis(), obj TSRMLS_CC); + spl_object_storage_detach(intern, getThis(), obj); zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); intern->index = 0; @@ -471,11 +471,11 @@ SPL_METHOD(SplObjectStorage, getHash) { zval *obj; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { return; } - RETURN_NEW_STR(php_spl_object_hash(obj TSRMLS_CC)); + RETURN_NEW_STR(php_spl_object_hash(obj)); } /* }}} */ @@ -488,20 +488,20 @@ SPL_METHOD(SplObjectStorage, offsetGet) spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); zend_string *hash; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { return; } - hash = spl_object_storage_get_hash(intern, getThis(), obj TSRMLS_CC); + hash = spl_object_storage_get_hash(intern, getThis(), obj); if (!hash) { return; } - element = spl_object_storage_get(intern, hash TSRMLS_CC); + element = spl_object_storage_get(intern, hash); spl_object_storage_free_hash(intern, hash); if (!element) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Object not found"); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Object not found"); } else { RETURN_ZVAL(&element->inf, 1, 0); } @@ -515,13 +515,13 @@ SPL_METHOD(SplObjectStorage, addAll) spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); spl_SplObjectStorage *other; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) { return; } other = Z_SPLOBJSTORAGE_P(obj); - spl_object_storage_addall(intern, getThis(), other TSRMLS_CC); + spl_object_storage_addall(intern, getThis(), other); RETURN_LONG(zend_hash_num_elements(&intern->storage)); } /* }}} */ @@ -535,7 +535,7 @@ SPL_METHOD(SplObjectStorage, removeAll) spl_SplObjectStorage *other; spl_SplObjectStorageElement *element; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) { return; } @@ -543,7 +543,7 @@ SPL_METHOD(SplObjectStorage, removeAll) zend_hash_internal_pointer_reset(&other->storage); while ((element = zend_hash_get_current_data_ptr(&other->storage)) != NULL) { - if (spl_object_storage_detach(intern, getThis(), &element->obj TSRMLS_CC) == FAILURE) { + if (spl_object_storage_detach(intern, getThis(), &element->obj) == FAILURE) { zend_hash_move_forward(&other->storage); } } @@ -563,15 +563,15 @@ SPL_METHOD(SplObjectStorage, removeAllExcept) spl_SplObjectStorage *other; spl_SplObjectStorageElement *element; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) { return; } other = Z_SPLOBJSTORAGE_P(obj); ZEND_HASH_FOREACH_PTR(&intern->storage, element) { - if (!spl_object_storage_contains(other, getThis(), &element->obj TSRMLS_CC)) { - spl_object_storage_detach(intern, getThis(), &element->obj TSRMLS_CC); + if (!spl_object_storage_contains(other, getThis(), &element->obj)) { + spl_object_storage_detach(intern, getThis(), &element->obj); } } ZEND_HASH_FOREACH_END(); @@ -589,10 +589,10 @@ SPL_METHOD(SplObjectStorage, contains) zval *obj; spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { return; } - RETURN_BOOL(spl_object_storage_contains(intern, getThis(), obj TSRMLS_CC)); + RETURN_BOOL(spl_object_storage_contains(intern, getThis(), obj)); } /* }}} */ /* {{{ proto int SplObjectStorage::count() @@ -602,7 +602,7 @@ SPL_METHOD(SplObjectStorage, count) spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); zend_long mode = COUNT_NORMAL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) { return; } @@ -611,7 +611,7 @@ SPL_METHOD(SplObjectStorage, count) zval *element; ZEND_HASH_FOREACH_VAL(&intern->storage, element) { - ret += php_count_recursive(element, mode TSRMLS_CC); + ret += php_count_recursive(element, mode); } ZEND_HASH_FOREACH_END(); RETURN_LONG(ret); @@ -703,7 +703,7 @@ SPL_METHOD(SplObjectStorage, setInfo) spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); zval *inf; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &inf) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &inf) == FAILURE) { return; } @@ -749,7 +749,7 @@ SPL_METHOD(SplObjectStorage, serialize) /* storage */ smart_str_appendl(&buf, "x:", 2); ZVAL_LONG(&flags, zend_hash_num_elements(&intern->storage)); - php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &flags, &var_hash); zval_ptr_dtor(&flags); zend_hash_internal_pointer_reset_ex(&intern->storage, &pos); @@ -760,9 +760,9 @@ SPL_METHOD(SplObjectStorage, serialize) PHP_VAR_SERIALIZE_DESTROY(var_hash); RETURN_NULL(); } - php_var_serialize(&buf, &element->obj, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &element->obj, &var_hash); smart_str_appendc(&buf, ','); - php_var_serialize(&buf, &element->inf, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &element->inf, &var_hash); smart_str_appendc(&buf, ';'); zend_hash_move_forward_ex(&intern->storage, &pos); } @@ -770,8 +770,8 @@ SPL_METHOD(SplObjectStorage, serialize) /* members */ smart_str_appendl(&buf, "m:", 2); ZVAL_NEW_ARR(&members); - zend_array_dup(Z_ARRVAL(members), zend_std_get_properties(getThis() TSRMLS_CC)); - php_var_serialize(&buf, &members, &var_hash TSRMLS_CC); /* finishes the string */ + zend_array_dup(Z_ARRVAL(members), zend_std_get_properties(getThis())); + php_var_serialize(&buf, &members, &var_hash); /* finishes the string */ zval_ptr_dtor(&members); /* done */ @@ -799,7 +799,7 @@ SPL_METHOD(SplObjectStorage, unserialize) spl_SplObjectStorageElement *element; zend_long count; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) { return; } @@ -816,7 +816,7 @@ SPL_METHOD(SplObjectStorage, unserialize) } ++p; - if (!php_var_unserialize(&pcount, &p, s + buf_len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&pcount, &p, s + buf_len, &var_hash)) { goto outexcept; } if (Z_TYPE(pcount) != IS_LONG) { @@ -839,7 +839,7 @@ SPL_METHOD(SplObjectStorage, unserialize) goto outexcept; } /* sore reference to allow cross-references between different elements */ - if (!php_var_unserialize(&entry, &p, s + buf_len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&entry, &p, s + buf_len, &var_hash)) { goto outexcept; } if (Z_TYPE(entry) != IS_OBJECT) { @@ -848,19 +848,19 @@ SPL_METHOD(SplObjectStorage, unserialize) } if (*p == ',') { /* new version has inf */ ++p; - if (!php_var_unserialize(&inf, &p, s + buf_len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&inf, &p, s + buf_len, &var_hash)) { zval_ptr_dtor(&entry); goto outexcept; } } - hash = spl_object_storage_get_hash(intern, getThis(), &entry TSRMLS_CC); + hash = spl_object_storage_get_hash(intern, getThis(), &entry); if (!hash) { zval_ptr_dtor(&entry); zval_ptr_dtor(&inf); goto outexcept; } - pelement = spl_object_storage_get(intern, hash TSRMLS_CC); + pelement = spl_object_storage_get(intern, hash); spl_object_storage_free_hash(intern, hash); if (pelement) { if (!Z_ISUNDEF(pelement->inf)) { @@ -870,7 +870,7 @@ SPL_METHOD(SplObjectStorage, unserialize) var_push_dtor(&var_hash, &pelement->obj); } } - element = spl_object_storage_attach(intern, getThis(), &entry, &inf TSRMLS_CC); + element = spl_object_storage_attach(intern, getThis(), &entry, &inf); var_replace(&var_hash, &entry, &element->obj); var_replace(&var_hash, &inf, &element->inf); zval_ptr_dtor(&entry); @@ -889,7 +889,7 @@ SPL_METHOD(SplObjectStorage, unserialize) ++p; ZVAL_UNDEF(&pmembers); - if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(pmembers) != IS_ARRAY) { + if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash) || Z_TYPE(pmembers) != IS_ARRAY) { zval_ptr_dtor(&pmembers); goto outexcept; } @@ -906,7 +906,7 @@ SPL_METHOD(SplObjectStorage, unserialize) outexcept: PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len); return; } /* }}} */ @@ -986,16 +986,16 @@ SPL_METHOD(MultipleIterator, __construct) zend_long flags = MIT_NEED_ALL|MIT_KEYS_NUMERIC; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flags) == FAILURE) { + zend_restore_error_handling(&error_handling); return; } intern = Z_SPLOBJSTORAGE_P(getThis()); intern->flags = flags; - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -1019,7 +1019,7 @@ SPL_METHOD(MultipleIterator, setFlags) spl_SplObjectStorage *intern; intern = Z_SPLOBJSTORAGE_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) { return; } } @@ -1032,7 +1032,7 @@ SPL_METHOD(MultipleIterator, attachIterator) spl_SplObjectStorage *intern; zval *iterator = NULL, *info = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|z!", &iterator, zend_ce_iterator, &info) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!", &iterator, zend_ce_iterator, &info) == FAILURE) { return; } @@ -1043,22 +1043,22 @@ SPL_METHOD(MultipleIterator, attachIterator) zval compare_result; if (Z_TYPE_P(info) != IS_LONG && Z_TYPE_P(info) != IS_STRING) { - zend_throw_exception(spl_ce_InvalidArgumentException, "Info must be NULL, integer or string", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Info must be NULL, integer or string", 0); return; } zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL) { - is_identical_function(&compare_result, info, &element->inf TSRMLS_CC); + is_identical_function(&compare_result, info, &element->inf); if (Z_TYPE(compare_result) == IS_TRUE) { - zend_throw_exception(spl_ce_InvalidArgumentException, "Key duplication error", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Key duplication error", 0); return; } zend_hash_move_forward_ex(&intern->storage, &intern->pos); } } - spl_object_storage_attach(intern, getThis(), iterator, info TSRMLS_CC); + spl_object_storage_attach(intern, getThis(), iterator, info); } /* }}} */ @@ -1152,7 +1152,7 @@ SPL_METHOD(MultipleIterator, valid) } /* }}} */ -static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_value TSRMLS_DC) /* {{{ */ +static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_value) /* {{{ */ { spl_SplObjectStorageElement *element; zval *it, retval; @@ -1184,14 +1184,14 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_ zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_key, "key", &retval); } if (Z_ISUNDEF(retval)) { - zend_throw_exception(spl_ce_RuntimeException, "Failed to call sub iterator method", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Failed to call sub iterator method", 0); return; } } else if (intern->flags & MIT_NEED_ALL) { if (SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT == get_type) { - zend_throw_exception(spl_ce_RuntimeException, "Called current() with non valid sub iterator", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Called current() with non valid sub iterator", 0); } else { - zend_throw_exception(spl_ce_RuntimeException, "Called key() with non valid sub iterator", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_RuntimeException, "Called key() with non valid sub iterator", 0); } return; } else { @@ -1208,7 +1208,7 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_ break; default: zval_ptr_dtor(&retval); - zend_throw_exception(spl_ce_InvalidArgumentException, "Sub-Iterator is associated with NULL", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Sub-Iterator is associated with NULL", 0); return; } } else { @@ -1231,7 +1231,7 @@ SPL_METHOD(MultipleIterator, current) return; } - spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value TSRMLS_CC); + spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value); } /* }}} */ @@ -1246,7 +1246,7 @@ SPL_METHOD(MultipleIterator, key) return; } - spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value TSRMLS_CC); + spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value); } /* }}} */ -- cgit v1.2.1 From e112f6a04e0cddc6276c426c09c0249201878f5a Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 14 Dec 2014 14:07:59 +0100 Subject: second shot on removing TSRMLS_* --- ext/spl/spl_directory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/spl') diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 8e67e8af90..2d8a1d62bd 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -247,8 +247,8 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path) intern->u.dir.entry.d_name[0] = '\0'; if (!EG(exception)) { /* open failed w/out notice (turned to exception due to EH_THROW) */ - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 - TSRMLS_CC, "Failed to open directory \"%s\"", path); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, + "Failed to open directory \"%s\"", path); } } else { do { -- cgit v1.2.1