diff options
author | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
commit | bdeb220f48825642f84cdbf3ff23a30613c92e86 (patch) | |
tree | 1a6cf34d20420e4815b4becb21311a4457d84103 /ext/standard | |
parent | bb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff) | |
download | php-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz |
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/standard')
89 files changed, 1979 insertions, 1991 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 1f03e5acb8..998b568846 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -141,7 +141,7 @@ PHP_MSHUTDOWN_FUNCTION(array) /* {{{ */ } /* }}} */ -static void php_set_compare_func(zend_long sort_type TSRMLS_DC) /* {{{ */ +static void php_set_compare_func(zend_long sort_type) /* {{{ */ { switch (sort_type & ~PHP_SORT_FLAG_CASE) { case PHP_SORT_NUMERIC: @@ -170,7 +170,7 @@ static void php_set_compare_func(zend_long sort_type TSRMLS_DC) /* {{{ */ } /* }}} */ -static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_key_compare(const void *a, const void *b) /* {{{ */ { Bucket *f; Bucket *s; @@ -193,7 +193,7 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ ZVAL_STR(&second, s->key); } - if (ARRAYG(compare_func)(&result, &first, &second TSRMLS_CC) == FAILURE) { + if (ARRAYG(compare_func)(&result, &first, &second) == FAILURE) { return 0; } @@ -207,9 +207,9 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ } /* }}} */ -static int php_array_reverse_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_reverse_key_compare(const void *a, const void *b) /* {{{ */ { - return php_array_key_compare(a, b TSRMLS_CC) * -1; + return php_array_key_compare(a, b) * -1; } /* }}} */ @@ -220,13 +220,13 @@ PHP_FUNCTION(krsort) zval *array; zend_long sort_type = PHP_SORT_REGULAR; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) { RETURN_FALSE; } - php_set_compare_func(sort_type TSRMLS_CC); + php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_key_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_key_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -240,27 +240,27 @@ PHP_FUNCTION(ksort) zval *array; zend_long sort_type = PHP_SORT_REGULAR; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) { RETURN_FALSE; } - php_set_compare_func(sort_type TSRMLS_CC); + php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; } /* }}} */ -PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC) /* {{{ */ +PHPAPI zend_long php_count_recursive(zval *array, zend_long mode) /* {{{ */ { zend_long cnt = 0; zval *element; if (Z_TYPE_P(array) == IS_ARRAY) { if (Z_ARRVAL_P(array)->u.v.nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); + php_error_docref(NULL, E_WARNING, "recursion detected"); return 0; } @@ -271,7 +271,7 @@ PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC) /* { } ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) { ZVAL_DEREF(element); - cnt += php_count_recursive(element, COUNT_RECURSIVE TSRMLS_CC); + cnt += php_count_recursive(element, COUNT_RECURSIVE); } ZEND_HASH_FOREACH_END(); if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(array))) { Z_ARRVAL_P(array)->u.v.nApplyCount--; @@ -293,7 +293,7 @@ PHP_FUNCTION(count) zval *element; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &array, &mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &array, &mode) == FAILURE) { return; } #else @@ -313,7 +313,7 @@ PHP_FUNCTION(count) if (mode == COUNT_RECURSIVE) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) { ZVAL_DEREF(element); - cnt += php_count_recursive(element, COUNT_RECURSIVE TSRMLS_CC); + cnt += php_count_recursive(element, COUNT_RECURSIVE); } ZEND_HASH_FOREACH_END(); } RETURN_LONG(cnt); @@ -325,13 +325,13 @@ PHP_FUNCTION(count) /* first, we check if the handler is defined */ if (Z_OBJ_HT_P(array)->count_elements) { RETVAL_LONG(1); - if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value) TSRMLS_CC)) { + if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value))) { return; } } #ifdef HAVE_SPL /* if not and the object implements Countable we call its count() method */ - if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) { + if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable)) { zend_call_method_with_0_params(array, NULL, NULL, "count", &retval); if (Z_TYPE(retval) != IS_UNDEF) { RETVAL_LONG(zval_get_long(&retval)); @@ -354,7 +354,7 @@ PHP_FUNCTION(count) * * This is not correct any more, depends on what compare_func is set to. */ -static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_data_compare(const void *a, const void *b) /* {{{ */ { Bucket *f; Bucket *s; @@ -374,7 +374,7 @@ static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ if (Z_TYPE_P(second) == IS_INDIRECT) { second = Z_INDIRECT_P(second); } - if (ARRAYG(compare_func)(&result, first, second TSRMLS_CC) == FAILURE) { + if (ARRAYG(compare_func)(&result, first, second) == FAILURE) { return 0; } @@ -388,13 +388,13 @@ static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ } /* }}} */ -static int php_array_reverse_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_reverse_data_compare(const void *a, const void *b) /* {{{ */ { - return php_array_data_compare(a, b TSRMLS_CC) * -1; + return php_array_data_compare(a, b) * -1; } /* }}} */ -static int php_array_natural_general_compare(const void *a, const void *b, int fold_case TSRMLS_DC) /* {{{ */ +static int php_array_natural_general_compare(const void *a, const void *b, int fold_case) /* {{{ */ { Bucket *f = (Bucket *) a; Bucket *s = (Bucket *) b; @@ -409,15 +409,15 @@ static int php_array_natural_general_compare(const void *a, const void *b, int f } /* }}} */ -static int php_array_natural_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_natural_compare(const void *a, const void *b) /* {{{ */ { - return php_array_natural_general_compare(a, b, 0 TSRMLS_CC); + return php_array_natural_general_compare(a, b, 0); } /* }}} */ -static int php_array_natural_case_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_natural_case_compare(const void *a, const void *b) /* {{{ */ { - return php_array_natural_general_compare(a, b, 1 TSRMLS_CC); + return php_array_natural_general_compare(a, b, 1); } /* }}} */ @@ -425,16 +425,16 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case) /* {{{ */ { zval *array; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &array) == FAILURE) { return; } if (fold_case) { - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_case_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_case_compare, 0) == FAILURE) { return; } } else { - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_compare, 0) == FAILURE) { return; } } @@ -466,13 +466,13 @@ PHP_FUNCTION(asort) zval *array; zend_long sort_type = PHP_SORT_REGULAR; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) { RETURN_FALSE; } - php_set_compare_func(sort_type TSRMLS_CC); + php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -486,13 +486,13 @@ PHP_FUNCTION(arsort) zval *array; zend_long sort_type = PHP_SORT_REGULAR; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) { RETURN_FALSE; } - php_set_compare_func(sort_type TSRMLS_CC); + php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -506,13 +506,13 @@ PHP_FUNCTION(sort) zval *array; zend_long sort_type = PHP_SORT_REGULAR; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) { RETURN_FALSE; } - php_set_compare_func(sort_type TSRMLS_CC); + php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 1 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 1) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -526,20 +526,20 @@ PHP_FUNCTION(rsort) zval *array; zend_long sort_type = PHP_SORT_REGULAR; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) { RETURN_FALSE; } - php_set_compare_func(sort_type TSRMLS_CC); + php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 1 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 1) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; } /* }}} */ -static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_user_compare(const void *a, const void *b) /* {{{ */ { Bucket *f; Bucket *s; @@ -556,7 +556,7 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{ BG(user_compare_fci).params = args; BG(user_compare_fci).retval = &retval; BG(user_compare_fci).no_separation = 0; - if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { zend_long ret = zval_get_long(&retval); zval_ptr_dtor(&retval); zval_ptr_dtor(&args[1]); @@ -572,8 +572,8 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{ /* check if comparison function is valid */ #define PHP_ARRAY_CMP_FUNC_CHECK(func_name) \ - if (!zend_is_callable(*func_name, 0, NULL TSRMLS_CC)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid comparison function"); \ + if (!zend_is_callable(*func_name, 0, NULL)) { \ + php_error_docref(NULL, E_WARNING, "Invalid comparison function"); \ BG(user_compare_fci) = old_user_compare_fci; \ BG(user_compare_fci_cache) = old_user_compare_fci_cache; \ RETURN_FALSE; \ @@ -610,7 +610,7 @@ PHP_FUNCTION(usort) PHP_ARRAY_CMP_FUNC_BACKUP(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { PHP_ARRAY_CMP_FUNC_RESTORE(); return; } @@ -625,11 +625,11 @@ PHP_FUNCTION(usort) refcount = Z_REFCOUNT_P(array); arr = Z_COUNTED_P(array); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 1 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 1) == FAILURE) { RETVAL_FALSE; } else { if (refcount > Z_REFCOUNT_P(array)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function"); + php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function"); if (--GC_REFCOUNT(arr) <= 0) { _zval_dtor_func(arr ZEND_FILE_LINE_CC); } @@ -655,7 +655,7 @@ PHP_FUNCTION(uasort) PHP_ARRAY_CMP_FUNC_BACKUP(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { PHP_ARRAY_CMP_FUNC_RESTORE(); return; } @@ -670,11 +670,11 @@ PHP_FUNCTION(uasort) refcount = Z_REFCOUNT_P(array); arr = Z_COUNTED_P(array); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 0) == FAILURE) { RETVAL_FALSE; } else { if (refcount > Z_REFCOUNT_P(array)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function"); + php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function"); if (--GC_REFCOUNT(arr) <= 0) { _zval_dtor_func(arr ZEND_FILE_LINE_CC); } @@ -689,7 +689,7 @@ PHP_FUNCTION(uasort) } /* }}} */ -static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_array_user_key_compare(const void *a, const void *b) /* {{{ */ { Bucket *f; Bucket *s; @@ -718,7 +718,7 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* BG(user_compare_fci).params = args; BG(user_compare_fci).retval = &retval; BG(user_compare_fci).no_separation = 0; - if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { result = zval_get_long(&retval); zval_ptr_dtor(&retval); } else { @@ -743,7 +743,7 @@ PHP_FUNCTION(uksort) PHP_ARRAY_CMP_FUNC_BACKUP(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { PHP_ARRAY_CMP_FUNC_RESTORE(); return; } @@ -758,11 +758,11 @@ PHP_FUNCTION(uksort) refcount = Z_REFCOUNT_P(array); arr = Z_COUNTED_P(array); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0 TSRMLS_CC) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0) == FAILURE) { RETVAL_FALSE; } else { if (refcount > Z_REFCOUNT_P(array)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function"); + php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function"); if (--GC_REFCOUNT(arr) <= 0) { _zval_dtor_func(arr ZEND_FILE_LINE_CC); } @@ -785,7 +785,7 @@ PHP_FUNCTION(end) zval *entry; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) { return; } #else @@ -818,7 +818,7 @@ PHP_FUNCTION(prev) zval *entry; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) { return; } #else @@ -851,7 +851,7 @@ PHP_FUNCTION(next) zval *entry; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) { return; } #else @@ -884,7 +884,7 @@ PHP_FUNCTION(reset) zval *entry; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) { return; } #else @@ -917,7 +917,7 @@ PHP_FUNCTION(current) zval *entry; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) { return; } #else @@ -945,7 +945,7 @@ PHP_FUNCTION(key) HashTable *array; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) { return; } #else @@ -965,24 +965,24 @@ PHP_FUNCTION(min) int argc; zval *args = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } - php_set_compare_func(PHP_SORT_REGULAR TSRMLS_CC); + php_set_compare_func(PHP_SORT_REGULAR); /* mixed min ( array $values ) */ if (argc == 1) { zval *result; if (Z_TYPE(args[0]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "When only one parameter is given, it must be an array"); + php_error_docref(NULL, E_WARNING, "When only one parameter is given, it must be an array"); RETVAL_NULL(); } else { - if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0 TSRMLS_CC)) != NULL) { + if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0)) != NULL) { RETVAL_ZVAL_FAST(result); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); + php_error_docref(NULL, E_WARNING, "Array must contain at least one element"); RETVAL_FALSE; } } @@ -994,7 +994,7 @@ PHP_FUNCTION(min) min = &args[0]; for (i = 1; i < argc; i++) { - is_smaller_function(&result, &args[i], min TSRMLS_CC); + is_smaller_function(&result, &args[i], min); if (Z_TYPE(result) == IS_TRUE) { min = &args[i]; } @@ -1012,24 +1012,24 @@ PHP_FUNCTION(max) zval *args = NULL; int argc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } - php_set_compare_func(PHP_SORT_REGULAR TSRMLS_CC); + php_set_compare_func(PHP_SORT_REGULAR); /* mixed max ( array $values ) */ if (argc == 1) { zval *result; if (Z_TYPE(args[0]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "When only one parameter is given, it must be an array"); + php_error_docref(NULL, E_WARNING, "When only one parameter is given, it must be an array"); RETVAL_NULL(); } else { - if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1 TSRMLS_CC)) != NULL) { + if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1)) != NULL) { RETVAL_ZVAL_FAST(result); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); + php_error_docref(NULL, E_WARNING, "Array must contain at least one element"); RETVAL_FALSE; } } @@ -1041,7 +1041,7 @@ PHP_FUNCTION(max) max = &args[0]; for (i = 1; i < argc; i++) { - is_smaller_or_equal_function(&result, &args[i], max TSRMLS_CC); + is_smaller_or_equal_function(&result, &args[i], max); if (Z_TYPE(result) == IS_FALSE) { max = &args[i]; } @@ -1052,7 +1052,7 @@ PHP_FUNCTION(max) } /* }}} */ -static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive TSRMLS_DC) /* {{{ */ +static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive) /* {{{ */ { zval args[3], /* Arguments to userland function */ retval, /* Return value - unused */ @@ -1094,7 +1094,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive thash = Z_ARRVAL_P(zv); } if (thash->u.v.nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); + php_error_docref(NULL, E_WARNING, "recursion detected"); if (userdata) { zval_ptr_dtor(&args[2]); } @@ -1106,7 +1106,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive orig_array_walk_fci_cache = BG(array_walk_fci_cache); thash->u.v.nApplyCount++; - php_array_walk(thash, userdata, recursive TSRMLS_CC); + php_array_walk(thash, userdata, recursive); thash->u.v.nApplyCount--; /* restore the fcall info and cache */ @@ -1121,7 +1121,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive zend_hash_get_current_key_zval(target_hash, &args[1]); /* Call the userland function */ - if (zend_call_function(&BG(array_walk_fci), &BG(array_walk_fci_cache) TSRMLS_CC) == SUCCESS) { + if (zend_call_function(&BG(array_walk_fci), &BG(array_walk_fci_cache)) == SUCCESS) { if (!was_ref && Z_ISREF(args[0])) { /* copy reference back */ zval garbage; @@ -1170,7 +1170,7 @@ PHP_FUNCTION(array_walk) orig_array_walk_fci_cache = BG(array_walk_fci_cache); #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; return; @@ -1188,7 +1188,7 @@ PHP_FUNCTION(array_walk) ); #endif - php_array_walk(array, userdata, 0 TSRMLS_CC); + php_array_walk(array, userdata, 0); BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; RETURN_TRUE; @@ -1207,13 +1207,13 @@ PHP_FUNCTION(array_walk_recursive) orig_array_walk_fci = BG(array_walk_fci); orig_array_walk_fci_cache = BG(array_walk_fci_cache); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) { BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; return; } - php_array_walk(array, userdata, 1 TSRMLS_CC); + php_array_walk(array, userdata, 1); BG(array_walk_fci) = orig_array_walk_fci; BG(array_walk_fci_cache) = orig_array_walk_fci_cache; RETURN_TRUE; @@ -1235,7 +1235,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{ zend_bool strict = 0; /* strict comparison or not */ #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za|b", &value, &array, &strict) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "za|b", &value, &array, &strict) == FAILURE) { return; } #else @@ -1250,7 +1250,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{ if (strict) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) { ZVAL_DEREF(entry); - is_identical_function(&res, value, entry TSRMLS_CC); + is_identical_function(&res, value, entry); if (Z_TYPE(res) == IS_TRUE) { if (behavior == 0) { RETURN_TRUE; @@ -1266,7 +1266,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{ } ZEND_HASH_FOREACH_END(); } else { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) { - if (fast_equal_check_function(&res, value, entry TSRMLS_CC)) { + if (fast_equal_check_function(&res, value, entry)) { if (behavior == 0) { RETURN_TRUE; } else { @@ -1338,7 +1338,7 @@ static int php_valid_var_name(char *var_name, size_t var_name_len) /* {{{ */ } /* }}} */ -PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore TSRMLS_DC) /* {{{ */ +PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore) /* {{{ */ { ZVAL_NEW_STR(result, zend_string_alloc(Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0) + var_name_len, 0)); memcpy(Z_STRVAL_P(result), Z_STRVAL_P(prefix), Z_STRLEN_P(prefix)); @@ -1366,7 +1366,7 @@ PHP_FUNCTION(extract) int extract_refs = 0; zend_array *symbol_table; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|lz/", &var_array, &extract_type, &prefix) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|lz/", &var_array, &extract_type, &prefix) == FAILURE) { return; } @@ -1377,24 +1377,24 @@ PHP_FUNCTION(extract) extract_type &= 0xff; if (extract_type < EXTR_OVERWRITE || extract_type > EXTR_IF_EXISTS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid extract type"); + php_error_docref(NULL, E_WARNING, "Invalid extract type"); return; } if (extract_type > EXTR_SKIP && extract_type <= EXTR_PREFIX_IF_EXISTS && ZEND_NUM_ARGS() < 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "specified extract type requires the prefix parameter"); + php_error_docref(NULL, E_WARNING, "specified extract type requires the prefix parameter"); return; } if (prefix) { convert_to_string(prefix); if (Z_STRLEN_P(prefix) && !php_valid_var_name(Z_STRVAL_P(prefix), Z_STRLEN_P(prefix))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "prefix is not a valid identifier"); + php_error_docref(NULL, E_WARNING, "prefix is not a valid identifier"); return; } } - symbol_table = zend_rebuild_symbol_table(TSRMLS_C); + symbol_table = zend_rebuild_symbol_table(); ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(var_array), num_key, var_name, entry) { zval final_name; @@ -1409,7 +1409,7 @@ PHP_FUNCTION(extract) ZVAL_LONG(&num, num_key); convert_to_string(&num); - php_prefix_varname(&final_name, prefix, Z_STRVAL(num), Z_STRLEN(num), 1 TSRMLS_CC); + php_prefix_varname(&final_name, prefix, Z_STRVAL(num), Z_STRLEN(num), 1); zval_dtor(&num); } else { continue; @@ -1433,7 +1433,7 @@ PHP_FUNCTION(extract) case EXTR_PREFIX_IF_EXISTS: if (var_exists) { - php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC); + php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1); } break; @@ -1445,14 +1445,14 @@ PHP_FUNCTION(extract) case EXTR_PREFIX_ALL: if (Z_TYPE(final_name) == IS_NULL && var_name->len != 0) { - php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC); + php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1); } break; case EXTR_PREFIX_INVALID: if (Z_TYPE(final_name) == IS_NULL) { if (!php_valid_var_name(var_name->val, var_name->len)) { - php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC); + php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1); } else { ZVAL_STR_COPY(&final_name, var_name); } @@ -1484,7 +1484,7 @@ PHP_FUNCTION(extract) } } else { if (Z_REFCOUNTED_P(entry)) Z_ADDREF_P(entry); - zend_set_local_var(Z_STR(final_name), entry, 1 TSRMLS_CC); + zend_set_local_var(Z_STR(final_name), entry, 1); } count++; } @@ -1495,7 +1495,7 @@ PHP_FUNCTION(extract) } /* }}} */ -static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_value, zval *entry TSRMLS_DC) /* {{{ */ +static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_value, zval *entry) /* {{{ */ { zval *value_ptr, data; @@ -1507,7 +1507,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu } } else if (Z_TYPE_P(entry) == IS_ARRAY) { if ((Z_ARRVAL_P(entry)->u.v.nApplyCount > 1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); + php_error_docref(NULL, E_WARNING, "recursion detected"); return; } @@ -1515,7 +1515,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu Z_ARRVAL_P(entry)->u.v.nApplyCount++; } ZEND_HASH_FOREACH_VAL_IND(Z_ARRVAL_P(entry), value_ptr) { - php_compact_var(eg_active_symbol_table, return_value, value_ptr TSRMLS_CC); + php_compact_var(eg_active_symbol_table, return_value, value_ptr); } ZEND_HASH_FOREACH_END(); if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(entry))) { Z_ARRVAL_P(entry)->u.v.nApplyCount--; @@ -1532,11 +1532,11 @@ PHP_FUNCTION(compact) uint32_t num_args, i; zend_array *symbol_table; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) { return; } - symbol_table = zend_rebuild_symbol_table(TSRMLS_C); + symbol_table = zend_rebuild_symbol_table(); /* compact() is probably most used with a single array of var_names or multiple string names, rather than a combination of both. @@ -1548,7 +1548,7 @@ PHP_FUNCTION(compact) } for (i=0; i<ZEND_NUM_ARGS(); i++) { - php_compact_var(&symbol_table->ht, return_value, &args[i] TSRMLS_CC); + php_compact_var(&symbol_table->ht, return_value, &args[i]); } } /* }}} */ @@ -1560,12 +1560,12 @@ PHP_FUNCTION(array_fill) zval *val; zend_long start_key, num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llz", &start_key, &num, &val) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "llz", &start_key, &num, &val) == FAILURE) { return; } if (num < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements can't be negative"); + php_error_docref(NULL, E_WARNING, "Number of elements can't be negative"); RETURN_FALSE; } @@ -1585,7 +1585,7 @@ PHP_FUNCTION(array_fill) zval_add_ref(val); } else { zval_dtor(return_value); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied"); + php_error_docref(NULL, E_WARNING, "Cannot add element to the array as the next element is already occupied"); RETURN_FALSE; } } @@ -1598,7 +1598,7 @@ PHP_FUNCTION(array_fill_keys) { zval *keys, *val, *entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az", &keys, &val) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "az", &keys, &val) == FAILURE) { return; } @@ -1630,7 +1630,7 @@ PHP_FUNCTION(range) int err = 0, is_step_double = 0; double step = 1.0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &zlow, &zhigh, &zstep) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|z", &zlow, &zhigh, &zstep) == FAILURE) { RETURN_FALSE; } @@ -1778,14 +1778,14 @@ long_str: } err: if (err) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "step exceeds the specified range"); + php_error_docref(NULL, E_WARNING, "step exceeds the specified range"); zval_dtor(return_value); RETURN_FALSE; } } /* }}} */ -static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */ +static void php_array_data_shuffle(zval *array) /* {{{ */ { uint32_t idx, j, n_elems; Bucket *p, temp; @@ -1812,7 +1812,7 @@ static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */ } } while (--n_left) { - rnd_idx = php_rand(TSRMLS_C); + rnd_idx = php_rand(); RAND_RANGE(rnd_idx, 0, n_left, PHP_RAND_MAX); if (rnd_idx != n_left) { temp = hash->arData[n_left]; @@ -1847,11 +1847,11 @@ PHP_FUNCTION(shuffle) { zval *array; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &array) == FAILURE) { RETURN_FALSE; } - php_array_data_shuffle(array TSRMLS_CC); + php_array_data_shuffle(array); RETURN_TRUE; } @@ -1973,7 +1973,7 @@ PHP_FUNCTION(array_push) argc; /* Number of function arguments */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/+", &stack, &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/+", &stack, &args, &argc) == FAILURE) { return; } @@ -1983,7 +1983,7 @@ PHP_FUNCTION(array_push) if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var) == NULL) { if (Z_REFCOUNTED(new_var)) Z_DELREF(new_var); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied"); + php_error_docref(NULL, E_WARNING, "Cannot add element to the array as the next element is already occupied"); RETURN_FALSE; } } @@ -2003,7 +2003,7 @@ PHP_FUNCTION(array_pop) Bucket *p; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) { return; } #else @@ -2042,7 +2042,7 @@ PHP_FUNCTION(array_pop) /* Delete the last value */ if (p->key) { if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) { - zend_delete_global_variable(p->key TSRMLS_CC); + zend_delete_global_variable(p->key); } else { zend_hash_del(Z_ARRVAL_P(stack), p->key); } @@ -2064,7 +2064,7 @@ PHP_FUNCTION(array_shift) Bucket *p; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) { return; } #else @@ -2099,7 +2099,7 @@ PHP_FUNCTION(array_shift) /* Delete the first value */ if (p->key) { if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) { - zend_delete_global_variable(p->key TSRMLS_CC); + zend_delete_global_variable(p->key); } else { zend_hash_del(Z_ARRVAL_P(stack), p->key); } @@ -2161,7 +2161,7 @@ PHP_FUNCTION(array_unshift) HashTable old_hash; int argc; /* Number of function arguments */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/+", &stack, &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/+", &stack, &args, &argc) == FAILURE) { return; } @@ -2196,7 +2196,7 @@ PHP_FUNCTION(array_splice) repl_num = 0; /* Number of replacement elements */ int num_in; /* Number of elements in the input array */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/l|lz/", &array, &offset, &length, &repl_array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/l|lz/", &array, &offset, &length, &repl_array) == FAILURE) { return; } @@ -2276,7 +2276,7 @@ PHP_FUNCTION(array_slice) zend_ulong num_key; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) { return; } #else @@ -2348,7 +2348,7 @@ PHP_FUNCTION(array_slice) } /* }}} */ -PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */ +PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */ { zval *src_entry, *dest_entry; zend_string *string_key; @@ -2366,7 +2366,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC) ZVAL_DEREF(dest_zval); thash = Z_TYPE_P(dest_zval) == IS_ARRAY ? Z_ARRVAL_P(dest_zval) : NULL; if ((thash && thash->u.v.nApplyCount > 1) || (src_entry == dest_entry && Z_ISREF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); + php_error_docref(NULL, E_WARNING, "recursion detected"); return 0; } @@ -2397,7 +2397,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC) if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) { thash->u.v.nApplyCount++; } - ret = php_array_merge_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval) TSRMLS_CC); + ret = php_array_merge_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval)); if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) { thash->u.v.nApplyCount--; } @@ -2428,7 +2428,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC) } /* }}} */ -PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */ +PHPAPI int php_array_merge(HashTable *dest, HashTable *src) /* {{{ */ { zval *src_entry; zend_string *string_key; @@ -2450,7 +2450,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */ } /* }}} */ -PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */ +PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ */ { zval *src_entry, *dest_entry, *src_zval, *dest_zval; zend_string *string_key; @@ -2493,7 +2493,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC if (Z_ARRVAL_P(dest_zval)->u.v.nApplyCount > 1 || Z_ARRVAL_P(src_zval)->u.v.nApplyCount > 1 || (Z_ISREF_P(src_entry) && Z_ISREF_P(dest_entry) && Z_REF_P(src_entry) == Z_REF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); + php_error_docref(NULL, E_WARNING, "recursion detected"); return 0; } SEPARATE_ZVAL(dest_zval); @@ -2505,7 +2505,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC Z_ARRVAL_P(src_zval)->u.v.nApplyCount++; } - ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval) TSRMLS_CC); + ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval)); if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(dest_zval))) { Z_ARRVAL_P(dest_zval)->u.v.nApplyCount--; @@ -2530,7 +2530,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int int argc, i, init_size = 0; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } #else @@ -2544,7 +2544,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int ZVAL_DEREF(arg); if (Z_TYPE_P(arg) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1); RETURN_NULL(); } else { int num = zend_hash_num_elements(Z_ARRVAL_P(arg)); @@ -2586,7 +2586,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int for (i = 1; i < argc; i++) { arg = args + i; ZVAL_DEREF(arg); - php_array_replace_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC); + php_array_replace_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg)); } } else { for (i = 1; i < argc; i++) { @@ -2623,13 +2623,13 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int for (i = 1; i < argc; i++) { arg = args + i; ZVAL_DEREF(arg); - php_array_merge_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC); + php_array_merge_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg)); } } else { for (i = 1; i < argc; i++) { arg = args + i; ZVAL_DEREF(arg); - php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC); + php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg)); } } } @@ -2681,10 +2681,10 @@ PHP_FUNCTION(array_keys) zend_bool strict = 0; /* do strict comparison */ zend_ulong num_idx; zend_string *str_idx; - int (*is_equal_func)(zval *, zval *, zval * TSRMLS_DC) = is_equal_function; + int (*is_equal_func)(zval *, zval *, zval *) = is_equal_function; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|zb", &input, &search_value, &strict) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|zb", &input, &search_value, &strict) == FAILURE) { return; } #else @@ -2711,7 +2711,7 @@ PHP_FUNCTION(array_keys) /* Go through input array and add keys to the return array */ ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(input), num_idx, str_idx, entry) { if (search_value != NULL) { - is_equal_func(&res, search_value, entry TSRMLS_CC); + is_equal_func(&res, search_value, entry); add_key = zval_is_true(&res); } @@ -2734,7 +2734,7 @@ PHP_FUNCTION(array_values) zval *input, /* Input array */ *entry; /* An entry in the input array */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) { return; } @@ -2758,7 +2758,7 @@ PHP_FUNCTION(array_count_values) *tmp; HashTable *myht; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) { return; } @@ -2785,7 +2785,7 @@ PHP_FUNCTION(array_count_values) Z_LVAL_P(tmp)++; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only count STRING and INTEGER values!"); + php_error_docref(NULL, E_WARNING, "Can only count STRING and INTEGER values!"); } } ZEND_HASH_FOREACH_END(); } @@ -2796,7 +2796,7 @@ PHP_FUNCTION(array_count_values) */ static inline zend_bool array_column_param_helper(zval *param, - const char *name TSRMLS_DC) { + const char *name) { switch (Z_TYPE_P(param)) { case IS_DOUBLE: convert_to_long_ex(param); @@ -2811,7 +2811,7 @@ zend_bool array_column_param_helper(zval *param, return 1; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The %s key should be either a string or an integer", name); + php_error_docref(NULL, E_WARNING, "The %s key should be either a string or an integer", name); return 0; } } @@ -2826,12 +2826,12 @@ PHP_FUNCTION(array_column) zval *zcolval = NULL, *zkeyval = NULL; HashTable *ht; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) { return; } - if ((zcolumn && !array_column_param_helper(zcolumn, "column" TSRMLS_CC)) || - (zkey && !array_column_param_helper(zkey, "index" TSRMLS_CC))) { + if ((zcolumn && !array_column_param_helper(zcolumn, "column")) || + (zkey && !array_column_param_helper(zkey, "index"))) { RETURN_FALSE; } @@ -2893,7 +2893,7 @@ PHP_FUNCTION(array_reverse) zend_ulong num_key; zend_bool preserve_keys = 0; /* whether to preserve keys */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &input, &preserve_keys) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &input, &preserve_keys) == FAILURE) { return; } @@ -2932,7 +2932,7 @@ PHP_FUNCTION(array_pad) int do_pad; /* Whether we should do padding at all */ int i; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "alz", &input, &pad_size, &pad_value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "alz", &input, &pad_size, &pad_value) == FAILURE) { return; } @@ -2940,7 +2940,7 @@ PHP_FUNCTION(array_pad) input_size = zend_hash_num_elements(Z_ARRVAL_P(input)); pad_size_abs = ZEND_ABS(pad_size); if (pad_size_abs < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time"); + php_error_docref(NULL, E_WARNING, "You may only pad up to 1048576 elements at a time"); zval_dtor(return_value); RETURN_FALSE; } @@ -2957,7 +2957,7 @@ PHP_FUNCTION(array_pad) /* Populate the pads array */ num_pads = pad_size_abs - input_size; if (num_pads > Z_L(1048576)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time"); + php_error_docref(NULL, E_WARNING, "You may only pad up to 1048576 elements at a time"); zval_dtor(return_value); RETURN_FALSE; } @@ -2992,7 +2992,7 @@ PHP_FUNCTION(array_flip) zend_ulong num_idx; zend_string *str_idx; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) { return; } @@ -3014,7 +3014,7 @@ PHP_FUNCTION(array_flip) } zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(entry), &data); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only flip STRING and INTEGER values!"); + php_error_docref(NULL, E_WARNING, "Can only flip STRING and INTEGER values!"); } } ZEND_HASH_FOREACH_END(); } @@ -3030,7 +3030,7 @@ PHP_FUNCTION(array_change_key_case) zend_ulong num_key; zend_long change_to_upper=0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &array, &change_to_upper) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &array, &change_to_upper) == FAILURE) { return; } @@ -3070,11 +3070,11 @@ PHP_FUNCTION(array_unique) unsigned int i; zend_long sort_type = PHP_SORT_STRING; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &array, &sort_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &array, &sort_type) == FAILURE) { return; } - php_set_compare_func(sort_type TSRMLS_CC); + php_set_compare_func(sort_type); ZVAL_NEW_ARR(return_value); zend_array_dup(Z_ARRVAL_P(return_value), Z_ARRVAL_P(array)); @@ -3098,12 +3098,12 @@ PHP_FUNCTION(array_unique) i++; } ZVAL_UNDEF(&arTmp[i].b.val); - zend_qsort((void *) arTmp, i, sizeof(struct bucketindex), php_array_data_compare TSRMLS_CC); + zend_qsort((void *) arTmp, i, sizeof(struct bucketindex), php_array_data_compare); /* go through the sorted array and delete duplicates from the copy */ lastkept = arTmp; for (cmpdata = arTmp + 1; Z_TYPE(cmpdata->b.val) != IS_UNDEF; cmpdata++) { - if (php_array_data_compare(lastkept, cmpdata TSRMLS_CC)) { + if (php_array_data_compare(lastkept, cmpdata)) { lastkept = cmpdata; } else { if (lastkept->i > cmpdata->i) { @@ -3116,7 +3116,7 @@ PHP_FUNCTION(array_unique) zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { if (Z_ARRVAL_P(return_value) == &EG(symbol_table).ht) { - zend_delete_global_variable(p->key TSRMLS_CC); + zend_delete_global_variable(p->key); } else { zend_hash_del(Z_ARRVAL_P(return_value), p->key); } @@ -3127,7 +3127,7 @@ PHP_FUNCTION(array_unique) } /* }}} */ -static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */ +static int zval_compare(zval *a, zval *b) /* {{{ */ { zval result; zval *first; @@ -3142,7 +3142,7 @@ static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */ if (Z_TYPE_P(second) == IS_INDIRECT) { second = Z_INDIRECT_P(second); } - if (string_compare_function(&result, first, second TSRMLS_CC) == FAILURE) { + if (string_compare_function(&result, first, second) == FAILURE) { return 0; } @@ -3155,7 +3155,7 @@ static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */ } /* }}} */ -static int zval_user_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */ +static int zval_user_compare(zval *a, zval *b) /* {{{ */ { zval args[2]; zval retval; @@ -3175,7 +3175,7 @@ static int zval_user_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */ BG(user_compare_fci).retval = &retval; BG(user_compare_fci).no_separation = 0; - if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { zend_long ret = zval_get_long(&retval); zval_ptr_dtor(&retval); return ret < 0 ? -1 : ret > 0 ? 1 : 0;; @@ -3191,7 +3191,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa Bucket *p; int argc, i; zval *args; - int (*intersect_data_compare_func)(zval *, zval * TSRMLS_DC) = NULL; + int (*intersect_data_compare_func)(zval *, zval *) = NULL; zend_bool ok; zval *val, *data; int req_args; @@ -3216,17 +3216,17 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa } if (argc < req_args) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, argc); + php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, argc); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { return; } for (i = 0; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1); RETURN_NULL(); } } @@ -3245,7 +3245,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa for (i = 1; i < argc; i++) { if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), p->h)) == NULL || (intersect_data_compare_func && - intersect_data_compare_func(val, data TSRMLS_CC) != 0) + intersect_data_compare_func(val, data) != 0) ) { ok = 0; break; @@ -3262,7 +3262,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa for (i = 1; i < argc; i++) { if ((data = zend_hash_find(Z_ARRVAL(args[i]), p->key)) == NULL || (intersect_data_compare_func && - intersect_data_compare_func(val, data TSRMLS_CC) != 0) + intersect_data_compare_func(val, data) != 0) ) { ok = 0; break; @@ -3294,8 +3294,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache; PHP_ARRAY_CMP_FUNC_VARS; - int (*intersect_key_compare_func)(const void *, const void * TSRMLS_DC); - int (*intersect_data_compare_func)(const void *, const void * TSRMLS_DC); + int (*intersect_key_compare_func)(const void *, const void *); + int (*intersect_data_compare_func)(const void *, const void *); if (behavior == INTERSECT_NORMAL) { intersect_key_compare_func = php_array_key_compare; @@ -3311,16 +3311,16 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int param_spec = "+f"; intersect_data_compare_func = php_array_user_compare; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type); + php_error_docref(NULL, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type); return; } if (ZEND_NUM_ARGS() < req_args) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) { return; } fci_data = &fci1; @@ -3364,21 +3364,21 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int fci_key = &fci2; fci_key_cache = &fci2_cache; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type); + php_error_docref(NULL, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type); return; } if (ZEND_NUM_ARGS() < req_args) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) { return; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior); + php_error_docref(NULL, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior); return; } @@ -3387,7 +3387,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int /* for each argument, create and sort list with pointers to the hash buckets */ lists = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0); ptrs = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0); - php_set_compare_func(PHP_SORT_STRING TSRMLS_CC); + php_set_compare_func(PHP_SORT_STRING); if (behavior == INTERSECT_NORMAL && data_compare_type == INTERSECT_COMP_DATA_USER) { BG(user_compare_fci) = *fci_data; @@ -3399,7 +3399,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int for (i = 0; i < arr_argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1); arr_argc = i; /* only free up to i - 1 */ goto out; } @@ -3421,9 +3421,9 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int } ZVAL_UNDEF(&list->val); if (behavior == INTERSECT_NORMAL) { - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_data_compare_func TSRMLS_CC); + zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_data_compare_func); } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */ - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_key_compare_func TSRMLS_CC); + zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_key_compare_func); } } @@ -3448,11 +3448,11 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int for (i = 1; i < arr_argc; i++) { if (behavior & INTERSECT_NORMAL) { - while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) { + while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i])))) { ptrs[i]++; } } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */ - while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) { + while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i])))) { ptrs[i]++; } if ((!c && Z_TYPE(ptrs[i]->val) != IS_UNDEF) && (behavior == INTERSECT_ASSOC)) { /* only when INTERSECT_ASSOC */ @@ -3464,7 +3464,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int BG(user_compare_fci) = *fci_data; BG(user_compare_fci_cache) = *fci_data_cache; } - if (intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC) != 0) { + if (intersect_data_compare_func(ptrs[0], ptrs[i]) != 0) { c = 1; if (key_compare_type == INTERSECT_COMP_KEY_USER) { BG(user_compare_fci) = *fci_key; @@ -3511,7 +3511,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int goto out; } if (behavior == INTERSECT_NORMAL) { - if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)) { + if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i])) { break; } } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */ @@ -3527,7 +3527,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int goto out; } if (behavior == INTERSECT_NORMAL) { - if (intersect_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) { + if (intersect_data_compare_func(ptrs[0] - 1, ptrs[0])) { break; } } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */ @@ -3620,7 +3620,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty Bucket *p; int argc, i; zval *args; - int (*diff_data_compare_func)(zval *, zval * TSRMLS_DC) = NULL; + int (*diff_data_compare_func)(zval *, zval *) = NULL; zend_bool ok; zval *val, *data; @@ -3628,19 +3628,19 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty argc = ZEND_NUM_ARGS(); if (data_compare_type == DIFF_COMP_DATA_USER) { if (argc < 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 3 parameters are required, %d given", ZEND_NUM_ARGS()); + php_error_docref(NULL, E_WARNING, "at least 3 parameters are required, %d given", ZEND_NUM_ARGS()); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { return; } diff_data_compare_func = zval_user_compare; } else { if (argc < 2) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 2 parameters are required, %d given", ZEND_NUM_ARGS()); + php_error_docref(NULL, E_WARNING, "at least 2 parameters are required, %d given", ZEND_NUM_ARGS()); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } if (data_compare_type == DIFF_COMP_DATA_INTERNAL) { @@ -3650,7 +3650,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty for (i = 0; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1); RETURN_NULL(); } } @@ -3669,7 +3669,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty for (i = 1; i < argc; i++) { if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), p->h)) != NULL && (!diff_data_compare_func || - diff_data_compare_func(val, data TSRMLS_CC) == 0) + diff_data_compare_func(val, data) == 0) ) { ok = 0; break; @@ -3686,7 +3686,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty for (i = 1; i < argc; i++) { if ((data = zend_hash_find(Z_ARRVAL(args[i]), p->key)) != NULL && (!diff_data_compare_func || - diff_data_compare_func(val, data TSRMLS_CC) == 0) + diff_data_compare_func(val, data) == 0) ) { ok = 0; break; @@ -3718,8 +3718,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache; PHP_ARRAY_CMP_FUNC_VARS; - int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC); - int (*diff_data_compare_func)(const void *, const void * TSRMLS_DC); + int (*diff_key_compare_func)(const void *, const void *); + int (*diff_data_compare_func)(const void *, const void *); if (behavior == DIFF_NORMAL) { diff_key_compare_func = php_array_key_compare; @@ -3735,16 +3735,16 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ param_spec = "+f"; diff_data_compare_func = php_array_user_compare; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type); + php_error_docref(NULL, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type); return; } if (ZEND_NUM_ARGS() < req_args) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) { return; } fci_data = &fci1; @@ -3787,21 +3787,21 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ fci_key = &fci2; fci_key_cache = &fci2_cache; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type); + php_error_docref(NULL, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type); return; } if (ZEND_NUM_ARGS() < req_args) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) { return; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior); + php_error_docref(NULL, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior); return; } @@ -3810,7 +3810,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ /* for each argument, create and sort list with pointers to the hash buckets */ lists = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0); ptrs = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0); - php_set_compare_func(PHP_SORT_STRING TSRMLS_CC); + php_set_compare_func(PHP_SORT_STRING); if (behavior == DIFF_NORMAL && data_compare_type == DIFF_COMP_DATA_USER) { BG(user_compare_fci) = *fci_data; @@ -3822,7 +3822,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ for (i = 0; i < arr_argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1); arr_argc = i; /* only free up to i - 1 */ goto out; } @@ -3844,9 +3844,9 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ } ZVAL_UNDEF(&list->val); if (behavior == DIFF_NORMAL) { - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_data_compare_func TSRMLS_CC); + zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_data_compare_func); } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */ - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_key_compare_func TSRMLS_CC); + zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_key_compare_func); } } @@ -3872,11 +3872,11 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ for (i = 1; i < arr_argc; i++) { Bucket *ptr = ptrs[i]; if (behavior == DIFF_NORMAL) { - while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) { + while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i])))) { ptrs[i]++; } } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */ - while (Z_TYPE(ptr->val) != IS_UNDEF && (0 != (c = diff_key_compare_func(ptrs[0], ptr TSRMLS_CC)))) { + while (Z_TYPE(ptr->val) != IS_UNDEF && (0 != (c = diff_key_compare_func(ptrs[0], ptr)))) { ptr++; } } @@ -3894,7 +3894,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ BG(user_compare_fci) = *fci_data; BG(user_compare_fci_cache) = *fci_data_cache; } - if (diff_data_compare_func(ptrs[0], ptr TSRMLS_CC) != 0) { + if (diff_data_compare_func(ptrs[0], ptr) != 0) { /* the data is not the same */ c = -1; if (key_compare_type == DIFF_COMP_KEY_USER) { @@ -3930,7 +3930,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ goto out; } if (behavior == DIFF_NORMAL) { - if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) { + if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) { break; } } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */ @@ -3946,7 +3946,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ goto out; } if (behavior == DIFF_NORMAL) { - if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) { + if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) { break; } } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */ @@ -4037,7 +4037,7 @@ PHP_FUNCTION(array_udiff_uassoc) #define MULTISORT_TYPE 1 #define MULTISORT_LAST 2 -PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +PHPAPI int php_multisort_compare(const void *a, const void *b) /* {{{ */ { Bucket *ab = *(Bucket **)a; Bucket *bb = *(Bucket **)b; @@ -4048,9 +4048,9 @@ PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC) /* {{{ r = 0; do { - php_set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r] TSRMLS_CC); + php_set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r]); - ARRAYG(compare_func)(&temp, &ab[r].val, &bb[r].val TSRMLS_CC); + ARRAYG(compare_func)(&temp, &ab[r].val, &bb[r].val); result = ARRAYG(multisort_flags)[MULTISORT_ORDER][r] * Z_LVAL(temp); if (result != 0) { return result > 0 ? 1 : -1; @@ -4086,7 +4086,7 @@ PHP_FUNCTION(array_multisort) int sort_type = PHP_SORT_REGULAR; int i, k, n; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } @@ -4134,7 +4134,7 @@ PHP_FUNCTION(array_multisort) sort_order = Z_LVAL(args[i]) == PHP_SORT_DESC ? -1 : 1; parse_state[MULTISORT_ORDER] = 0; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1); MULTISORT_ABORT; } break; @@ -4152,19 +4152,19 @@ PHP_FUNCTION(array_multisort) sort_type = (int)Z_LVAL(args[i]); parse_state[MULTISORT_TYPE] = 0; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1); MULTISORT_ABORT; } break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is an unknown sort flag", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is an unknown sort flag", i + 1); MULTISORT_ABORT; break; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1); + php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1); MULTISORT_ABORT; } } @@ -4176,7 +4176,7 @@ PHP_FUNCTION(array_multisort) array_size = zend_hash_num_elements(Z_ARRVAL_P(arrays[0])); for (i = 0; i < num_arrays; i++) { if (zend_hash_num_elements(Z_ARRVAL_P(arrays[i])) != array_size) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array sizes are inconsistent"); + php_error_docref(NULL, E_WARNING, "Array sizes are inconsistent"); MULTISORT_ABORT; } } @@ -4212,7 +4212,7 @@ PHP_FUNCTION(array_multisort) } /* Do the actual sort magic - bada-bim, bada-boom. */ - zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare TSRMLS_CC); + zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare); /* Restructure the arrays based on sorted indirect - this is mostly taken from zend_hash_sort() function. */ HANDLE_BLOCK_INTERRUPTIONS(); @@ -4262,7 +4262,7 @@ PHP_FUNCTION(array_rand) zend_string *string_key; zend_ulong num_key; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &input, &num_req) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &input, &num_req) == FAILURE) { return; } @@ -4270,7 +4270,7 @@ PHP_FUNCTION(array_rand) if (ZEND_NUM_ARGS() > 1) { if (num_req <= 0 || num_req > num_avail) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be between 1 and the number of elements in the array"); + php_error_docref(NULL, E_WARNING, "Second argument has to be between 1 and the number of elements in the array"); return; } } @@ -4286,7 +4286,7 @@ PHP_FUNCTION(array_rand) break; } - randval = php_rand(TSRMLS_C); + randval = php_rand(); if ((double) (randval / (PHP_RAND_MAX + 1.0)) < (double) num_req / (double) num_avail) { /* If we are returning a single result, just do it. */ @@ -4319,7 +4319,7 @@ PHP_FUNCTION(array_sum) *entry, entry_n; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) { return; } @@ -4330,8 +4330,8 @@ PHP_FUNCTION(array_sum) continue; } ZVAL_DUP(&entry_n, entry); - convert_scalar_to_number(&entry_n TSRMLS_CC); - fast_add_function(return_value, return_value, &entry_n TSRMLS_CC); + convert_scalar_to_number(&entry_n); + fast_add_function(return_value, return_value, &entry_n); } ZEND_HASH_FOREACH_END(); } /* }}} */ @@ -4345,7 +4345,7 @@ PHP_FUNCTION(array_product) entry_n; double dval; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) { return; } @@ -4359,7 +4359,7 @@ PHP_FUNCTION(array_product) continue; } ZVAL_DUP(&entry_n, entry); - convert_scalar_to_number(&entry_n TSRMLS_CC); + convert_scalar_to_number(&entry_n); if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) { dval = (double)Z_LVAL_P(return_value) * (double)Z_LVAL(entry_n); @@ -4389,7 +4389,7 @@ PHP_FUNCTION(array_reduce) zval *initial = NULL; HashTable *htbl; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "af|z", &input, &fci, &fci_cache, &initial) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "af|z", &input, &fci, &fci_cache, &initial) == FAILURE) { return; } @@ -4418,7 +4418,7 @@ PHP_FUNCTION(array_reduce) ZVAL_COPY(&args[1], operand); fci.params = args; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { zval_ptr_dtor(&args[1]); zval_ptr_dtor(&args[0]); zval_ptr_dtor(&result); @@ -4426,7 +4426,7 @@ PHP_FUNCTION(array_reduce) } else { zval_ptr_dtor(&args[1]); zval_ptr_dtor(&args[0]); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the reduction callback"); + php_error_docref(NULL, E_WARNING, "An error occurred while invoking the reduction callback"); return; } } ZEND_HASH_FOREACH_END(); @@ -4450,7 +4450,7 @@ PHP_FUNCTION(array_filter) zend_fcall_info_cache fci_cache = empty_fcall_info_cache; zend_ulong num_key; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|fl", &array, &fci, &fci_cache, &use_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|fl", &array, &fci, &fci_cache, &use_type) == FAILURE) { return; } @@ -4490,13 +4490,13 @@ PHP_FUNCTION(array_filter) } fci.params = args; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) { + if (zend_call_function(&fci, &fci_cache) == SUCCESS) { zval_ptr_dtor(&args[0]); if (use_type == ARRAY_FILTER_USE_BOTH) { zval_ptr_dtor(&args[1]); } if (!Z_ISUNDEF(retval)) { - int retval_true = zend_is_true(&retval TSRMLS_CC); + int retval_true = zend_is_true(&retval); zval_ptr_dtor(&retval); if (!retval_true) { @@ -4510,10 +4510,10 @@ PHP_FUNCTION(array_filter) if (use_type == ARRAY_FILTER_USE_BOTH) { zval_ptr_dtor(&args[1]); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback"); + php_error_docref(NULL, E_WARNING, "An error occurred while invoking the filter callback"); return; } - } else if (!zend_is_true(operand TSRMLS_CC)) { + } else if (!zend_is_true(operand)) { continue; } @@ -4540,7 +4540,7 @@ PHP_FUNCTION(array_map) uint32_t k, maxlen = 0; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) { return; } #else @@ -4558,7 +4558,7 @@ PHP_FUNCTION(array_map) zval *zv, arg; if (Z_TYPE(arrays[0]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", 2); + php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", 2); return; } maxlen = zend_hash_num_elements(Z_ARRVAL(arrays[0])); @@ -4579,8 +4579,8 @@ PHP_FUNCTION(array_map) ZVAL_COPY(&arg, zv); - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback"); + if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { + php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback"); zval_dtor(return_value); zval_ptr_dtor(&arg); RETURN_NULL(); @@ -4598,7 +4598,7 @@ PHP_FUNCTION(array_map) for (i = 0; i < n_arrays; i++) { if (Z_TYPE(arrays[i]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", i + 2); + php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", i + 2); efree(array_pos); return; } @@ -4667,8 +4667,8 @@ PHP_FUNCTION(array_map) fci.params = params; fci.no_separation = 0; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback"); + if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { + php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback"); efree(array_pos); zval_dtor(return_value); for (i = 0; i < n_arrays; i++) { @@ -4700,7 +4700,7 @@ PHP_FUNCTION(array_key_exists) HashTable *array; /* array to check in */ #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zH", &key, &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zH", &key, &array) == FAILURE) { return; } #else @@ -4728,7 +4728,7 @@ PHP_FUNCTION(array_key_exists) RETURN_FALSE; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be either a string or an integer"); + php_error_docref(NULL, E_WARNING, "The first argument should be either a string or an integer"); RETURN_FALSE; } } @@ -4747,12 +4747,12 @@ PHP_FUNCTION(array_chunk) zval chunk; zval *entry; - if (zend_parse_parameters(argc TSRMLS_CC, "al|b", &input, &size, &preserve_keys) == FAILURE) { + if (zend_parse_parameters(argc, "al|b", &input, &size, &preserve_keys) == FAILURE) { return; } /* Do bounds checking for size parameter. */ if (size < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size parameter expected to be greater than 0"); + php_error_docref(NULL, E_WARNING, "Size parameter expected to be greater than 0"); return; } @@ -4809,7 +4809,7 @@ PHP_FUNCTION(array_combine) zval *entry_keys, *entry_values; int num_keys, num_values; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &keys, &values) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &keys, &values) == FAILURE) { return; } @@ -4817,7 +4817,7 @@ PHP_FUNCTION(array_combine) num_values = zend_hash_num_elements(Z_ARRVAL_P(values)); if (num_keys != num_values) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have an equal number of elements"); + php_error_docref(NULL, E_WARNING, "Both parameters should have an equal number of elements"); RETURN_FALSE; } diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 9fa5a1178c..a0a8569adb 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -85,7 +85,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateBool, quiet_eval, zend_assert_globals, assert_globals) PHP_INI_END() -static void php_assert_init_globals(zend_assert_globals *assert_globals_p TSRMLS_DC) /* {{{ */ +static void php_assert_init_globals(zend_assert_globals *assert_globals_p) /* {{{ */ { ZVAL_UNDEF(&assert_globals_p->callback); assert_globals_p->cb = NULL; @@ -149,7 +149,7 @@ PHP_FUNCTION(assert) RETURN_TRUE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &assertion, &description, &description_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &assertion, &description, &description_len) == FAILURE) { return; } @@ -164,13 +164,13 @@ PHP_FUNCTION(assert) EG(error_reporting) = 0; } - compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC); - if (zend_eval_stringl(myeval, Z_STRLEN_P(assertion), &retval, compiled_string_description TSRMLS_CC) == FAILURE) { + compiled_string_description = zend_make_compiled_string_description("assert code"); + if (zend_eval_stringl(myeval, Z_STRLEN_P(assertion), &retval, compiled_string_description) == FAILURE) { efree(compiled_string_description); if (description_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval); } else { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval); } if (ASSERTG(bail)) { zend_bailout(); @@ -202,8 +202,8 @@ PHP_FUNCTION(assert) zval *args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval), 0); zval retval; int i; - uint lineno = zend_get_executed_lineno(TSRMLS_C); - const char *filename = zend_get_executed_filename(TSRMLS_C); + uint lineno = zend_get_executed_lineno(); + const char *filename = zend_get_executed_filename(); ZVAL_STRING(&args[0], SAFE_STRING(filename)); ZVAL_LONG (&args[1], lineno); @@ -213,14 +213,14 @@ PHP_FUNCTION(assert) /* XXX do we want to check for error here? */ if (description_len == 0) { - call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 3, args TSRMLS_CC); + call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 3, args); for (i = 0; i <= 2; i++) { zval_ptr_dtor(&(args[i])); } } else { ZVAL_STRINGL(&args[3], SAFE_STRING(description), description_len); - call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 4, args TSRMLS_CC); + call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 4, args); for (i = 0; i <= 3; i++) { zval_ptr_dtor(&(args[i])); } @@ -233,15 +233,15 @@ PHP_FUNCTION(assert) if (ASSERTG(warning)) { if (description_len == 0) { if (myeval) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval); + php_error_docref(NULL, E_WARNING, "Assertion \"%s\" failed", myeval); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed"); + php_error_docref(NULL, E_WARNING, "Assertion failed"); } } else { if (myeval) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: \"%s\" failed", description, myeval); + php_error_docref(NULL, E_WARNING, "%s: \"%s\" failed", description, myeval); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s failed", description); + php_error_docref(NULL, E_WARNING, "%s failed", description); } } } @@ -262,7 +262,7 @@ PHP_FUNCTION(assert_options) int ac = ZEND_NUM_ARGS(); zend_string *key; - if (zend_parse_parameters(ac TSRMLS_CC, "l|z", &what, &value) == FAILURE) { + if (zend_parse_parameters(ac, "l|z", &what, &value) == FAILURE) { return; } @@ -272,7 +272,7 @@ PHP_FUNCTION(assert_options) if (ac == 2) { zend_string *value_str = zval_get_string(value); key = zend_string_init("assert.active", sizeof("assert.active")-1, 0); - zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0); zend_string_release(key); zend_string_release(value_str); } @@ -284,7 +284,7 @@ PHP_FUNCTION(assert_options) if (ac == 2) { zend_string *value_str = zval_get_string(value); key = zend_string_init("assert.bail", sizeof("assert.bail")-1, 0); - zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0); zend_string_release(key); zend_string_release(value_str); } @@ -296,7 +296,7 @@ PHP_FUNCTION(assert_options) if (ac == 2) { zend_string *value_str = zval_get_string(value); key = zend_string_init("assert.quiet_eval", sizeof("assert.quiet_eval")-1, 0); - zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0); zend_string_release(key); zend_string_release(value_str); } @@ -308,7 +308,7 @@ PHP_FUNCTION(assert_options) if (ac == 2) { zend_string *value_str = zval_get_string(value); key = zend_string_init("assert.warning", sizeof("assert.warning")-1, 0); - zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0); zend_string_release(key); zend_string_release(value_str); } @@ -332,7 +332,7 @@ PHP_FUNCTION(assert_options) break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %pd", what); + php_error_docref(NULL, E_WARNING, "Unknown value %pd", what); break; } diff --git a/ext/standard/base64.c b/ext/standard/base64.c index fd1c910234..f3acd5b07f 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -121,7 +121,7 @@ void php_base64_init(void) ch += 16; } sprintf(sp, "};"); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Reverse_table:\n%s", s); + php_error_docref(NULL, E_NOTICE, "Reverse_table:\n%s", s); efree(s); } */ @@ -215,7 +215,7 @@ PHP_FUNCTION(base64_encode) size_t str_len; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { return; } result = php_base64_encode((unsigned char*)str, str_len); @@ -236,7 +236,7 @@ PHP_FUNCTION(base64_decode) size_t str_len; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &strict) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &str, &str_len, &strict) == FAILURE) { return; } result = php_base64_decode_ex((unsigned char*)str, str_len, strict); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 9ffe0fe14e..917a022079 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3424,7 +3424,7 @@ static void php_putenv_destructor(zval *zv) /* {{{ */ /* }}} */ #endif -static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */ +static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */ { BG(rand_is_seeded) = 0; BG(mt_rand_is_seeded) = 0; @@ -3450,7 +3450,7 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /* } /* }}} */ -static void basic_globals_dtor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */ +static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */ { if (BG(url_adapt_state_ex).tags) { zend_hash_destroy(BG(url_adapt_state_ex).tags); @@ -3532,15 +3532,15 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor ); #endif #else - basic_globals_ctor(&basic_globals TSRMLS_CC); + basic_globals_ctor(&basic_globals); #ifdef PHP_WIN32 - php_win32_core_globals_ctor(&the_php_win32_core_globals TSRMLS_CC); + php_win32_core_globals_ctor(&the_php_win32_core_globals); #endif #endif zend_hash_init(&basic_submodules, 0, NULL, NULL, 1); - BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(TSRMLS_C); + BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(); REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT); @@ -3638,14 +3638,14 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ BASIC_MINIT_SUBMODULE(user_streams) BASIC_MINIT_SUBMODULE(imagetypes) - php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC); + php_register_url_stream_wrapper("php", &php_stream_php_wrapper); + php_register_url_stream_wrapper("file", &php_plain_files_wrapper); #ifdef HAVE_GLOB - php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC); + php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper); #endif - php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC); + php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper); + php_register_url_stream_wrapper("http", &php_stream_http_wrapper); + php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper); #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS @@ -3668,15 +3668,15 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */ ts_free_id(php_win32_core_globals_id); #endif #else - basic_globals_dtor(&basic_globals TSRMLS_CC); + basic_globals_dtor(&basic_globals); #ifdef PHP_WIN32 - php_win32_core_globals_dtor(&the_php_win32_core_globals TSRMLS_CC); + php_win32_core_globals_dtor(&the_php_win32_core_globals); #endif #endif - php_unregister_url_stream_wrapper("php" TSRMLS_CC); - php_unregister_url_stream_wrapper("http" TSRMLS_CC); - php_unregister_url_stream_wrapper("ftp" TSRMLS_CC); + php_unregister_url_stream_wrapper("php"); + php_unregister_url_stream_wrapper("http"); + php_unregister_url_stream_wrapper("ftp"); BASIC_MSHUTDOWN_SUBMODULE(browscap) BASIC_MSHUTDOWN_SUBMODULE(array) @@ -3814,19 +3814,19 @@ PHP_FUNCTION(constant) zend_string *const_name; zval *c; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &const_name) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &const_name) == FAILURE) { return; } - c = zend_get_constant_ex(const_name, NULL, ZEND_FETCH_CLASS_SILENT TSRMLS_CC); + c = zend_get_constant_ex(const_name, NULL, ZEND_FETCH_CLASS_SILENT); if (c) { ZVAL_COPY_VALUE(return_value, c); if (Z_CONSTANT_P(return_value)) { - zval_update_constant_ex(return_value, 1, NULL TSRMLS_CC); + zval_update_constant_ex(return_value, 1, NULL); } zval_copy_ctor(return_value); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %s", const_name->val); + php_error_docref(NULL, E_WARNING, "Couldn't find constant %s", const_name->val); RETURN_NULL(); } } @@ -3842,7 +3842,7 @@ PHP_NAMED_FUNCTION(php_inet_ntop) int af = AF_INET; char buffer[40]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) { RETURN_FALSE; } @@ -3852,12 +3852,12 @@ PHP_NAMED_FUNCTION(php_inet_ntop) } else #endif if (address_len != 4) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid in_addr value"); + php_error_docref(NULL, E_WARNING, "Invalid in_addr value"); RETURN_FALSE; } if (!inet_ntop(af, address, buffer, sizeof(buffer))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred"); + php_error_docref(NULL, E_WARNING, "An unknown error occurred"); RETURN_FALSE; } @@ -3876,7 +3876,7 @@ PHP_NAMED_FUNCTION(php_inet_pton) size_t address_len; char buffer[17]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) { RETURN_FALSE; } @@ -3888,14 +3888,14 @@ PHP_NAMED_FUNCTION(php_inet_pton) } else #endif if (!strchr(address, '.')) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address); + php_error_docref(NULL, E_WARNING, "Unrecognized address %s", address); RETURN_FALSE; } ret = inet_pton(af, address, buffer); if (ret <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address); + php_error_docref(NULL, E_WARNING, "Unrecognized address %s", address); RETURN_FALSE; } @@ -3916,7 +3916,7 @@ PHP_FUNCTION(ip2long) zend_ulong ip; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &addr, &addr_len) == FAILURE) { return; } @@ -3955,7 +3955,7 @@ PHP_FUNCTION(long2ip) char str[40]; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ip, &ip_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &ip, &ip_len) == FAILURE) { return; } @@ -3985,12 +3985,12 @@ PHP_FUNCTION(getenv) char *ptr, *str; size_t str_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { RETURN_FALSE; } /* SAPI method returns an emalloc()'d string */ - ptr = sapi_getenv(str, str_len TSRMLS_CC); + ptr = sapi_getenv(str, str_len); if (ptr) { // TODO: avoid realocation ??? RETVAL_STRING(ptr); @@ -4055,12 +4055,12 @@ PHP_FUNCTION(putenv) int error_code; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &setting, &setting_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &setting, &setting_len) == FAILURE) { return; } if(setting_len == 0 || setting[0] == '=') { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter syntax"); + php_error_docref(NULL, E_WARNING, "Invalid parameter syntax"); RETURN_FALSE; } @@ -4228,7 +4228,7 @@ PHP_FUNCTION(getopt) int optname_len = 0; opt_struct *opts, *orig_opts; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &options, &options_len, &p_longopts) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &options, &options_len, &p_longopts) == FAILURE) { RETURN_FALSE; } @@ -4383,7 +4383,7 @@ PHP_FUNCTION(getopt) Flush the output buffer */ PHP_FUNCTION(flush) { - sapi_flush(TSRMLS_C); + sapi_flush(); } /* }}} */ @@ -4393,11 +4393,11 @@ PHP_FUNCTION(sleep) { zend_long num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) { RETURN_FALSE; } if (num < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of seconds must be greater than or equal to 0"); + php_error_docref(NULL, E_WARNING, "Number of seconds must be greater than or equal to 0"); RETURN_FALSE; } #ifdef PHP_SLEEP_NON_VOID @@ -4416,11 +4416,11 @@ PHP_FUNCTION(usleep) #if HAVE_USLEEP zend_long num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) { return; } if (num < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of microseconds must be greater than or equal to 0"); + php_error_docref(NULL, E_WARNING, "Number of microseconds must be greater than or equal to 0"); RETURN_FALSE; } usleep((unsigned int)num); @@ -4436,16 +4436,16 @@ PHP_FUNCTION(time_nanosleep) zend_long tv_sec, tv_nsec; struct timespec php_req, php_rem; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec, &tv_nsec) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &tv_sec, &tv_nsec) == FAILURE) { return; } if (tv_sec < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds value must be greater than 0"); + php_error_docref(NULL, E_WARNING, "The seconds value must be greater than 0"); RETURN_FALSE; } if (tv_nsec < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The nanoseconds value must be greater than 0"); + php_error_docref(NULL, E_WARNING, "The nanoseconds value must be greater than 0"); RETURN_FALSE; } @@ -4459,7 +4459,7 @@ PHP_FUNCTION(time_nanosleep) add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec); return; } else if (errno == EINVAL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative"); + php_error_docref(NULL, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative"); } RETURN_FALSE; @@ -4474,7 +4474,7 @@ PHP_FUNCTION(time_sleep_until) struct timeval tm; struct timespec php_req, php_rem; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &d_ts) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &d_ts) == FAILURE) { return; } @@ -4484,7 +4484,7 @@ PHP_FUNCTION(time_sleep_until) c_ts = (double)(d_ts - tm.tv_sec - tm.tv_usec / 1000000.00); if (c_ts < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sleep until to time is less than current time"); + php_error_docref(NULL, E_WARNING, "Sleep until to time is less than current time"); RETURN_FALSE; } @@ -4517,13 +4517,13 @@ PHP_FUNCTION(get_current_user) return; } - RETURN_STRING(php_get_current_user(TSRMLS_C)); + RETURN_STRING(php_get_current_user()); } /* }}} */ /* {{{ add_config_entry_cb */ -static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +static int add_config_entry_cb(zval *entry, int num_args, va_list args, zend_hash_key *hash_key) { zval *retval = (zval *)va_arg(args, zval*); zval tmp; @@ -4536,7 +4536,7 @@ static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args } } else if (Z_TYPE_P(entry) == IS_ARRAY) { array_init(&tmp); - zend_hash_apply_with_arguments(Z_ARRVAL_P(entry) TSRMLS_CC, add_config_entry_cb, 1, tmp); + zend_hash_apply_with_arguments(Z_ARRVAL_P(entry), add_config_entry_cb, 1, tmp); zend_hash_update(Z_ARRVAL_P(retval), hash_key->key, &tmp); } return 0; @@ -4551,7 +4551,7 @@ PHP_FUNCTION(get_cfg_var) size_t varname_len; zval *retval; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) { return; } @@ -4560,7 +4560,7 @@ PHP_FUNCTION(get_cfg_var) if (retval) { if (Z_TYPE_P(retval) == IS_ARRAY) { array_init(return_value); - zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, add_config_entry_cb, 1, return_value); + zend_hash_apply_with_arguments(Z_ARRVAL_P(retval), add_config_entry_cb, 1, return_value); return; } else { RETURN_STRING(Z_STRVAL_P(retval)); @@ -4577,12 +4577,12 @@ PHP_FUNCTION(set_magic_quotes_runtime) { zend_bool new_setting; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &new_setting) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &new_setting) == FAILURE) { return; } if (new_setting) { - php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore"); + php_error_docref(NULL, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore"); } RETURN_FALSE; } @@ -4633,7 +4633,7 @@ PHP_FUNCTION(error_log) int opt_err = 0, argc = ZEND_NUM_ARGS(); zend_long erropt = 0; - if (zend_parse_parameters(argc TSRMLS_CC, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) { + if (zend_parse_parameters(argc, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) { return; } @@ -4641,7 +4641,7 @@ PHP_FUNCTION(error_log) opt_err = (int)erropt; } - if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) { + if (_php_error_log_ex(opt_err, message, message_len, opt, headers) == FAILURE) { RETURN_FALSE; } @@ -4650,26 +4650,26 @@ PHP_FUNCTION(error_log) /* }}} */ /* For BC (not binary-safe!) */ -PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC) /* {{{ */ +PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers) /* {{{ */ { - return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers TSRMLS_CC); + return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers); } /* }}} */ -PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers TSRMLS_DC) /* {{{ */ +PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers) /* {{{ */ { php_stream *stream = NULL; switch (opt_err) { case 1: /*send an email */ - if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) { + if (!php_mail(opt, "PHP error_log message", message, headers, NULL)) { return FAILURE; } break; case 2: /*send to an address */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!"); + php_error_docref(NULL, E_WARNING, "TCP/IP option not available!"); return FAILURE; break; @@ -4684,14 +4684,14 @@ PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, cha case 4: /* send to SAPI */ if (sapi_module.log_message) { - sapi_module.log_message(message TSRMLS_CC); + sapi_module.log_message(message); } else { return FAILURE; } break; default: - php_log_err(message TSRMLS_CC); + php_log_err(message); break; } return SUCCESS; @@ -4702,7 +4702,7 @@ PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, cha Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */ PHP_FUNCTION(error_get_last) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) { return; } @@ -4726,7 +4726,7 @@ PHP_FUNCTION(call_user_func) zend_fcall_info_cache fci_cache; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) { return; } #else @@ -4738,7 +4738,7 @@ PHP_FUNCTION(call_user_func) fci.retval = &retval; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { ZVAL_COPY_VALUE(return_value, &retval); } } @@ -4754,7 +4754,7 @@ PHP_FUNCTION(call_user_func_array) zend_fcall_info_cache fci_cache; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, ¶ms) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, ¶ms) == FAILURE) { return; } #else @@ -4764,10 +4764,10 @@ PHP_FUNCTION(call_user_func_array) ZEND_PARSE_PARAMETERS_END(); #endif - zend_fcall_info_args(&fci, params TSRMLS_CC); + zend_fcall_info_args(&fci, params); fci.retval = &retval; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { ZVAL_COPY_VALUE(return_value, &retval); } @@ -4783,7 +4783,7 @@ PHP_FUNCTION(forward_static_call) zend_fcall_info fci; zend_fcall_info_cache fci_cache; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) { return; } @@ -4794,11 +4794,11 @@ PHP_FUNCTION(forward_static_call) fci.retval = &retval; if (EX(called_scope) && - instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) { + instanceof_function(EX(called_scope), fci_cache.calling_scope)) { fci_cache.called_scope = EX(called_scope); } - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { ZVAL_COPY_VALUE(return_value, &retval); } } @@ -4812,19 +4812,19 @@ PHP_FUNCTION(forward_static_call_array) zend_fcall_info fci; zend_fcall_info_cache fci_cache; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, ¶ms) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, ¶ms) == FAILURE) { return; } - zend_fcall_info_args(&fci, params TSRMLS_CC); + zend_fcall_info_args(&fci, params); fci.retval = &retval; if (EX(called_scope) && - instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) { + instanceof_function(EX(called_scope), fci_cache.calling_scope)) { fci_cache.called_scope = EX(called_scope); } - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { + if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { ZVAL_COPY_VALUE(return_value, &retval); } @@ -4856,13 +4856,13 @@ void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) /* { } /* }}} */ -static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */ +static int user_shutdown_function_call(zval *zv) /* {{{ */ { php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv); zval retval; zend_string *function_name; - if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) { + if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name)) { if (function_name) { php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name->val); zend_string_release(function_name); @@ -4888,7 +4888,7 @@ static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */ } /* }}} */ -static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) /* {{{ */ +static void user_tick_function_call(user_tick_function_entry *tick_fe) /* {{{ */ { zval retval; zval *function = &tick_fe->arguments[0]; @@ -4909,15 +4909,15 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) zval *obj, *method; if (Z_TYPE_P(function) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function)); + php_error_docref(NULL, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function)); } else if ( Z_TYPE_P(function) == IS_ARRAY && (obj = zend_hash_index_find(Z_ARRVAL_P(function), 0)) != NULL && (method = zend_hash_index_find(Z_ARRVAL_P(function), 1)) != NULL && Z_TYPE_P(obj) == IS_OBJECT && Z_TYPE_P(method) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method)); + php_error_docref(NULL, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method)); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call tick function"); + php_error_docref(NULL, E_WARNING, "Unable to call tick function"); } } @@ -4928,9 +4928,8 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) static void run_user_tick_functions(int tick_count) /* {{{ */ { - TSRMLS_FETCH(); - zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call TSRMLS_CC); + zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call); } /* }}} */ @@ -4939,43 +4938,42 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_ zval *func1 = &tick_fe1->arguments[0]; zval *func2 = &tick_fe2->arguments[0]; int ret; - TSRMLS_FETCH(); if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) { ret = (zend_binary_zval_strcmp(func1, func2) == 0); } else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) { zval result; - zend_compare_arrays(&result, func1, func2 TSRMLS_CC); + zend_compare_arrays(&result, func1, func2); ret = (Z_LVAL(result) == 0); } else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) { zval result; - zend_compare_objects(&result, func1, func2 TSRMLS_CC); + zend_compare_objects(&result, func1, func2); ret = (Z_LVAL(result) == 0); } else { ret = 0; } if (ret && tick_fe1->calling) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete tick function executed at the moment"); + php_error_docref(NULL, E_WARNING, "Unable to delete tick function executed at the moment"); return 0; } return ret; } /* }}} */ -PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */ +PHPAPI void php_call_shutdown_functions(void) /* {{{ */ { if (BG(user_shutdown_function_names)) { zend_try { - zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call TSRMLS_CC); + zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call); } zend_end_try(); - php_free_shutdown_functions(TSRMLS_C); + php_free_shutdown_functions(); } } /* }}} */ -PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ +PHPAPI void php_free_shutdown_functions(void) /* {{{ */ { if (BG(user_shutdown_function_names)) zend_try { @@ -5012,11 +5010,11 @@ PHP_FUNCTION(register_shutdown_function) } /* Prevent entering of anything but valid callback (syntax check only!) */ - if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name TSRMLS_CC)) { + if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name)) { if (callback_name) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val); + php_error_docref(NULL, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback passed"); + php_error_docref(NULL, E_WARNING, "Invalid shutdown callback passed"); } efree(shutdown_function_entry.arguments); RETVAL_FALSE; @@ -5037,7 +5035,7 @@ PHP_FUNCTION(register_shutdown_function) } /* }}} */ -PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC) /* {{{ */ +PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry) /* {{{ */ { if (!BG(user_shutdown_function_names)) { ALLOC_HASHTABLE(BG(user_shutdown_function_names)); @@ -5048,7 +5046,7 @@ PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t fun } /* }}} */ -PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC) /* {{{ */ +PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len) /* {{{ */ { if (BG(user_shutdown_function_names)) { return zend_hash_str_del(BG(user_shutdown_function_names), function_name, function_len) != FAILURE; @@ -5058,7 +5056,7 @@ PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t funct } /* }}} */ -PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC) /* {{{ */ +PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry) /* {{{ */ { if (!BG(user_shutdown_function_names)) { ALLOC_HASHTABLE(BG(user_shutdown_function_names)); @@ -5088,32 +5086,32 @@ PHP_FUNCTION(highlight_file) zend_syntax_highlighter_ini syntax_highlighter_ini; zend_bool i = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &i) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &filename, &filename_len, &i) == FAILURE) { RETURN_FALSE; } - if (php_check_open_basedir(filename TSRMLS_CC)) { + if (php_check_open_basedir(filename)) { RETURN_FALSE; } if (i) { - php_output_start_default(TSRMLS_C); + php_output_start_default(); } php_get_highlight_struct(&syntax_highlighter_ini); - ret = highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC); + ret = highlight_file(filename, &syntax_highlighter_ini); if (ret == FAILURE) { if (i) { - php_output_end(TSRMLS_C); + php_output_end(); } RETURN_FALSE; } if (i) { - php_output_get_contents(return_value TSRMLS_CC); - php_output_discard(TSRMLS_C); + php_output_get_contents(return_value); + php_output_discard(); } else { RETURN_TRUE; } @@ -5129,30 +5127,30 @@ PHP_FUNCTION(php_strip_whitespace) zend_lex_state original_lex_state; zend_file_handle file_handle = {{0}}; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { RETURN_FALSE; } - php_output_start_default(TSRMLS_C); + php_output_start_default(); file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = filename; file_handle.free_filename = 0; file_handle.opened_path = NULL; - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (open_file_for_scanning(&file_handle TSRMLS_CC) == FAILURE) { - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - php_output_end(TSRMLS_C); + zend_save_lexical_state(&original_lex_state); + if (open_file_for_scanning(&file_handle) == FAILURE) { + zend_restore_lexical_state(&original_lex_state); + php_output_end(); RETURN_EMPTY_STRING(); } - zend_strip(TSRMLS_C); + zend_strip(); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); + zend_destroy_file_handle(&file_handle); + zend_restore_lexical_state(&original_lex_state); - php_output_get_contents(return_value TSRMLS_CC); - php_output_discard(TSRMLS_C); + php_output_get_contents(return_value); + php_output_discard(); } /* }}} */ @@ -5166,26 +5164,26 @@ PHP_FUNCTION(highlight_string) zend_bool i = 0; int old_error_reporting = EG(error_reporting); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &expr, &i) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &expr, &i) == FAILURE) { RETURN_FALSE; } convert_to_string_ex(expr); if (i) { - php_output_start_default(TSRMLS_C); + php_output_start_default(); } EG(error_reporting) = E_ERROR; php_get_highlight_struct(&syntax_highlighter_ini); - hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC); + hicompiled_string_description = zend_make_compiled_string_description("highlighted code"); - if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) { + if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description) == FAILURE) { efree(hicompiled_string_description); EG(error_reporting) = old_error_reporting; if (i) { - php_output_end(TSRMLS_C); + php_output_end(); } RETURN_FALSE; } @@ -5194,8 +5192,8 @@ PHP_FUNCTION(highlight_string) EG(error_reporting) = old_error_reporting; if (i) { - php_output_get_contents(return_value TSRMLS_CC); - php_output_discard(TSRMLS_C); + php_output_get_contents(return_value); + php_output_discard(); } else { RETURN_TRUE; } @@ -5209,7 +5207,7 @@ PHP_FUNCTION(ini_get) char *varname, *str; size_t varname_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) { return; } @@ -5223,7 +5221,7 @@ PHP_FUNCTION(ini_get) } /* }}} */ -static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ +static int php_ini_get_option(zval *zv, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zend_ini_entry *ini_entry = Z_PTR_P(zv); zval *ini_array = va_arg(args, zval *); @@ -5282,22 +5280,22 @@ PHP_FUNCTION(ini_get_all) zend_module_entry *module; zend_bool details = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &extname, &extname_len, &details) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &extname, &extname_len, &details) == FAILURE) { return; } - zend_ini_sort_entries(TSRMLS_C); + zend_ini_sort_entries(); if (extname) { if ((module = zend_hash_str_find_ptr(&module_registry, extname, extname_len)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find extension '%s'", extname); + php_error_docref(NULL, E_WARNING, "Unable to find extension '%s'", extname); RETURN_FALSE; } extnumber = module->module_number; } array_init(return_value); - zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, php_ini_get_option, 2, return_value, extnumber, details); + zend_hash_apply_with_arguments(EG(ini_directives), php_ini_get_option, 2, return_value, extnumber, details); } /* }}} */ @@ -5319,7 +5317,7 @@ PHP_FUNCTION(ini_set) zend_string *new_value; char *old_value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &varname, &new_value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &varname, &new_value) == FAILURE) { return; } @@ -5341,14 +5339,14 @@ PHP_FUNCTION(ini_set) _CHECK_PATH(varname->val, varname->len, "mail.log") || _CHECK_PATH(varname->val, varname->len, "java.library.path") || _CHECK_PATH(varname->val, varname->len, "vpopmail.directory")) { - if (php_check_open_basedir(new_value->val TSRMLS_CC)) { + if (php_check_open_basedir(new_value->val)) { zval_dtor(return_value); RETURN_FALSE; } } } - if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) { + if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) { zval_dtor(return_value); RETURN_FALSE; } @@ -5361,7 +5359,7 @@ PHP_FUNCTION(ini_restore) { zend_string *varname; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &varname) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &varname) == FAILURE) { return; } @@ -5377,7 +5375,7 @@ PHP_FUNCTION(set_include_path) char *old_value; zend_string *key; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &new_value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &new_value) == FAILURE) { return; } @@ -5390,7 +5388,7 @@ PHP_FUNCTION(set_include_path) } key = zend_string_init("include_path", sizeof("include_path") - 1, 0); - if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) { + if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) { zend_string_release(key); zval_dtor(return_value); RETURN_FALSE; @@ -5405,7 +5403,7 @@ PHP_FUNCTION(get_include_path) { char *str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) { return; } @@ -5425,7 +5423,7 @@ PHP_FUNCTION(restore_include_path) { zend_string *key; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) { return; } key = zend_string_init("include_path", sizeof("include_path")-1, 0); @@ -5441,19 +5439,19 @@ PHP_FUNCTION(print_r) zval *var; zend_bool do_return = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &do_return) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &var, &do_return) == FAILURE) { RETURN_FALSE; } if (do_return) { - php_output_start_default(TSRMLS_C); + php_output_start_default(); } - zend_print_zval_r(var, 0 TSRMLS_CC); + zend_print_zval_r(var, 0); if (do_return) { - php_output_get_contents(return_value TSRMLS_CC); - php_output_discard(TSRMLS_C); + php_output_get_contents(return_value); + php_output_discard(); } else { RETURN_TRUE; } @@ -5483,7 +5481,7 @@ PHP_FUNCTION(ignore_user_abort) zend_string *arg = NULL; int old_setting; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &arg) == FAILURE) { return; } @@ -5491,7 +5489,7 @@ PHP_FUNCTION(ignore_user_abort) if (arg) { zend_string *key = zend_string_init("ignore_user_abort", sizeof("ignore_user_abort"), 0); - zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0); zend_string_release(key); } @@ -5508,7 +5506,7 @@ PHP_FUNCTION(getservbyname) size_t name_len, proto_len; struct servent *serv; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &proto, &proto_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &proto, &proto_len) == FAILURE) { return; } @@ -5542,7 +5540,7 @@ PHP_FUNCTION(getservbyport) zend_long port; struct servent *serv; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &port, &proto, &proto_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &port, &proto, &proto_len) == FAILURE) { return; } @@ -5566,7 +5564,7 @@ PHP_FUNCTION(getprotobyname) size_t name_len; struct protoent *ent; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { return; } @@ -5589,7 +5587,7 @@ PHP_FUNCTION(getprotobynumber) zend_long proto; struct protoent *ent; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &proto) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &proto) == FAILURE) { return; } @@ -5626,9 +5624,9 @@ PHP_FUNCTION(register_tick_function) RETURN_FALSE; } - if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name TSRMLS_CC)) { + if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name)) { efree(tick_fe.arguments); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid tick callback '%s' passed", function_name->val); + php_error_docref(NULL, E_WARNING, "Invalid tick callback '%s' passed", function_name->val); zend_string_release(function_name); RETURN_FALSE; } else if (function_name) { @@ -5644,7 +5642,7 @@ PHP_FUNCTION(register_tick_function) zend_llist_init(BG(user_tick_functions), sizeof(user_tick_function_entry), (llist_dtor_func_t) user_tick_function_dtor, 0); - php_add_tick_function(run_user_tick_functions TSRMLS_CC); + php_add_tick_function(run_user_tick_functions); } for (i = 0; i < tick_fe.arg_count; i++) { @@ -5666,7 +5664,7 @@ PHP_FUNCTION(unregister_tick_function) zval *function; user_tick_function_entry tick_fe; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/", &function) == FAILURE) { return; } @@ -5697,7 +5695,7 @@ PHP_FUNCTION(is_uploaded_file) RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &path_len) == FAILURE) { return; } @@ -5725,7 +5723,7 @@ PHP_FUNCTION(move_uploaded_file) RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) { return; } @@ -5733,7 +5731,7 @@ PHP_FUNCTION(move_uploaded_file) RETURN_FALSE; } - if (php_check_open_basedir(new_path TSRMLS_CC)) { + if (php_check_open_basedir(new_path)) { RETURN_FALSE; } @@ -5746,10 +5744,10 @@ PHP_FUNCTION(move_uploaded_file) ret = VCWD_CHMOD(new_path, 0666 & ~oldmask); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); } #endif - } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) { + } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR) == SUCCESS) { VCWD_UNLINK(path); successful = 1; } @@ -5757,7 +5755,7 @@ PHP_FUNCTION(move_uploaded_file) if (successful) { zend_hash_str_del(SG(rfc1867_uploaded_files), path, path_len); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to move '%s' to '%s'", path, new_path); + php_error_docref(NULL, E_WARNING, "Unable to move '%s' to '%s'", path, new_path); } RETURN_BOOL(successful); @@ -5766,7 +5764,7 @@ PHP_FUNCTION(move_uploaded_file) /* {{{ php_simple_ini_parser_cb */ -static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC) +static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr) { zval element; @@ -5826,7 +5824,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal /* {{{ php_ini_parser_cb_with_sections */ -static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC) +static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr) { if (callback_type == ZEND_INI_PARSER_SECTION) { array_init(&BG(active_ini_file_section)); @@ -5840,7 +5838,7 @@ static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, active_arr = arr; } - php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr TSRMLS_CC); + php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr); } } /* }}} */ @@ -5856,12 +5854,12 @@ PHP_FUNCTION(parse_ini_file) zend_file_handle fh; zend_ini_parser_cb_t ini_parser_cb; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) { RETURN_FALSE; } if (filename_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty!"); + php_error_docref(NULL, E_WARNING, "Filename cannot be empty!"); RETURN_FALSE; } @@ -5879,7 +5877,7 @@ PHP_FUNCTION(parse_ini_file) fh.type = ZEND_HANDLE_FILENAME; array_init(return_value); - if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) { + if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) { zval_dtor(return_value); RETURN_FALSE; } @@ -5896,7 +5894,7 @@ PHP_FUNCTION(parse_ini_string) zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL; zend_ini_parser_cb_t ini_parser_cb; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) { RETURN_FALSE; } @@ -5918,7 +5916,7 @@ PHP_FUNCTION(parse_ini_string) memset(string + str_len, 0, ZEND_MMAP_AHEAD); array_init(return_value); - if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) { + if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) { zval_dtor(return_value); RETVAL_FALSE; } @@ -5934,7 +5932,7 @@ PHP_FUNCTION(config_get_hash) /* {{{ */ HashTable *hash = php_ini_get_configuration_hash(); array_init(return_value); - zend_hash_apply_with_arguments(hash TSRMLS_CC, add_config_entry_cb, 1, return_value); + zend_hash_apply_with_arguments(hash, add_config_entry_cb, 1, return_value); } /* }}} */ #endif diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index c47ee0fb96..d6f926a90e 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -145,9 +145,9 @@ PHP_RSHUTDOWN_FUNCTION(user_filters); PHP_RSHUTDOWN_FUNCTION(browscap); /* Left for BC (not binary safe!) */ -PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC); -PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers TSRMLS_DC); -PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore TSRMLS_DC); +PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers); +PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers); +PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore); #if SIZEOF_INT == 4 /* Most 32-bit and 64-bit systems have 32-bit ints */ @@ -259,12 +259,12 @@ typedef struct _php_shutdown_function_entry { int arg_count; } php_shutdown_function_entry; -PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC); -PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC); -PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC); +PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry); +PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len); +PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry); -PHPAPI void php_call_shutdown_functions(TSRMLS_D); -PHPAPI void php_free_shutdown_functions(TSRMLS_D); +PHPAPI void php_call_shutdown_functions(void); +PHPAPI void php_free_shutdown_functions(void); #endif /* BASIC_FUNCTIONS_H */ diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 2ea837ff60..19d340a9d8 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -136,7 +136,7 @@ static void convert_browscap_pattern(zval *pattern, int persistent) /* {{{ */ } /* }}} */ -static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */ +static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg) /* {{{ */ { browser_data *bdata = arg; int persistent = bdata->htab->u.flags & HASH_FLAG_PERSISTENT; @@ -219,7 +219,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb } /* }}} */ -static int browscap_read_file(char *filename, browser_data *browdata, int persistent TSRMLS_DC) /* {{{ */ +static int browscap_read_file(char *filename, browser_data *browdata, int persistent) /* {{{ */ { zend_file_handle fh = {{0}}; @@ -251,7 +251,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis fh.type = ZEND_HANDLE_FP; browdata->current_section_name = NULL; zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_RAW, - (zend_ini_parser_cb_t) php_browscap_parser_cb, browdata TSRMLS_CC); + (zend_ini_parser_cb_t) php_browscap_parser_cb, browdata); if (browdata->current_section_name != NULL) { pefree(browdata->current_section_name, persistent); browdata->current_section_name = NULL; @@ -262,7 +262,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis /* }}} */ #ifdef ZTS -static void browscap_globals_ctor(zend_browscap_globals *browscap_globals TSRMLS_DC) /* {{{ */ +static void browscap_globals_ctor(zend_browscap_globals *browscap_globals) /* {{{ */ { browscap_globals->activation_bdata.htab = NULL; ZVAL_UNDEF(&browscap_globals->activation_bdata.current_section); @@ -272,7 +272,7 @@ static void browscap_globals_ctor(zend_browscap_globals *browscap_globals TSRMLS /* }}} */ #endif -static void browscap_bdata_dtor(browser_data *bdata, int persistent TSRMLS_DC) /* {{{ */ +static void browscap_bdata_dtor(browser_data *bdata, int persistent) /* {{{ */ { if (bdata->htab != NULL) { zend_hash_destroy(bdata->htab); @@ -294,7 +294,7 @@ PHP_INI_MH(OnChangeBrowscap) } else if (stage == PHP_INI_STAGE_ACTIVATE) { browser_data *bdata = &BROWSCAP_G(activation_bdata); if (bdata->filename[0] != '\0') { - browscap_bdata_dtor(bdata, 0 TSRMLS_CC); + browscap_bdata_dtor(bdata, 0); } if (VCWD_REALPATH(new_value->val, bdata->filename) == NULL) { return FAILURE; @@ -317,7 +317,7 @@ PHP_MINIT_FUNCTION(browscap) /* {{{ */ /* ctor call not really needed for non-ZTS */ if (browscap && browscap[0]) { - if (browscap_read_file(browscap, &global_bdata, 1 TSRMLS_CC) == FAILURE) { + if (browscap_read_file(browscap, &global_bdata, 1) == FAILURE) { return FAILURE; } } @@ -330,7 +330,7 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */ { browser_data *bdata = &BROWSCAP_G(activation_bdata); if (bdata->filename[0] != '\0') { - browscap_bdata_dtor(bdata, 0 TSRMLS_CC); + browscap_bdata_dtor(bdata, 0); } return SUCCESS; @@ -339,13 +339,13 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */ PHP_MSHUTDOWN_FUNCTION(browscap) /* {{{ */ { - browscap_bdata_dtor(&global_bdata, 1 TSRMLS_CC); + browscap_bdata_dtor(&global_bdata, 1); return SUCCESS; } /* }}} */ -static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */ +static int browser_reg_compare(zval *browser, int num_args, va_list args, zend_hash_key *key) /* {{{ */ { zval *browser_regex, *previous_match; pcre *re; @@ -369,7 +369,7 @@ static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list ar return 0; } - re = pcre_get_compiled_regex(Z_STR_P(browser_regex), &re_extra, &re_options TSRMLS_CC); + re = pcre_get_compiled_regex(Z_STR_P(browser_regex), &re_extra, &re_options); if (re == NULL) { return 0; } @@ -446,30 +446,30 @@ PHP_FUNCTION(get_browser) if (BROWSCAP_G(activation_bdata).filename[0] != '\0') { bdata = &BROWSCAP_G(activation_bdata); if (bdata->htab == NULL) { /* not initialized yet */ - if (browscap_read_file(bdata->filename, bdata, 0 TSRMLS_CC) == FAILURE) { + if (browscap_read_file(bdata->filename, bdata, 0) == FAILURE) { RETURN_FALSE; } } } else { if (!global_bdata.htab) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "browscap ini directive not set"); + php_error_docref(NULL, E_WARNING, "browscap ini directive not set"); RETURN_FALSE; } bdata = &global_bdata; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &agent_name, &agent_name_len, &return_array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &agent_name, &agent_name_len, &return_array) == FAILURE) { return; } if (agent_name == NULL) { zend_string *key = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0); - zend_is_auto_global(key TSRMLS_CC); + zend_is_auto_global(key); zend_string_release(key); if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF || (http_user_agent = zend_hash_str_find(HASH_OF(&PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT")-1)) == NULL ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name"); + php_error_docref(NULL, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name"); RETURN_FALSE; } agent_name = Z_STRVAL_P(http_user_agent); @@ -481,7 +481,7 @@ PHP_FUNCTION(get_browser) if ((agent = zend_hash_str_find(bdata->htab, lookup_browser_name, agent_name_len)) == NULL) { ZVAL_UNDEF(&found_browser_entry); - zend_hash_apply_with_arguments(bdata->htab TSRMLS_CC, browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry); + zend_hash_apply_with_arguments(bdata->htab, browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry); if (Z_TYPE(found_browser_entry) != IS_UNDEF) { agent = &found_browser_entry; diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index a515b492b8..be49239dfa 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -31,7 +31,7 @@ PHP_NAMED_FUNCTION(php_if_crc32) php_uint32 crcinit = 0; register php_uint32 crc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &p, &nr) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &p, &nr) == FAILURE) { return; } crc = crcinit^0xFFFFFFFF; diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 1aeff9e679..27cfac37a5 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -25,10 +25,10 @@ #define CREDIT_LINE(module, authors) php_info_print_table_row(2, module, authors) -PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */ +PHPAPI void php_print_credits(int flag) /* {{{ */ { if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) { - php_print_info_htmlhead(TSRMLS_C); + php_print_info_htmlhead(); } if (!sapi_module.phpinfo_as_text) { diff --git a/ext/standard/credits.h b/ext/standard/credits.h index 0a501526f8..6ec57da58e 100644 --- a/ext/standard/credits.h +++ b/ext/standard/credits.h @@ -37,6 +37,6 @@ #endif /* HAVE_CREDITS_DEFS */ -PHPAPI void php_print_credits(int flag TSRMLS_DC); +PHPAPI void php_print_credits(int flag); #endif diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index efc4248732..439d3e0d07 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -98,7 +98,7 @@ #define PHP_STD_DES_CRYPT 1 #endif -#define PHP_CRYPT_RAND php_rand(TSRMLS_C) +#define PHP_CRYPT_RAND php_rand() PHP_MINIT_FUNCTION(crypt) /* {{{ */ { @@ -267,14 +267,14 @@ PHP_FUNCTION(crypt) * available (passing always 2-character salt). At least for glibc6.1 */ memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &str, &str_len, &salt_in, &salt_in_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &str, &str_len, &salt_in, &salt_in_len) == FAILURE) { return; } if (salt_in) { memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len)); } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash."); + php_error_docref(NULL, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash."); } /* The automatic salt generation covers standard DES, md5-crypt and Blowfish (simple) */ diff --git a/ext/standard/css.c b/ext/standard/css.c index f4469bea30..1511c08145 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -21,7 +21,7 @@ #include "php.h" #include "info.h" -PHPAPI void php_info_print_css(TSRMLS_D) /* {{{ */ +PHPAPI void php_info_print_css(void) /* {{{ */ { PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n"); PUTS("pre {margin: 0; font-family: monospace;}\n"); diff --git a/ext/standard/css.h b/ext/standard/css.h index 408abc1787..934ae840c5 100644 --- a/ext/standard/css.h +++ b/ext/standard/css.h @@ -21,6 +21,6 @@ #ifndef CSS_H #define CSS_H -PHPAPI void php_info_print_css(TSRMLS_D); +PHPAPI void php_info_print_css(void); #endif diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index 1718b75729..073d9d206f 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -187,7 +187,7 @@ _cyr_mac = { }; /* }}} */ -/* {{{ static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to TSRMLS_DC) +/* {{{ static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to) * This is the function that performs real in-place conversion of the string * between charsets. * Parameters: @@ -201,7 +201,7 @@ _cyr_mac = { * d - x-cp866 * m - x-mac-cyrillic *****************************************************************************/ -static char * php_convert_cyr_string(unsigned char *str, size_t length, char from, char to TSRMLS_DC) +static char * php_convert_cyr_string(unsigned char *str, size_t length, char from, char to) { const unsigned char *from_table, *to_table; unsigned char tmp; @@ -228,7 +228,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro case 'K': break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown source charset: %c", from); + php_error_docref(NULL, E_WARNING, "Unknown source charset: %c", from); break; } @@ -250,7 +250,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro case 'K': break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown destination charset: %c", to); + php_error_docref(NULL, E_WARNING, "Unknown destination charset: %c", to); break; } @@ -274,13 +274,13 @@ PHP_FUNCTION(convert_cyr_string) size_t input_len, fr_cs_len, to_cs_len; zend_string *str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) { return; } str = zend_string_init(input, input_len, 0); - php_convert_cyr_string((unsigned char *) str->val, str->len, fr_cs[0], to_cs[0] TSRMLS_CC); + php_convert_cyr_string((unsigned char *) str->val, str->len, fr_cs[0], to_cs[0]); RETVAL_NEW_STR(str); } /* }}} */ diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 39f8669038..091cb47ded 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -49,9 +49,9 @@ char *day_short_names[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -/* {{{ PHPAPI char *php_std_date(time_t t TSRMLS_DC) +/* {{{ PHPAPI char *php_std_date(time_t t) Return date string in standard format for http headers */ -PHPAPI char *php_std_date(time_t t TSRMLS_DC) +PHPAPI char *php_std_date(time_t t) { struct tm *tm1, tmbuf; char *str; @@ -92,7 +92,7 @@ PHP_FUNCTION(strptime) struct tm parsed_time; char *unparsed_part; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &ts, &ts_length, &format, &format_length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &ts, &ts_length, &format, &format_length) == FAILURE) { return; } diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h index 0edaff1b00..7b8ced8e67 100644 --- a/ext/standard/datetime.h +++ b/ext/standard/datetime.h @@ -26,6 +26,6 @@ PHP_FUNCTION(strptime); #endif -PHPAPI char *php_std_date(time_t t TSRMLS_DC); +PHPAPI char *php_std_date(time_t t); #endif /* DATETIME_H */ diff --git a/ext/standard/dir.c b/ext/standard/dir.c index b13f47be69..ec4e7045d7 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -75,14 +75,14 @@ static int le_dirp; static zend_class_entry *dir_class_entry_ptr; #define FETCH_DIRP() \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &id) == FAILURE) { \ + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &id) == FAILURE) { \ return; \ } \ if (ZEND_NUM_ARGS() == 0) { \ myself = getThis(); \ if (myself) { \ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find my handle property"); \ + php_error_docref(NULL, E_WARNING, "Unable to find my handle property"); \ RETURN_FALSE; \ } \ ZEND_FETCH_RESOURCE(dirp, php_stream *, tmp, -1, "Directory", php_file_le_stream()); \ @@ -90,7 +90,7 @@ static zend_class_entry *dir_class_entry_ptr; ZEND_FETCH_RESOURCE(dirp, php_stream *, 0, (int)DIRG(default_dir)->handle, "Directory", php_file_le_stream()); \ } \ } else { \ - dirp = (php_stream *) zend_fetch_resource(id TSRMLS_CC, -1, "Directory", NULL, 1, php_file_le_stream()); \ + dirp = (php_stream *) zend_fetch_resource(id, -1, "Directory", NULL, 1, php_file_le_stream()); \ if (!dirp) \ RETURN_FALSE; \ } @@ -109,7 +109,7 @@ static const zend_function_entry php_dir_class_functions[] = { }; -static void php_set_default_dir(zend_resource *res TSRMLS_DC) +static void php_set_default_dir(zend_resource *res) { if (DIRG(default_dir)) { zend_list_delete(DIRG(default_dir)); @@ -134,7 +134,7 @@ PHP_MINIT_FUNCTION(dir) zend_class_entry dir_class_entry; INIT_CLASS_ENTRY(dir_class_entry, "Directory", php_dir_class_functions); - dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry TSRMLS_CC); + dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry); #ifdef ZTS ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL); @@ -219,7 +219,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) php_stream_context *context = NULL; php_stream *dirp; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dirname, &dir_len, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &dirname, &dir_len, &zcontext) == FAILURE) { RETURN_NULL(); } @@ -233,7 +233,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) dirp->flags |= PHP_STREAM_FLAG_NO_FCLOSE; - php_set_default_dir(dirp->res TSRMLS_CC); + php_set_default_dir(dirp->res); if (createobject) { object_init_ex(return_value, dir_class_entry_ptr); @@ -273,7 +273,7 @@ PHP_FUNCTION(closedir) FETCH_DIRP(); if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); + php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); RETURN_FALSE; } @@ -281,7 +281,7 @@ PHP_FUNCTION(closedir) zend_list_close(dirp->res); if (res == DIRG(default_dir)) { - php_set_default_dir(NULL TSRMLS_CC); + php_set_default_dir(NULL); } } /* }}} */ @@ -295,22 +295,22 @@ PHP_FUNCTION(chroot) int ret; size_t str_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { RETURN_FALSE; } ret = chroot(str); if (ret != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno); + php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; } - php_clear_stat_cache(1, NULL, 0 TSRMLS_CC); + php_clear_stat_cache(1, NULL, 0); ret = chdir("/"); if (ret != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno); + php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; } @@ -327,17 +327,17 @@ PHP_FUNCTION(chdir) int ret; size_t str_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &str, &str_len) == FAILURE) { RETURN_FALSE; } - if (php_check_open_basedir(str TSRMLS_CC)) { + if (php_check_open_basedir(str)) { RETURN_FALSE; } ret = VCWD_CHDIR(str); if (ret != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno); + php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; } @@ -389,7 +389,7 @@ PHP_FUNCTION(rewinddir) FETCH_DIRP(); if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); + php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); RETURN_FALSE; } @@ -408,7 +408,7 @@ PHP_NAMED_FUNCTION(php_if_readdir) FETCH_DIRP(); if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); + php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); RETURN_FALSE; } @@ -438,17 +438,17 @@ PHP_FUNCTION(glob) int ret; zend_bool basedir_limit = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &pattern, &pattern_len, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &pattern, &pattern_len, &flags) == FAILURE) { return; } if (pattern_len >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN); + php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN); RETURN_FALSE; } if ((GLOB_AVAILABLE_FLAGS & flags) != flags) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform"); + php_error_docref(NULL, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform"); RETURN_FALSE; } @@ -500,7 +500,7 @@ no_results: query is senseless on windows. For instance while *.txt is a pretty valid filename on EXT3, it's invalid on NTFS. */ if (PG(open_basedir) && *PG(open_basedir)) { - if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) { + if (php_check_open_basedir_ex(pattern, 0)) { RETURN_FALSE; } } @@ -512,7 +512,7 @@ no_results: array_init(return_value); for (n = 0; n < globbuf.gl_pathc; n++) { if (PG(open_basedir) && *PG(open_basedir)) { - if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0 TSRMLS_CC)) { + if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0)) { basedir_limit = 1; continue; } @@ -561,12 +561,12 @@ PHP_FUNCTION(scandir) zval *zcontext = NULL; php_stream_context *context = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) { return; } if (dirn_len < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory name cannot be empty"); + php_error_docref(NULL, E_WARNING, "Directory name cannot be empty"); RETURN_FALSE; } @@ -582,7 +582,7 @@ PHP_FUNCTION(scandir) n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasortr); } if (n < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "(errno %d): %s", errno, strerror(errno)); + php_error_docref(NULL, E_WARNING, "(errno %d): %s", errno, strerror(errno)); RETURN_FALSE; } diff --git a/ext/standard/dl.c b/ext/standard/dl.c index a9ca94c0ad..82baa4eaa3 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -56,17 +56,17 @@ PHPAPI PHP_FUNCTION(dl) char *filename; size_t filename_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) { return; } if (!PG(enable_dl)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled"); + php_error_docref(NULL, E_WARNING, "Dynamically loaded extensions aren't enabled"); RETURN_FALSE; } if (filename_len >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "File name exceeds the maximum allowed length of %d characters", MAXPATHLEN); + php_error_docref(NULL, E_WARNING, "File name exceeds the maximum allowed length of %d characters", MAXPATHLEN); RETURN_FALSE; } @@ -75,14 +75,14 @@ PHPAPI PHP_FUNCTION(dl) (strncmp(sapi_module.name, "embed", 5) != 0) ) { #ifdef ZTS - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", filename); + php_error_docref(NULL, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", filename); RETURN_FALSE; #else - php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "dl() is deprecated - use extension=%s in your php.ini", filename); + php_error_docref(NULL, E_DEPRECATED, "dl() is deprecated - use extension=%s in your php.ini", filename); #endif } - php_dl(filename, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC); + php_dl(filename, MODULE_TEMPORARY, return_value, 0); if (Z_LVAL_P(return_value) == 1) { EG(full_tables_cleanup) = 1; } @@ -99,7 +99,7 @@ PHPAPI PHP_FUNCTION(dl) /* {{{ php_load_extension */ -PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) +PHPAPI int php_load_extension(char *filename, int type, int start_now) { void *handle; char *libpath; @@ -124,7 +124,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) if (strchr(filename, '/') != NULL || strchr(filename, DEFAULT_SLASH) != NULL) { /* Passing modules with full path is not supported for dynamically loaded extensions */ if (type == MODULE_TEMPORARY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Temporary module name should contain only filename"); + php_error_docref(NULL, E_WARNING, "Temporary module name should contain only filename"); return FAILURE; } libpath = estrdup(filename); @@ -146,13 +146,13 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) #if PHP_WIN32 char *err = GET_DL_ERROR(); if (err && (*err != '\0')) { - php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, err); + php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, err); LocalFree(err); } else { - php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, "Unknown reason"); + php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, "Unknown reason"); } #else - php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR()); + php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR()); GET_DL_ERROR(); /* free the buffer storing the error */ #endif efree(libpath); @@ -173,11 +173,11 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) if (!get_module) { if (DL_FETCH_SYMBOL(handle, "zend_extension_entry") || DL_FETCH_SYMBOL(handle, "_zend_extension_entry")) { DL_UNLOAD(handle); - php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename); + php_error_docref(NULL, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename); return FAILURE; } DL_UNLOAD(handle); - php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (maybe not a PHP library) '%s'", filename); + php_error_docref(NULL, error_type, "Invalid library (maybe not a PHP library) '%s'", filename); return FAILURE; } module_entry = get_module(); @@ -216,7 +216,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) zend_api = module_entry->zend_api; } - php_error_docref(NULL TSRMLS_CC, error_type, + php_error_docref(NULL, error_type, "%s: Unable to initialize module\n" "Module compiled with module API=%d\n" "PHP compiled with module API=%d\n" @@ -226,7 +226,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) return FAILURE; } if(strcmp(module_entry->build_id, ZEND_MODULE_BUILD_ID)) { - php_error_docref(NULL TSRMLS_CC, error_type, + php_error_docref(NULL, error_type, "%s: Unable to initialize module\n" "Module compiled with build ID=%s\n" "PHP compiled with build ID=%s\n" @@ -239,19 +239,19 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) module_entry->module_number = zend_next_free_module(); module_entry->handle = handle; - if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) { + if ((module_entry = zend_register_module_ex(module_entry)) == NULL) { DL_UNLOAD(handle); return FAILURE; } - if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) { + if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry) == FAILURE) { DL_UNLOAD(handle); return FAILURE; } if ((type == MODULE_TEMPORARY || start_now) && module_entry->request_startup_func) { - if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name); + if (module_entry->request_startup_func(type, module_entry->module_number) == FAILURE) { + php_error_docref(NULL, error_type, "Unable to initialize module '%s'", module_entry->name); DL_UNLOAD(handle); return FAILURE; } @@ -262,10 +262,10 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) /* {{{ php_dl */ -PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC) +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now) { /* Load extension */ - if (php_load_extension(file, type, start_now TSRMLS_CC) == FAILURE) { + if (php_load_extension(file, type, start_now) == FAILURE) { RETVAL_FALSE; } else { RETVAL_TRUE; @@ -280,9 +280,9 @@ PHP_MINFO_FUNCTION(dl) #else -PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC) +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", file); + php_error_docref(NULL, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", file); RETURN_FALSE; } diff --git a/ext/standard/dl.h b/ext/standard/dl.h index 50ed19afc0..75fa0dd0f0 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -23,8 +23,8 @@ #ifndef DL_H #define DL_H -PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC); -PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC); +PHPAPI int php_load_extension(char *filename, int type, int start_now); +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now); /* dynamic loading functions */ PHPAPI PHP_FUNCTION(dl); diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 37cad8bfc9..604e390ea3 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -135,7 +135,7 @@ PHP_FUNCTION(gethostname) } if (gethostname(buf, sizeof(buf) - 1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to fetch host [%d]: %s", errno, strerror(errno)); + php_error_docref(NULL, E_WARNING, "unable to fetch host [%d]: %s", errno, strerror(errno)); RETURN_FALSE; } @@ -156,7 +156,7 @@ PHP_FUNCTION(gethostbyaddr) size_t addr_len; zend_string *hostname; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &addr, &addr_len) == FAILURE) { return; } @@ -164,9 +164,9 @@ PHP_FUNCTION(gethostbyaddr) if (hostname == NULL) { #if HAVE_IPV6 && HAVE_INET_PTON - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not a valid IPv4 or IPv6 address"); + php_error_docref(NULL, E_WARNING, "Address is not a valid IPv4 or IPv6 address"); #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not in a.b.c.d form"); + php_error_docref(NULL, E_WARNING, "Address is not in a.b.c.d form"); #endif RETVAL_FALSE; } else { @@ -217,7 +217,7 @@ PHP_FUNCTION(gethostbyname) char *hostname; size_t hostname_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &hostname_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hostname, &hostname_len) == FAILURE) { return; } @@ -235,7 +235,7 @@ PHP_FUNCTION(gethostbynamel) struct in_addr in; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &hostname_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hostname, &hostname_len) == FAILURE) { return; } @@ -356,12 +356,12 @@ PHP_FUNCTION(dns_check_record) struct __res_state *handle = &state; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) { return; } if (hostname_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty"); + php_error_docref(NULL, E_WARNING, "Host cannot be empty"); RETURN_FALSE; } @@ -379,7 +379,7 @@ PHP_FUNCTION(dns_check_record) else if (!strcasecmp("NAPTR", rectype)) type = DNS_T_NAPTR; else if (!strcasecmp("A6", rectype)) type = DNS_T_A6; else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", rectype); + php_error_docref(NULL, E_WARNING, "Type '%s' not supported", rectype); RETURN_FALSE; } } @@ -772,7 +772,7 @@ PHP_FUNCTION(dns_get_record) int type, first_query = 1, store_results = 1; zend_bool raw = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b", &hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) { return; } @@ -788,12 +788,12 @@ PHP_FUNCTION(dns_get_record) if (!raw) { if ((type_param & ~PHP_DNS_ALL) && (type_param != PHP_DNS_ANY)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%ld' not supported", type_param); + php_error_docref(NULL, E_WARNING, "Type '%ld' not supported", type_param); RETURN_FALSE; } } else { if ((type_param < 1) || (type_param > 0xFFFF)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "Numeric DNS record type must be between 1 and 65535, '%ld' given", type_param); RETURN_FALSE; } @@ -902,15 +902,15 @@ PHP_FUNCTION(dns_get_record) continue; case NO_RECOVERY: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unexpected server failure occurred."); + php_error_docref(NULL, E_WARNING, "An unexpected server failure occurred."); break; case TRY_AGAIN: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A temporary server error occurred."); + php_error_docref(NULL, E_WARNING, "A temporary server error occurred."); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed"); + php_error_docref(NULL, E_WARNING, "DNS Query failed"); } zval_dtor(return_value); RETURN_FALSE; @@ -928,7 +928,7 @@ PHP_FUNCTION(dns_get_record) while (qd-- > 0) { n = dn_skipname(cp, end); if (n < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse DNS data received"); + php_error_docref(NULL, E_WARNING, "Unable to parse DNS data received"); zval_dtor(return_value); php_dns_free_handle(handle); RETURN_FALSE; @@ -1000,7 +1000,7 @@ PHP_FUNCTION(dns_get_mx) struct __res_state *handle = &state; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|z/", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/|z/", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) { return; } diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index a0b917c5ca..fda264a3a8 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -50,7 +50,7 @@ PHP_FUNCTION(dns_get_mx) /* {{{ */ DNS_STATUS status; /* Return value of DnsQuery_A() function */ PDNS_RECORD pResult, pRec; /* Pointer to DNS_RECORD structure */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|z", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|z", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) { return; } @@ -99,12 +99,12 @@ PHP_FUNCTION(dns_check_record) DNS_STATUS status; /* Return value of DnsQuery_A() function */ PDNS_RECORD pResult; /* Pointer to DNS_RECORD structure */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) { return; } if (hostname_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty"); + php_error_docref(NULL, E_WARNING, "Host cannot be empty"); RETURN_FALSE; } @@ -122,7 +122,7 @@ PHP_FUNCTION(dns_check_record) else if (!strcasecmp("NAPTR", rectype)) type = DNS_TYPE_NAPTR; else if (!strcasecmp("A6", rectype)) type = DNS_TYPE_A6; else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", rectype); + php_error_docref(NULL, E_WARNING, "Type '%s' not supported", rectype); RETURN_FALSE; } } @@ -352,7 +352,7 @@ PHP_FUNCTION(dns_get_record) int type, type_to_fetch, first_query = 1, store_results = 1; zend_bool raw = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b", &hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) { return; } @@ -368,12 +368,12 @@ PHP_FUNCTION(dns_get_record) if (!raw) { if ((type_param & ~PHP_DNS_ALL) && (type_param != PHP_DNS_ANY)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%ld' not supported", type_param); + php_error_docref(NULL, E_WARNING, "Type '%ld' not supported", type_param); RETURN_FALSE; } } else { if ((type_param < 1) || (type_param > 0xFFFF)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "Numeric DNS record type must be between 1 and 65535, '%ld' given", type_param); RETURN_FALSE; } @@ -456,7 +456,7 @@ PHP_FUNCTION(dns_get_record) if (status == DNS_INFO_NO_RECORDS || status == DNS_ERROR_RCODE_NAME_ERROR) { continue; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed"); + php_error_docref(NULL, E_WARNING, "DNS Query failed"); zval_dtor(return_value); RETURN_FALSE; } diff --git a/ext/standard/exec.c b/ext/standard/exec.c index ca6942a9c9..bd65d60656 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -57,7 +57,7 @@ * If type==3, output will be printed binary, no lines will be saved or returned (passthru) * */ -PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC) +PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value) { FILE *fp; char *buf; @@ -80,7 +80,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ fp = VCWD_POPEN(cmd, "r"); #endif if (!fp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", cmd); + php_error_docref(NULL, E_WARNING, "Unable to fork [%s]", cmd); goto err; } @@ -110,8 +110,8 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ if (type == 1) { PHPWRITE(buf, bufl); - if (php_output_get_level(TSRMLS_C) < 1) { - sapi_flush(TSRMLS_C); + if (php_output_get_level() < 1) { + sapi_flush(); } } else if (type == 2) { /* strip trailing whitespaces */ @@ -177,27 +177,27 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ int ret; if (mode) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) { RETURN_FALSE; } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) { RETURN_FALSE; } } if (!cmd_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute a blank command"); + php_error_docref(NULL, E_WARNING, "Cannot execute a blank command"); RETURN_FALSE; } if (!ret_array) { - ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC); + ret = php_exec(mode, cmd, NULL, return_value); } else { if (Z_TYPE_P(ret_array) != IS_ARRAY) { zval_dtor(ret_array); array_init(ret_array); } - ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC); + ret = php_exec(2, cmd, ret_array, return_value); } if (ret_code) { zval_dtor(ret_code); @@ -248,7 +248,6 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str) char *p = NULL; #endif - TSRMLS_FETCH(); cmd = zend_string_alloc(2 * l, 0); @@ -340,7 +339,6 @@ PHPAPI zend_string *php_escape_shell_arg(char *str) zend_string *cmd; size_t estimate = (4 * l) + 3; - TSRMLS_FETCH(); cmd = zend_string_alloc(4 * l + 2, 0); /* worst case */ @@ -404,7 +402,7 @@ PHP_FUNCTION(escapeshellcmd) char *command; size_t command_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) { return; } @@ -423,7 +421,7 @@ PHP_FUNCTION(escapeshellarg) char *argument; size_t argument_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &argument, &argument_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &argument, &argument_len) == FAILURE) { return; } @@ -443,7 +441,7 @@ PHP_FUNCTION(shell_exec) zend_string *ret; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) { return; } @@ -452,7 +450,7 @@ PHP_FUNCTION(shell_exec) #else if ((in=VCWD_POPEN(command, "r"))==NULL) { #endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute '%s'", command); + php_error_docref(NULL, E_WARNING, "Unable to execute '%s'", command); RETURN_FALSE; } @@ -473,14 +471,14 @@ PHP_FUNCTION(proc_nice) { zend_long pri; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pri) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pri) == FAILURE) { RETURN_FALSE; } errno = 0; php_ignore_value(nice(pri)); if (errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only a super user may attempt to increase the priority of a process"); + php_error_docref(NULL, E_WARNING, "Only a super user may attempt to increase the priority of a process"); RETURN_FALSE; } diff --git a/ext/standard/exec.h b/ext/standard/exec.h index 79b0574e28..a14efe3601 100644 --- a/ext/standard/exec.h +++ b/ext/standard/exec.h @@ -36,6 +36,6 @@ PHP_MINIT_FUNCTION(proc_open); PHPAPI zend_string *php_escape_shell_cmd(char *); PHPAPI zend_string *php_escape_shell_arg(char *); -PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC); +PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value); #endif /* EXEC_H */ diff --git a/ext/standard/file.c b/ext/standard/file.c index e7d870d719..f7c6e3acb9 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -138,7 +138,7 @@ php_file_globals file_globals; /* sharing globals is *evil* */ static int le_stream_context = FAILURE; -PHPAPI int php_le_stream_context(TSRMLS_D) +PHPAPI int php_le_stream_context(void) { return le_stream_context; } @@ -156,7 +156,7 @@ static ZEND_RSRC_DTOR_FUNC(file_context_dtor) php_stream_context_free(context); } -static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC) +static void file_globals_ctor(php_file_globals *file_globals_p) { FG(pclose_ret) = 0; FG(pclose_wait) = 0; @@ -165,7 +165,7 @@ static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC) FG(wrapper_errors) = NULL; } -static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC) +static void file_globals_dtor(php_file_globals *file_globals_p) { } @@ -183,7 +183,7 @@ PHP_MINIT_FUNCTION(file) #ifdef ZTS ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor); #else - file_globals_ctor(&file_globals TSRMLS_CC); + file_globals_ctor(&file_globals); #endif REGISTER_INI_ENTRIES(); @@ -327,7 +327,7 @@ PHP_MINIT_FUNCTION(file) PHP_MSHUTDOWN_FUNCTION(file) /* {{{ */ { #ifndef ZTS - file_globals_dtor(&file_globals TSRMLS_CC); + file_globals_dtor(&file_globals); #endif return SUCCESS; } @@ -344,7 +344,7 @@ PHP_FUNCTION(flock) php_stream *stream; zend_long operation = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &res, &operation, &wouldblock) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z/", &res, &operation, &wouldblock) == FAILURE) { return; } @@ -352,7 +352,7 @@ PHP_FUNCTION(flock) act = operation & 3; if (act < 1 || act > 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal operation argument"); + php_error_docref(NULL, E_WARNING, "Illegal operation argument"); RETURN_FALSE; } @@ -393,7 +393,7 @@ PHP_FUNCTION(get_meta_tags) memset(&md, 0, sizeof(md)); /* Parse arguments */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &use_include_path) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &filename, &filename_len, &use_include_path) == FAILURE) { return; } @@ -408,7 +408,7 @@ PHP_FUNCTION(get_meta_tags) tok_last = TOK_EOF; - while (!done && (tok = php_next_meta_token(&md TSRMLS_CC)) != TOK_EOF) { + while (!done && (tok = php_next_meta_token(&md)) != TOK_EOF) { if (tok == TOK_ID) { if (tok_last == TOK_OPENTAG) { md.in_meta = !strcasecmp("meta", md.token_data); @@ -533,12 +533,12 @@ PHP_FUNCTION(file_get_contents) zend_string *contents; /* Parse arguments */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) { return; } if (ZEND_NUM_ARGS() == 5 && maxlen < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater than or equal to zero"); + php_error_docref(NULL, E_WARNING, "length must be greater than or equal to zero"); RETURN_FALSE; } @@ -552,13 +552,13 @@ PHP_FUNCTION(file_get_contents) } if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset); + php_error_docref(NULL, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset); php_stream_close(stream); RETURN_FALSE; } if (maxlen > INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX); + php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX); maxlen = INT_MAX; } if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) { @@ -587,7 +587,7 @@ PHP_FUNCTION(file_put_contents) char mode[3] = "wb"; char ret_ok = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/|lr!", &filename, &filename_len, &data, &flags, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/|lr!", &filename, &filename_len, &data, &flags, &zcontext) == FAILURE) { return; } @@ -603,7 +603,7 @@ PHP_FUNCTION(file_put_contents) /* check to make sure we are dealing with a regular file */ if (php_memnstr(filename, "://", sizeof("://") - 1, filename + filename_len)) { if (strncasecmp(filename, "file://", sizeof("file://") - 1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Exclusive locks may only be set for regular files"); + php_error_docref(NULL, E_WARNING, "Exclusive locks may only be set for regular files"); RETURN_FALSE; } } @@ -618,7 +618,7 @@ PHP_FUNCTION(file_put_contents) if (flags & LOCK_EX && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) { php_stream_close(stream); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Exclusive locks are not supported for this stream"); + php_error_docref(NULL, E_WARNING, "Exclusive locks are not supported for this stream"); RETURN_FALSE; } @@ -633,7 +633,7 @@ PHP_FUNCTION(file_put_contents) ret_ok = 0; } else { if (len > ZEND_LONG_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "content truncated from %zu to " ZEND_LONG_FMT " bytes", len, ZEND_LONG_MAX); + php_error_docref(NULL, E_WARNING, "content truncated from %zu to " ZEND_LONG_FMT " bytes", len, ZEND_LONG_MAX); len = ZEND_LONG_MAX; } numbytes = len; @@ -651,7 +651,7 @@ PHP_FUNCTION(file_put_contents) if (Z_STRLEN_P(data)) { numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data)); if (numbytes != Z_STRLEN_P(data)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pl of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data)); + php_error_docref(NULL, E_WARNING, "Only %pl of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data)); numbytes = -1; } } @@ -668,7 +668,7 @@ PHP_FUNCTION(file_put_contents) numbytes += str->len; bytes_written = php_stream_write(stream, str->val, str->len); if (bytes_written != str->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write %zd bytes to %s", str->len, filename); + php_error_docref(NULL, E_WARNING, "Failed to write %zd bytes to %s", str->len, filename); ret_ok = 0; zend_string_release(str); break; @@ -683,10 +683,10 @@ PHP_FUNCTION(file_put_contents) if (Z_OBJ_HT_P(data) != NULL) { zval out; - if (zend_std_cast_object_tostring(data, &out, IS_STRING TSRMLS_CC) == SUCCESS) { + if (zend_std_cast_object_tostring(data, &out, IS_STRING) == SUCCESS) { numbytes = php_stream_write(stream, Z_STRVAL(out), Z_STRLEN(out)); if (numbytes != Z_STRLEN(out)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out)); + php_error_docref(NULL, E_WARNING, "Only %pd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out)); numbytes = -1; } zval_dtor(&out); @@ -728,11 +728,11 @@ PHP_FUNCTION(file) zend_string *target_buf; /* Parse arguments */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) { return; } if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'" ZEND_LONG_FMT "' flag is not supported", flags); + php_error_docref(NULL, E_WARNING, "'" ZEND_LONG_FMT "' flag is not supported", flags); RETURN_FALSE; } @@ -754,7 +754,7 @@ PHP_FUNCTION(file) s = target_buf->val; e = target_buf->val + target_buf->len; - if (!(p = (char*)php_stream_locate_eol(stream, target_buf TSRMLS_CC))) { + if (!(p = (char*)php_stream_locate_eol(stream, target_buf))) { p = e; goto parse_eol; } @@ -811,22 +811,22 @@ PHP_FUNCTION(tempnam) int fd; zend_string *p; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) { return; } - if (php_check_open_basedir(dir TSRMLS_CC)) { + if (php_check_open_basedir(dir)) { RETURN_FALSE; } - p = php_basename(prefix, prefix_len, NULL, 0 TSRMLS_CC); + p = php_basename(prefix, prefix_len, NULL, 0); if (p->len > 64) { p->val[63] = '\0'; } RETVAL_FALSE; - if ((fd = php_open_temporary_fd_ex(dir, p->val, &opened_path, 1 TSRMLS_CC)) >= 0) { + if ((fd = php_open_temporary_fd_ex(dir, p->val, &opened_path, 1)) >= 0) { close(fd); // TODO: avoid reallocation ??? RETVAL_STRING(opened_path); @@ -867,7 +867,7 @@ PHP_NAMED_FUNCTION(php_if_fopen) php_stream *stream; php_stream_context *context = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) { RETURN_FALSE; } @@ -891,7 +891,7 @@ PHPAPI PHP_FUNCTION(fclose) php_stream *stream; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } #else @@ -903,7 +903,7 @@ PHPAPI PHP_FUNCTION(fclose) PHP_STREAM_TO_ZVAL(stream, res); if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid stream resource", stream->res->handle); + php_error_docref(NULL, E_WARNING, "%pd is not a valid stream resource", stream->res->handle); RETURN_FALSE; } @@ -927,7 +927,7 @@ PHP_FUNCTION(popen) php_stream *stream; char *posix_mode; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &command, &command_len, &mode, &mode_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &command, &command_len, &mode, &mode_len) == FAILURE) { return; } @@ -943,7 +943,7 @@ PHP_FUNCTION(popen) fp = VCWD_POPEN(command, posix_mode); if (!fp) { - php_error_docref2(NULL TSRMLS_CC, command, posix_mode, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, command, posix_mode, E_WARNING, "%s", strerror(errno)); efree(posix_mode); RETURN_FALSE; } @@ -951,7 +951,7 @@ PHP_FUNCTION(popen) stream = php_stream_fopen_from_pipe(fp, mode); if (stream == NULL) { - php_error_docref2(NULL TSRMLS_CC, command, mode, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, command, mode, E_WARNING, "%s", strerror(errno)); RETVAL_FALSE; } else { php_stream_to_zval(stream, return_value); @@ -968,7 +968,7 @@ PHP_FUNCTION(pclose) zval *res; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } @@ -988,7 +988,7 @@ PHPAPI PHP_FUNCTION(feof) zval *res; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } @@ -1013,7 +1013,7 @@ PHPAPI PHP_FUNCTION(fgets) size_t line_len = 0; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &len) == FAILURE) { RETURN_FALSE; } @@ -1027,7 +1027,7 @@ PHPAPI PHP_FUNCTION(fgets) } } else if (argc > 1) { if (len <= 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; } @@ -1067,7 +1067,7 @@ PHPAPI PHP_FUNCTION(fgetc) int result; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } @@ -1100,7 +1100,7 @@ PHPAPI PHP_FUNCTION(fgetss) char *allowed_tags=NULL; size_t allowed_tags_len=0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|lS", &fd, &bytes, &allowed) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|lS", &fd, &bytes, &allowed) == FAILURE) { RETURN_FALSE; } @@ -1108,7 +1108,7 @@ PHPAPI PHP_FUNCTION(fgetss) if (ZEND_NUM_ARGS() >= 2) { if (bytes <= 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; } @@ -1161,11 +1161,11 @@ PHP_FUNCTION(fscanf) size_t len; void *what; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) { return; } - what = zend_fetch_resource(file_handle TSRMLS_CC, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream()); + what = zend_fetch_resource(file_handle, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream()); /* we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up * with a leak if we have an invalid filehandle. This needs changing @@ -1179,7 +1179,7 @@ PHP_FUNCTION(fscanf) RETURN_FALSE; } - result = php_sscanf_internal(buf, format, argc, args, 0, return_value TSRMLS_CC); + result = php_sscanf_internal(buf, format, argc, args, 0, return_value); efree(buf); @@ -1201,7 +1201,7 @@ PHPAPI PHP_FUNCTION(fwrite) zend_long maxlen = 0; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) { RETURN_FALSE; } @@ -1233,7 +1233,7 @@ PHPAPI PHP_FUNCTION(fflush) int ret; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } @@ -1254,7 +1254,7 @@ PHPAPI PHP_FUNCTION(rewind) zval *res; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } @@ -1275,7 +1275,7 @@ PHPAPI PHP_FUNCTION(ftell) zend_long ret; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } @@ -1297,7 +1297,7 @@ PHPAPI PHP_FUNCTION(fseek) zend_long offset, whence = SEEK_SET; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &res, &offset, &whence) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &res, &offset, &whence) == FAILURE) { RETURN_FALSE; } @@ -1311,24 +1311,24 @@ PHPAPI PHP_FUNCTION(fseek) */ /* DEPRECATED APIs: Use php_stream_mkdir() instead */ -PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options TSRMLS_DC) +PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options) { int ret; - if (php_check_open_basedir(dir TSRMLS_CC)) { + if (php_check_open_basedir(dir)) { return -1; } if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0 && (options & REPORT_ERRORS)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); } return ret; } -PHPAPI int php_mkdir(const char *dir, zend_long mode TSRMLS_DC) +PHPAPI int php_mkdir(const char *dir, zend_long mode) { - return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC); + return php_mkdir_ex(dir, mode, REPORT_ERRORS); } /* }}} */ @@ -1343,7 +1343,7 @@ PHP_FUNCTION(mkdir) zend_bool recursive = 0; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) { RETURN_FALSE; } @@ -1362,7 +1362,7 @@ PHP_FUNCTION(rmdir) zval *zcontext = NULL; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dir, &dir_len, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &dir, &dir_len, &zcontext) == FAILURE) { RETURN_FALSE; } @@ -1384,7 +1384,7 @@ PHP_FUNCTION(readfile) php_stream *stream; php_stream_context *context = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) { RETURN_FALSE; } @@ -1414,7 +1414,7 @@ PHP_FUNCTION(umask) BG(umask) = oldumask; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mask) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mask) == FAILURE) { RETURN_FALSE; } @@ -1436,7 +1436,7 @@ PHPAPI PHP_FUNCTION(fpassthru) size_t size; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } @@ -1457,30 +1457,30 @@ PHP_FUNCTION(rename) php_stream_wrapper *wrapper; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) { RETURN_FALSE; } - wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0); if (!wrapper || !wrapper->wops) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper"); + php_error_docref(NULL, E_WARNING, "Unable to locate stream wrapper"); RETURN_FALSE; } if (!wrapper->wops->rename) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s wrapper does not support renaming", wrapper->wops->label ? wrapper->wops->label : "Source"); + php_error_docref(NULL, E_WARNING, "%s wrapper does not support renaming", wrapper->wops->label ? wrapper->wops->label : "Source"); RETURN_FALSE; } - if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0 TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot rename a file across wrapper types"); + if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0)) { + php_error_docref(NULL, E_WARNING, "Cannot rename a file across wrapper types"); RETURN_FALSE; } context = php_stream_context_from_zval(zcontext, 0); - RETURN_BOOL(wrapper->wops->rename(wrapper, old_name, new_name, 0, context TSRMLS_CC)); + RETURN_BOOL(wrapper->wops->rename(wrapper, old_name, new_name, 0, context)); } /* }}} */ @@ -1494,24 +1494,24 @@ PHP_FUNCTION(unlink) zval *zcontext = NULL; php_stream_context *context = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|r", &filename, &filename_len, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|r", &filename, &filename_len, &zcontext) == FAILURE) { RETURN_FALSE; } context = php_stream_context_from_zval(zcontext, 0); - wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(filename, NULL, 0); if (!wrapper || !wrapper->wops) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper"); + php_error_docref(NULL, E_WARNING, "Unable to locate stream wrapper"); RETURN_FALSE; } if (!wrapper->wops->unlink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s does not allow unlinking", wrapper->wops->label ? wrapper->wops->label : "Wrapper"); + php_error_docref(NULL, E_WARNING, "%s does not allow unlinking", wrapper->wops->label ? wrapper->wops->label : "Wrapper"); RETURN_FALSE; } - RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, REPORT_ERRORS, context TSRMLS_CC)); + RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, REPORT_ERRORS, context)); } /* }}} */ @@ -1523,14 +1523,14 @@ PHP_NAMED_FUNCTION(php_if_ftruncate) zend_long size; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &fp, &size) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &fp, &size) == FAILURE) { RETURN_FALSE; } PHP_STREAM_TO_ZVAL(stream, fp); if (!php_stream_truncate_supported(stream)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream!"); + php_error_docref(NULL, E_WARNING, "Can't truncate this stream!"); RETURN_FALSE; } @@ -1552,7 +1552,7 @@ PHP_NAMED_FUNCTION(php_if_fstat) "size", "atime", "mtime", "ctime", "blksize", "blocks" }; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fp) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &fp) == FAILURE) { RETURN_FALSE; } @@ -1642,17 +1642,17 @@ PHP_FUNCTION(copy) zval *zcontext = NULL; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) { return; } - if (php_check_open_basedir(source TSRMLS_CC)) { + if (php_check_open_basedir(source)) { RETURN_FALSE; } context = php_stream_context_from_zval(zcontext, 0); - if (php_copy_file_ctx(source, target, 0, context TSRMLS_CC) == SUCCESS) { + if (php_copy_file_ctx(source, target, 0, context) == SUCCESS) { RETURN_TRUE; } else { RETURN_FALSE; @@ -1662,23 +1662,23 @@ PHP_FUNCTION(copy) /* {{{ php_copy_file */ -PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC) +PHPAPI int php_copy_file(const char *src, const char *dest) { - return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC); + return php_copy_file_ctx(src, dest, 0, NULL); } /* }}} */ /* {{{ php_copy_file_ex */ -PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg TSRMLS_DC) +PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg) { - return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC); + return php_copy_file_ctx(src, dest, 0, NULL); } /* }}} */ /* {{{ php_copy_file_ctx */ -PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC) +PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx) { php_stream *srcstream = NULL, *deststream = NULL; int ret = FAILURE; @@ -1695,7 +1695,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php return ret; } if (S_ISDIR(src_s.sb.st_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument to copy() function cannot be a directory"); + php_error_docref(NULL, E_WARNING, "The first argument to copy() function cannot be a directory"); return FAILURE; } @@ -1710,7 +1710,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php return ret; } if (S_ISDIR(dest_s.sb.st_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument to copy() function cannot be a directory"); + php_error_docref(NULL, E_WARNING, "The second argument to copy() function cannot be a directory"); return FAILURE; } if (!src_s.sb.st_ino || !dest_s.sb.st_ino) { @@ -1726,10 +1726,10 @@ no_stat: char *sp, *dp; int res; - if ((sp = expand_filepath(src, NULL TSRMLS_CC)) == NULL) { + if ((sp = expand_filepath(src, NULL)) == NULL) { return ret; } - if ((dp = expand_filepath(dest, NULL TSRMLS_CC)) == NULL) { + if ((dp = expand_filepath(dest, NULL)) == NULL) { efree(sp); goto safe_to_copy; } @@ -1778,14 +1778,14 @@ PHPAPI PHP_FUNCTION(fread) zend_long len; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &res, &len) == FAILURE) { RETURN_FALSE; } PHP_STREAM_TO_ZVAL(stream, res); if (len <= 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; } @@ -1797,7 +1797,7 @@ PHPAPI PHP_FUNCTION(fread) } /* }}} */ -static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter TSRMLS_DC) /* {{{ */ +static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter) /* {{{ */ { int inc_len; unsigned char last_chars[2] = { 0, 0 }; @@ -1850,7 +1850,7 @@ PHP_FUNCTION(fputcsv) char *delimiter_str = NULL, *enclosure_str = NULL, *escape_str = NULL; size_t delimiter_str_len = 0, enclosure_str_len = 0, escape_str_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|sss", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|sss", &fp, &fields, &delimiter_str, &delimiter_str_len, &enclosure_str, &enclosure_str_len, &escape_str, &escape_str_len) == FAILURE) { @@ -1860,10 +1860,10 @@ PHP_FUNCTION(fputcsv) if (delimiter_str != NULL) { /* Make sure that there is at least one character in string */ if (delimiter_str_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; } else if (delimiter_str_len > 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character"); + php_error_docref(NULL, E_NOTICE, "delimiter must be a single character"); } /* use first character from string */ @@ -1872,10 +1872,10 @@ PHP_FUNCTION(fputcsv) if (enclosure_str != NULL) { if (enclosure_str_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; } else if (enclosure_str_len > 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character"); + php_error_docref(NULL, E_NOTICE, "enclosure must be a single character"); } /* use first character from string */ enclosure = *enclosure_str; @@ -1883,10 +1883,10 @@ PHP_FUNCTION(fputcsv) if (escape_str != NULL) { if (escape_str_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; } else if (escape_str_len > 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "escape must be a single character"); + php_error_docref(NULL, E_NOTICE, "escape must be a single character"); } /* use first character from string */ escape_char = *escape_str; @@ -1894,13 +1894,13 @@ PHP_FUNCTION(fputcsv) PHP_STREAM_TO_ZVAL(stream, fp); - ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char TSRMLS_CC); + ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char); RETURN_LONG(ret); } /* }}} */ -/* {{{ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) */ -PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) +/* {{{ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char) */ +PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char) { int count, i = 0; size_t ret; @@ -1982,7 +1982,7 @@ PHP_FUNCTION(fgetcsv) char *escape_str = NULL; size_t escape_str_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|zsss", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|zsss", &fd, &len_zv, &delimiter_str, &delimiter_str_len, &enclosure_str, &enclosure_str_len, &escape_str, &escape_str_len) == FAILURE @@ -1993,10 +1993,10 @@ PHP_FUNCTION(fgetcsv) if (delimiter_str != NULL) { /* Make sure that there is at least one character in string */ if (delimiter_str_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; } else if (delimiter_str_len > 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character"); + php_error_docref(NULL, E_NOTICE, "delimiter must be a single character"); } /* use first character from string */ @@ -2005,10 +2005,10 @@ PHP_FUNCTION(fgetcsv) if (enclosure_str != NULL) { if (enclosure_str_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; } else if (enclosure_str_len > 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character"); + php_error_docref(NULL, E_NOTICE, "enclosure must be a single character"); } /* use first character from string */ @@ -2017,10 +2017,10 @@ PHP_FUNCTION(fgetcsv) if (escape_str != NULL) { if (escape_str_len < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be character"); + php_error_docref(NULL, E_WARNING, "escape must be character"); RETURN_FALSE; } else if (escape_str_len > 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "escape must be a single character"); + php_error_docref(NULL, E_NOTICE, "escape must be a single character"); } escape = escape_str[0]; @@ -2029,7 +2029,7 @@ PHP_FUNCTION(fgetcsv) if (len_zv != NULL && Z_TYPE_P(len_zv) != IS_NULL) { len = zval_get_long(len_zv); if (len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); + php_error_docref(NULL, E_WARNING, "Length parameter may not be negative"); RETURN_FALSE; } else if (len == 0) { len = -1; @@ -2053,11 +2053,11 @@ PHP_FUNCTION(fgetcsv) } } - php_fgetcsv(stream, delimiter, enclosure, escape, buf_len, buf, return_value TSRMLS_CC); + php_fgetcsv(stream, delimiter, enclosure, escape, buf_len, buf, return_value); } /* }}} */ -PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC) /* {{{ */ +PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value) /* {{{ */ { char *temp, *tptr, *bptr, *line_end, *limit; size_t temp_len, line_end_len; @@ -2072,7 +2072,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char /* Strip trailing space from buf, saving end of line in case required for enclosure field */ bptr = buf; - tptr = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter TSRMLS_CC); + tptr = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter); line_end_len = buf_len - (size_t)(tptr - buf); line_end = limit = tptr; @@ -2170,7 +2170,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char bptr = buf = new_buf; hunk_begin = buf; - line_end = limit = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter TSRMLS_CC); + line_end = limit = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter); line_end_len = buf_len - (size_t)(limit - buf); state = 0; @@ -2296,7 +2296,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char memcpy(tptr, hunk_begin, bptr - hunk_begin); tptr += (bptr - hunk_begin); - comp_end = (char *)php_fgetcsv_lookup_trailing_spaces(temp, tptr - temp, delimiter TSRMLS_CC); + comp_end = (char *)php_fgetcsv_lookup_trailing_spaces(temp, tptr - temp, delimiter); if (*bptr == delimiter) { bptr++; } @@ -2325,7 +2325,7 @@ PHP_FUNCTION(realpath) char resolved_path_buff[MAXPATHLEN]; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { return; } #else @@ -2335,7 +2335,7 @@ PHP_FUNCTION(realpath) #endif if (VCWD_REALPATH(filename, resolved_path_buff)) { - if (php_check_open_basedir(resolved_path_buff TSRMLS_CC)) { + if (php_check_open_basedir(resolved_path_buff)) { RETURN_FALSE; } @@ -2357,7 +2357,7 @@ PHP_FUNCTION(realpath) /* {{{ php_next_meta_token Tokenizes an HTML file for get_meta_tags */ -php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC) +php_meta_tags_token php_next_meta_token(php_meta_tags_data *md) { int ch = 0, compliment; char buff[META_DEF_BUFSIZE + 1]; @@ -2468,16 +2468,16 @@ PHP_FUNCTION(fnmatch) size_t pattern_len, filename_len; zend_long flags = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) { return; } if (filename_len >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename exceeds the maximum allowed length of %d characters", MAXPATHLEN); + php_error_docref(NULL, E_WARNING, "Filename exceeds the maximum allowed length of %d characters", MAXPATHLEN); RETURN_FALSE; } if (pattern_len >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN); + php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN); RETURN_FALSE; } @@ -2493,7 +2493,7 @@ PHP_FUNCTION(sys_get_temp_dir) if (zend_parse_parameters_none() == FAILURE) { return; } - RETURN_STRING((char *)php_get_temporary_directory(TSRMLS_C)); + RETURN_STRING((char *)php_get_temporary_directory()); } /* }}} */ diff --git a/ext/standard/file.h b/ext/standard/file.h index 78cab4f62f..17c82424fc 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -74,15 +74,15 @@ PHP_FUNCTION(sys_get_temp_dir); PHP_MINIT_FUNCTION(user_streams); -PHPAPI int php_le_stream_context(TSRMLS_D); -PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block TSRMLS_DC); -PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC); -PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk TSRMLS_DC); -PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx TSRMLS_DC); -PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options TSRMLS_DC); -PHPAPI int php_mkdir(const char *dir, zend_long mode TSRMLS_DC); -PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC); -PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC); +PHPAPI int php_le_stream_context(void); +PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block); +PHPAPI int php_copy_file(const char *src, const char *dest); +PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk); +PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx); +PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options); +PHPAPI int php_mkdir(const char *dir, zend_long mode); +PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value); +PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char); #define META_DEF_BUFSIZE 8192 @@ -114,7 +114,7 @@ typedef struct _php_meta_tags_data { int in_meta; } php_meta_tags_data; -php_meta_tags_token php_next_meta_token(php_meta_tags_data * TSRMLS_DC); +php_meta_tags_token php_next_meta_token(php_meta_tags_data *); typedef struct { int pclose_ret; diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 80d4ca4388..40cebcf7c5 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -119,7 +119,7 @@ PHP_RSHUTDOWN_FUNCTION(filestat) /* {{{ */ } /* }}} */ -static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */ +static int php_disk_total_space(char *path, double *space) /* {{{ */ #if defined(WINDOWS) /* {{{ */ { double bytestotal = 0; @@ -152,7 +152,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */ &FreeBytesAvailableToCaller, &TotalNumberOfBytes, &TotalNumberOfFreeBytes) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err()); + php_error_docref(NULL, E_WARNING, "%s", php_win_err()); return FAILURE; } @@ -164,13 +164,13 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */ if (GetDiskFreeSpace(path, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err()); + php_error_docref(NULL, E_WARNING, "%s", php_win_err()); return FAILURE; } bytestotal = (double)TotalNumberOfClusters * (double)SectorsPerCluster * (double)BytesPerSector; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll"); + php_error_docref(NULL, E_WARNING, "Unable to load kernel32.dll"); return FAILURE; } @@ -203,7 +203,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */ #if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS) if (statvfs(path, &buf)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); return FAILURE; } if (buf.f_frsize) { @@ -214,7 +214,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */ #elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS) if (statfs(path, &buf)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); return FAILURE; } bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks)); @@ -235,22 +235,22 @@ PHP_FUNCTION(disk_total_space) char *path; size_t path_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &path, &path_len) == FAILURE) { return; } - if (php_check_open_basedir(path TSRMLS_CC)) { + if (php_check_open_basedir(path)) { RETURN_FALSE; } - if (php_disk_total_space(path, &bytestotal TSRMLS_CC) == SUCCESS) { + if (php_disk_total_space(path, &bytestotal) == SUCCESS) { RETURN_DOUBLE(bytestotal); } RETURN_FALSE; } /* }}} */ -static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */ +static int php_disk_free_space(char *path, double *space) /* {{{ */ #if defined(WINDOWS) /* {{{ */ { double bytesfree = 0; @@ -284,7 +284,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */ &FreeBytesAvailableToCaller, &TotalNumberOfBytes, &TotalNumberOfFreeBytes) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err()); + php_error_docref(NULL, E_WARNING, "%s", php_win_err()); return FAILURE; } @@ -296,13 +296,13 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */ if (GetDiskFreeSpace(path, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err()); + php_error_docref(NULL, E_WARNING, "%s", php_win_err()); return FAILURE; } bytesfree = (double)NumberOfFreeClusters * (double)SectorsPerCluster * (double)BytesPerSector; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll"); + php_error_docref(NULL, E_WARNING, "Unable to load kernel32.dll"); return FAILURE; } @@ -335,7 +335,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */ #if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS) if (statvfs(path, &buf)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); return FAILURE; } if (buf.f_frsize) { @@ -345,7 +345,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */ } #elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS) if (statfs(path, &buf)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); return FAILURE; } #ifdef NETWARE @@ -370,15 +370,15 @@ PHP_FUNCTION(disk_free_space) char *path; size_t path_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &path, &path_len) == FAILURE) { return; } - if (php_check_open_basedir(path TSRMLS_CC)) { + if (php_check_open_basedir(path)) { RETURN_FALSE; } - if (php_disk_free_space(path, &bytesfree TSRMLS_CC) == SUCCESS) { + if (php_disk_free_space(path, &bytesfree) == SUCCESS) { RETURN_DOUBLE(bytesfree); } RETURN_FALSE; @@ -386,7 +386,7 @@ PHP_FUNCTION(disk_free_space) /* }}} */ #if !defined(WINDOWS) && !defined(NETWARE) -PHPAPI int php_get_gid_by_name(const char *name, gid_t *gid TSRMLS_DC) +PHPAPI int php_get_gid_by_name(const char *name, gid_t *gid) { #if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX) struct group gr; @@ -428,11 +428,11 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ #endif php_stream_wrapper *wrapper; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &group) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/", &filename, &filename_len, &group) == FAILURE) { RETURN_FALSE; } - wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(filename, NULL, 0); if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) { if(wrapper && wrapper->wops->stream_metadata) { int option; @@ -444,10 +444,10 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ option = PHP_STREAM_META_GROUP_NAME; value = Z_STRVAL_P(group); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group)); + php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group)); RETURN_FALSE; } - if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL TSRMLS_CC)) { + if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) { RETURN_TRUE; } else { RETURN_FALSE; @@ -455,7 +455,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ } else { #if !defined(WINDOWS) /* On Windows, we expect regular chgrp to fail silently by default */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chgrp() for a non-standard stream"); + php_error_docref(NULL, E_WARNING, "Can not call chgrp() for a non-standard stream"); #endif RETURN_FALSE; } @@ -468,17 +468,17 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ if (Z_TYPE_P(group) == IS_LONG) { gid = (gid_t)Z_LVAL_P(group); } else if (Z_TYPE_P(group) == IS_STRING) { - if(php_get_gid_by_name(Z_STRVAL_P(group), &gid TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find gid for %s", Z_STRVAL_P(group)); + if(php_get_gid_by_name(Z_STRVAL_P(group), &gid) != SUCCESS) { + php_error_docref(NULL, E_WARNING, "Unable to find gid for %s", Z_STRVAL_P(group)); RETURN_FALSE; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group)); + php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group)); RETURN_FALSE; } /* Check the basedir */ - if (php_check_open_basedir(filename TSRMLS_CC)) { + if (php_check_open_basedir(filename)) { RETURN_FALSE; } @@ -490,7 +490,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ ret = VCWD_CHOWN(filename, -1, gid); } if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -523,7 +523,7 @@ PHP_FUNCTION(lchgrp) #endif /* !NETWARE */ #if !defined(WINDOWS) && !defined(NETWARE) -PHPAPI uid_t php_get_uid_by_name(const char *name, uid_t *uid TSRMLS_DC) +PHPAPI uid_t php_get_uid_by_name(const char *name, uid_t *uid) { #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R) struct passwd pw; @@ -565,11 +565,11 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ #endif php_stream_wrapper *wrapper; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &user) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/", &filename, &filename_len, &user) == FAILURE) { return; } - wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(filename, NULL, 0); if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) { if(wrapper && wrapper->wops->stream_metadata) { int option; @@ -581,10 +581,10 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ option = PHP_STREAM_META_OWNER_NAME; value = Z_STRVAL_P(user); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user)); + php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user)); RETURN_FALSE; } - if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL TSRMLS_CC)) { + if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) { RETURN_TRUE; } else { RETURN_FALSE; @@ -592,7 +592,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ } else { #if !defined(WINDOWS) /* On Windows, we expect regular chown to fail silently by default */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chown() for a non-standard stream"); + php_error_docref(NULL, E_WARNING, "Can not call chown() for a non-standard stream"); #endif RETURN_FALSE; } @@ -606,17 +606,17 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ if (Z_TYPE_P(user) == IS_LONG) { uid = (uid_t)Z_LVAL_P(user); } else if (Z_TYPE_P(user) == IS_STRING) { - if(php_get_uid_by_name(Z_STRVAL_P(user), &uid TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find uid for %s", Z_STRVAL_P(user)); + if(php_get_uid_by_name(Z_STRVAL_P(user), &uid) != SUCCESS) { + php_error_docref(NULL, E_WARNING, "Unable to find uid for %s", Z_STRVAL_P(user)); RETURN_FALSE; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user)); + php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user)); RETURN_FALSE; } /* Check the basedir */ - if (php_check_open_basedir(filename TSRMLS_CC)) { + if (php_check_open_basedir(filename)) { RETURN_FALSE; } @@ -628,7 +628,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ ret = VCWD_CHOWN(filename, uid, -1); } if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -673,26 +673,26 @@ PHP_FUNCTION(chmod) mode_t imode; php_stream_wrapper *wrapper; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &filename, &filename_len, &mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl", &filename, &filename_len, &mode) == FAILURE) { return; } - wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(filename, NULL, 0); if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) { if(wrapper && wrapper->wops->stream_metadata) { - if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_ACCESS, &mode, NULL TSRMLS_CC)) { + if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_ACCESS, &mode, NULL)) { RETURN_TRUE; } else { RETURN_FALSE; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chmod() for a non-standard stream"); + php_error_docref(NULL, E_WARNING, "Can not call chmod() for a non-standard stream"); RETURN_FALSE; } } /* Check the basedir */ - if (php_check_open_basedir(filename TSRMLS_CC)) { + if (php_check_open_basedir(filename)) { RETURN_FALSE; } @@ -700,7 +700,7 @@ PHP_FUNCTION(chmod) ret = VCWD_CHMOD(filename, imode); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -721,7 +721,7 @@ PHP_FUNCTION(touch) struct utimbuf *newtime = &newtimebuf; php_stream_wrapper *wrapper; - if (zend_parse_parameters(argc TSRMLS_CC, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) { + if (zend_parse_parameters(argc, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) { return; } @@ -749,10 +749,10 @@ PHP_FUNCTION(touch) WRONG_PARAM_COUNT; } - wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(filename, NULL, 0); if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) { if(wrapper && wrapper->wops->stream_metadata) { - if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL TSRMLS_CC)) { + if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL)) { RETURN_TRUE; } else { RETURN_FALSE; @@ -760,7 +760,7 @@ PHP_FUNCTION(touch) } else { php_stream *stream; if(argc > 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call touch() for a non-standard stream"); + php_error_docref(NULL, E_WARNING, "Can not call touch() for a non-standard stream"); RETURN_FALSE; } stream = php_stream_open_wrapper_ex(filename, "c", REPORT_ERRORS, NULL, NULL); @@ -774,7 +774,7 @@ PHP_FUNCTION(touch) } /* Check the basedir */ - if (php_check_open_basedir(filename TSRMLS_CC)) { + if (php_check_open_basedir(filename)) { RETURN_FALSE; } @@ -782,7 +782,7 @@ PHP_FUNCTION(touch) if (VCWD_ACCESS(filename, F_OK) != 0) { file = VCWD_FOPEN(filename, "w"); if (file == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create file %s because %s", filename, strerror(errno)); + php_error_docref(NULL, E_WARNING, "Unable to create file %s because %s", filename, strerror(errno)); RETURN_FALSE; } fclose(file); @@ -790,7 +790,7 @@ PHP_FUNCTION(touch) ret = VCWD_UTIME(filename, newtime); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Utime failed: %s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "Utime failed: %s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -800,7 +800,7 @@ PHP_FUNCTION(touch) /* {{{ php_clear_stat_cache() */ -PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC) +PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len) { /* always clear CurrentStatFile and CurrentLStatFile even if filename is not NULL * as it may contain outdated data (e.g. "nlink" for a directory when deleting a file @@ -815,9 +815,9 @@ PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *fil } if (clear_realpath_cache) { if (filename != NULL) { - realpath_cache_del(filename, filename_len TSRMLS_CC); + realpath_cache_del(filename, filename_len); } else { - realpath_cache_clean(TSRMLS_C); + realpath_cache_clean(); } } } @@ -831,11 +831,11 @@ PHP_FUNCTION(clearstatcache) char *filename = NULL; size_t filename_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) { return; } - php_clear_stat_cache(clear_realpath_cache, filename, (int)filename_len TSRMLS_CC); + php_clear_stat_cache(clear_realpath_cache, filename, (int)filename_len); } /* }}} */ @@ -846,7 +846,7 @@ PHP_FUNCTION(clearstatcache) /* {{{ php_stat */ -PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC) +PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value) { zval stat_dev, stat_ino, stat_mode, stat_nlink, stat_uid, stat_gid, stat_rdev, stat_size, stat_atime, stat_mtime, stat_ctime, stat_blksize, stat_blocks; @@ -864,7 +864,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ RETURN_FALSE; } - if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0 TSRMLS_CC)) == &php_plain_files_wrapper && php_check_open_basedir(local TSRMLS_CC)) { + if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0)) == &php_plain_files_wrapper && php_check_open_basedir(local)) { RETURN_FALSE; } @@ -906,7 +906,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ if (php_stream_stat_path_ex((char *)filename, flags, &ssb, NULL)) { /* Error Occurred */ if (!IS_EXISTS_CHECK(type)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename); + php_error_docref(NULL, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename); } RETURN_FALSE; } @@ -991,7 +991,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ case S_IFSOCK: RETURN_STRING("socket"); #endif } - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown file type (%d)", ssb.sb.st_mode&S_IFMT); + php_error_docref(NULL, E_NOTICE, "Unknown file type (%d)", ssb.sb.st_mode&S_IFMT); RETURN_STRING("unknown"); case FS_IS_W: RETURN_BOOL((ssb.sb.st_mode & wmask) != 0); @@ -1081,7 +1081,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ return; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Didn't understand stat call"); + php_error_docref(NULL, E_WARNING, "Didn't understand stat call"); RETURN_FALSE; } /* }}} */ @@ -1094,11 +1094,11 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \ char *filename; \ size_t filename_len; \ \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \ + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { \ return; \ } \ \ - php_stat(filename, (php_stat_len) filename_len, funcnum, return_value TSRMLS_CC); \ + php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \ } #else # define FileFunction(name, funcnum) \ @@ -1110,7 +1110,7 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \ Z_PARAM_PATH(filename, filename_len) \ ZEND_PARSE_PARAMETERS_END(); \ \ - php_stat(filename, (php_stat_len) filename_len, funcnum, return_value TSRMLS_CC); \ + php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \ } #endif /* }}} */ @@ -1212,14 +1212,14 @@ PHP_FUNCTION(realpath_cache_size) if (zend_parse_parameters_none() == FAILURE) { return; } - RETURN_LONG(realpath_cache_size(TSRMLS_C)); + RETURN_LONG(realpath_cache_size()); } /* {{{ proto bool realpath_cache_get() Get current size of realpath cache */ PHP_FUNCTION(realpath_cache_get) { - realpath_cache_bucket **buckets = realpath_cache_get_buckets(TSRMLS_C), **end = buckets + realpath_cache_max_buckets(TSRMLS_C); + realpath_cache_bucket **buckets = realpath_cache_get_buckets(), **end = buckets + realpath_cache_max_buckets(); if (zend_parse_parameters_none() == FAILURE) { return; diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 3fd27afa43..1a74abf89c 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -46,12 +46,12 @@ static php_stream_filter_status_t strfilter_rot13_filter( size_t consumed = 0; while (buckets_in->head) { - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(buckets_in->head); php_strtr(bucket->buf, bucket->buflen, rot13_from, rot13_to, 52); consumed += bucket->buflen; - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { @@ -67,7 +67,7 @@ static php_stream_filter_ops strfilter_rot13_ops = { "string.rot13" }; -static php_stream_filter *strfilter_rot13_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *strfilter_rot13_create(const char *filtername, zval *filterparams, int persistent) { return php_stream_filter_alloc(&strfilter_rot13_ops, NULL, persistent); } @@ -94,12 +94,12 @@ static php_stream_filter_status_t strfilter_toupper_filter( size_t consumed = 0; while (buckets_in->head) { - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(buckets_in->head); php_strtr(bucket->buf, bucket->buflen, lowercase, uppercase, 26); consumed += bucket->buflen; - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { @@ -122,12 +122,12 @@ static php_stream_filter_status_t strfilter_tolower_filter( size_t consumed = 0; while (buckets_in->head) { - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(buckets_in->head); php_strtr(bucket->buf, bucket->buflen, uppercase, lowercase, 26); consumed += bucket->buflen; - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { @@ -149,12 +149,12 @@ static php_stream_filter_ops strfilter_tolower_ops = { "string.tolower" }; -static php_stream_filter *strfilter_toupper_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *strfilter_toupper_create(const char *filtername, zval *filterparams, int persistent) { return php_stream_filter_alloc(&strfilter_toupper_ops, NULL, persistent); } -static php_stream_filter *strfilter_tolower_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *strfilter_tolower_create(const char *filtername, zval *filterparams, int persistent) { return php_stream_filter_alloc(&strfilter_tolower_ops, NULL, persistent); } @@ -214,12 +214,12 @@ static php_stream_filter_status_t strfilter_strip_tags_filter( php_strip_tags_filter *inst = (php_strip_tags_filter *) Z_PTR(thisfilter->abstract); while (buckets_in->head) { - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(buckets_in->head); consumed = bucket->buflen; bucket->buflen = php_strip_tags(bucket->buf, bucket->buflen, &(inst->state), (char *)inst->allowed_tags, inst->allowed_tags_len); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { @@ -229,7 +229,7 @@ static php_stream_filter_status_t strfilter_strip_tags_filter( return PSFS_PASS_ON; } -static void strfilter_strip_tags_dtor(php_stream_filter *thisfilter TSRMLS_DC) +static void strfilter_strip_tags_dtor(php_stream_filter *thisfilter) { assert(Z_PTR(thisfilter->abstract) != NULL); @@ -244,7 +244,7 @@ static php_stream_filter_ops strfilter_strip_tags_ops = { "string.strip_tags" }; -static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, int persistent) { php_strip_tags_filter *inst; smart_str tags_ss = {0}; @@ -1209,7 +1209,7 @@ typedef struct _php_convert_filter { #define PHP_CONV_QPRINT_ENCODE 3 #define PHP_CONV_QPRINT_DECODE 4 -static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pretval, size_t *pretval_len, char *field_name, size_t field_name_len, int persistent TSRMLS_DC) +static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pretval, size_t *pretval_len, char *field_name, size_t field_name_len, int persistent) { zval *tmpval; @@ -1334,7 +1334,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval, } #define GET_STR_PROP(ht, var, var_len, fldname, persistent) \ - php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent TSRMLS_CC) + php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent) #define GET_INT_PROP(ht, var, fldname) \ php_conv_get_int_prop_ex(ht, &var, fldname, sizeof(fldname)) @@ -1345,7 +1345,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval, #define GET_BOOL_PROP(ht, var, fldname) \ php_conv_get_bool_prop_ex(ht, &var, fldname, sizeof(fldname)) -static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent TSRMLS_DC) +static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent) { /* FIXME: I'll have to replace this ugly code by something neat (factories?) in the near future. */ @@ -1481,13 +1481,13 @@ out_failure: static int php_convert_filter_ctor(php_convert_filter *inst, int conv_mode, HashTable *conv_opts, - const char *filtername, int persistent TSRMLS_DC) + const char *filtername, int persistent) { inst->persistent = persistent; inst->filtername = pestrdup(filtername, persistent); inst->stub_len = 0; - if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent TSRMLS_CC)) == NULL) { + if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent)) == NULL) { goto out_failure; } @@ -1522,7 +1522,7 @@ static int strfilter_convert_append_bucket( php_stream *stream, php_stream_filter *filter, php_stream_bucket_brigade *buckets_out, const char *ps, size_t buf_len, size_t *consumed, - int persistent TSRMLS_DC) + int persistent) { php_conv_err_t err; php_stream_bucket *new_bucket; @@ -1557,14 +1557,14 @@ static int strfilter_convert_append_bucket( switch (err) { case PHP_CONV_ERR_INVALID_SEQ: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername); goto out_failure; case PHP_CONV_ERR_MORE: if (ps != NULL) { if (icnt > 0) { if (inst->stub_len >= sizeof(inst->stub)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername); goto out_failure; } inst->stub[inst->stub_len++] = *(ps++); @@ -1579,7 +1579,7 @@ static int strfilter_convert_append_bucket( break; case PHP_CONV_ERR_UNEXPECTED_EOS: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername); goto out_failure; case PHP_CONV_ERR_TOO_BIG: { @@ -1590,11 +1590,11 @@ static int strfilter_convert_append_bucket( if (new_out_buf_size < out_buf_size) { /* whoa! no bigger buckets are sold anywhere... */ - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { + if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) { goto out_failure; } - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, new_bucket); out_buf_size = ocnt = initial_out_buf_size; if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) { @@ -1603,11 +1603,11 @@ static int strfilter_convert_append_bucket( pd = out_buf; } else { if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) { - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { + if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) { goto out_failure; } - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, new_bucket); return FAILURE; } @@ -1619,7 +1619,7 @@ static int strfilter_convert_append_bucket( } break; case PHP_CONV_ERR_UNKNOWN: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): unknown error", inst->filtername); goto out_failure; default: @@ -1635,13 +1635,13 @@ static int strfilter_convert_append_bucket( php_conv_convert(inst->cd, &ps, &icnt, &pd, &ocnt))); switch (err) { case PHP_CONV_ERR_INVALID_SEQ: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername); goto out_failure; case PHP_CONV_ERR_MORE: if (ps != NULL) { if (icnt > sizeof(inst->stub)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername); goto out_failure; } memcpy(inst->stub, ps, icnt); @@ -1649,7 +1649,7 @@ static int strfilter_convert_append_bucket( ps += icnt; icnt = 0; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected octet values", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): unexpected octet values", inst->filtername); goto out_failure; } break; @@ -1662,11 +1662,11 @@ static int strfilter_convert_append_bucket( if (new_out_buf_size < out_buf_size) { /* whoa! no bigger buckets are sold anywhere... */ - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { + if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) { goto out_failure; } - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, new_bucket); out_buf_size = ocnt = initial_out_buf_size; if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) { @@ -1675,11 +1675,11 @@ static int strfilter_convert_append_bucket( pd = out_buf; } else { if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) { - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { + if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) { goto out_failure; } - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, new_bucket); return FAILURE; } pd = new_out_buf + (pd - out_buf); @@ -1690,7 +1690,7 @@ static int strfilter_convert_append_bucket( } break; case PHP_CONV_ERR_UNKNOWN: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): unknown error", inst->filtername); goto out_failure; default: @@ -1702,10 +1702,10 @@ static int strfilter_convert_append_bucket( } if (out_buf_size > ocnt) { - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { + if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) { goto out_failure; } - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, new_bucket); } else { pefree(out_buf, persistent); } @@ -1735,21 +1735,21 @@ static php_stream_filter_status_t strfilter_convert_filter( while (buckets_in->head != NULL) { bucket = buckets_in->head; - php_stream_bucket_unlink(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); if (strfilter_convert_append_bucket(inst, stream, thisfilter, buckets_out, bucket->buf, bucket->buflen, &consumed, - php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) { + php_stream_is_persistent(stream)) != SUCCESS) { goto out_failure; } - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); } if (flags != PSFS_FLAG_NORMAL) { if (strfilter_convert_append_bucket(inst, stream, thisfilter, buckets_out, NULL, 0, &consumed, - php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) { + php_stream_is_persistent(stream)) != SUCCESS) { goto out_failure; } } @@ -1762,12 +1762,12 @@ static php_stream_filter_status_t strfilter_convert_filter( out_failure: if (bucket != NULL) { - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); } return PSFS_ERR_FATAL; } -static void strfilter_convert_dtor(php_stream_filter *thisfilter TSRMLS_DC) +static void strfilter_convert_dtor(php_stream_filter *thisfilter) { assert(Z_PTR(thisfilter->abstract) != NULL); @@ -1781,7 +1781,7 @@ static php_stream_filter_ops strfilter_convert_ops = { "convert.*" }; -static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent) { php_convert_filter *inst; php_stream_filter *retval = NULL; @@ -1790,7 +1790,7 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval int conv_mode = 0; if (filterparams != NULL && Z_TYPE_P(filterparams) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid filter parameter", filtername); + php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid filter parameter", filtername); return NULL; } @@ -1813,7 +1813,7 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval if (php_convert_filter_ctor(inst, conv_mode, (filterparams != NULL ? Z_ARRVAL_P(filterparams) : NULL), - filtername, persistent TSRMLS_CC) != SUCCESS) { + filtername, persistent) != SUCCESS) { goto out; } @@ -1855,9 +1855,9 @@ static php_stream_filter_status_t consumed_filter_filter( data->offset = php_stream_tell(stream); } while ((bucket = buckets_in->head) != NULL) { - php_stream_bucket_unlink(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); consumed += bucket->buflen; - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { *bytes_consumed = consumed; @@ -1870,7 +1870,7 @@ static php_stream_filter_status_t consumed_filter_filter( return PSFS_PASS_ON; } -static void consumed_filter_dtor(php_stream_filter *thisfilter TSRMLS_DC) +static void consumed_filter_dtor(php_stream_filter *thisfilter) { if (thisfilter && Z_PTR(thisfilter->abstract)) { php_consumed_filter_data *data = (php_consumed_filter_data*)Z_PTR(thisfilter->abstract); @@ -1884,7 +1884,7 @@ static php_stream_filter_ops consumed_filter_ops = { "consumed" }; -static php_stream_filter *consumed_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *consumed_filter_create(const char *filtername, zval *filterparams, int persistent) { php_stream_filter_ops *fops = NULL; php_consumed_filter_data *data; @@ -1896,7 +1896,7 @@ static php_stream_filter *consumed_filter_create(const char *filtername, zval *f /* Create this filter */ data = pecalloc(1, sizeof(php_consumed_filter_data), persistent); if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_consumed_filter_data)); + php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_consumed_filter_data)); return NULL; } data->persistent = persistent; @@ -2065,10 +2065,10 @@ static php_stream_filter_status_t php_chunked_filter( php_chunked_filter_data *data = (php_chunked_filter_data *) Z_PTR(thisfilter->abstract); while (buckets_in->head) { - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(buckets_in->head); consumed += bucket->buflen; bucket->buflen = php_dechunk(bucket->buf, bucket->buflen, data); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { @@ -2078,7 +2078,7 @@ static php_stream_filter_status_t php_chunked_filter( return PSFS_PASS_ON; } -static void php_chunked_dtor(php_stream_filter *thisfilter TSRMLS_DC) +static void php_chunked_dtor(php_stream_filter *thisfilter) { if (thisfilter && Z_PTR(thisfilter->abstract)) { php_chunked_filter_data *data = (php_chunked_filter_data *) Z_PTR(thisfilter->abstract); @@ -2092,7 +2092,7 @@ static php_stream_filter_ops chunked_filter_ops = { "dechunk" }; -static php_stream_filter *chunked_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *chunked_filter_create(const char *filtername, zval *filterparams, int persistent) { php_stream_filter_ops *fops = NULL; php_chunked_filter_data *data; @@ -2104,7 +2104,7 @@ static php_stream_filter *chunked_filter_create(const char *filtername, zval *fi /* Create this filter */ data = (php_chunked_filter_data *)pecalloc(1, sizeof(php_chunked_filter_data), persistent); if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_chunked_filter_data)); + php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_chunked_filter_data)); return NULL; } data->state = CHUNK_SIZE_START; @@ -2156,7 +2156,7 @@ PHP_MSHUTDOWN_FUNCTION(standard_filters) int i; for (i = 0; standard_filters[i].ops; i++) { - php_stream_filter_unregister_factory(standard_filters[i].ops->label TSRMLS_CC); + php_stream_filter_unregister_factory(standard_filters[i].ops->label); } return SUCCESS; } diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 1c3abb4d50..26a2276fea 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -57,10 +57,10 @@ static char HEXCHARS[] = "0123456789ABCDEF"; /* php_spintf_appendchar() {{{ */ inline static void -php_sprintf_appendchar(zend_string **buffer, size_t *pos, char add TSRMLS_DC) +php_sprintf_appendchar(zend_string **buffer, size_t *pos, char add) { if (!*buffer || (*pos + 1) >= (*buffer)->len) { - PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(TSRMLS_C), (*buffer)->len)); + PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(), (*buffer)->len)); *buffer = zend_string_realloc(*buffer, (*buffer)->len << 1, 0); } PRINTF_DEBUG(("sprintf: appending '%c', pos=\n", add, *pos)); @@ -209,7 +209,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos, size_t alignment, int precision, int adjust, char fmt, int always_sign - TSRMLS_DC) + ) { char num_buf[NUM_BUF_SIZE]; char *s = NULL; @@ -228,7 +228,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos, if ((adjust & ADJ_PRECISION) == 0) { precision = FLOAT_PRECISION; } else if (precision > MAX_FLOAT_PRECISION) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION); + php_error_docref(NULL, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION); precision = MAX_FLOAT_PRECISION; } @@ -383,7 +383,7 @@ php_sprintf_getnumber(char *buffer, size_t *pos) * */ static zend_string * -php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) +php_formatted_print(int param_count, int use_array, int format_offset) { zval *newargs = NULL; zval *args, *z_format; @@ -395,7 +395,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) int always_sign; size_t format_len; - if (zend_parse_parameters(param_count TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(param_count, "+", &args, &argc) == FAILURE) { return NULL; } @@ -443,9 +443,9 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos])); PRINTF_DEBUG(("sprintf: outpos=%d\n", outpos)); if (format[inpos] != '%') { - php_sprintf_appendchar(&result, &outpos, format[inpos++] TSRMLS_CC); + php_sprintf_appendchar(&result, &outpos, format[inpos++]); } else if (format[inpos + 1] == '%') { - php_sprintf_appendchar(&result, &outpos, '%' TSRMLS_CC); + php_sprintf_appendchar(&result, &outpos, '%'); inpos += 2; } else { /* starting a new format specifier, reset variables */ @@ -469,7 +469,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) if (newargs) { efree(newargs); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument number must be greater than zero"); + php_error_docref(NULL, E_WARNING, "Argument number must be greater than zero"); return NULL; } @@ -512,7 +512,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) if (newargs) { efree(newargs); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX); + php_error_docref(NULL, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX); if (newargs) { efree(newargs); } @@ -534,7 +534,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) if (newargs) { efree(newargs); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX); + php_error_docref(NULL, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX); if (newargs) { efree(newargs); } @@ -559,7 +559,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) if (newargs) { efree(newargs); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments"); + php_error_docref(NULL, E_WARNING, "Too few arguments"); return NULL; } @@ -606,12 +606,12 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) width, padding, alignment, precision, adjusting, format[inpos], always_sign - TSRMLS_CC); + ); break; case 'c': php_sprintf_appendchar(&result, &outpos, - (char) zval_get_long(tmp) TSRMLS_CC); + (char) zval_get_long(tmp)); break; case 'o': @@ -643,7 +643,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) break; case '%': - php_sprintf_appendchar(&result, &outpos, '%' TSRMLS_CC); + php_sprintf_appendchar(&result, &outpos, '%'); break; default: @@ -670,7 +670,7 @@ PHP_FUNCTION(user_sprintf) { zend_string *result; - if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0 TSRMLS_CC))==NULL) { + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) { RETURN_FALSE; } RETVAL_STR(result); @@ -683,7 +683,7 @@ PHP_FUNCTION(vsprintf) { zend_string *result; - if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0 TSRMLS_CC))==NULL) { + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) { RETURN_FALSE; } RETVAL_STR(result); @@ -697,7 +697,7 @@ PHP_FUNCTION(user_printf) zend_string *result; size_t rlen; - if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0 TSRMLS_CC))==NULL) { + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) { RETURN_FALSE; } rlen = PHPWRITE(result->val, result->len); @@ -713,7 +713,7 @@ PHP_FUNCTION(vprintf) zend_string *result; size_t rlen; - if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0 TSRMLS_CC))==NULL) { + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) { RETURN_FALSE; } rlen = PHPWRITE(result->val, result->len); @@ -734,13 +734,13 @@ PHP_FUNCTION(fprintf) WRONG_PARAM_COUNT; } - if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(1, "r", &arg1) == FAILURE) { RETURN_FALSE; } php_stream_from_zval(stream, arg1); - if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1 TSRMLS_CC))==NULL) { + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1))==NULL) { RETURN_FALSE; } @@ -763,13 +763,13 @@ PHP_FUNCTION(vfprintf) WRONG_PARAM_COUNT; } - if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(1, "r", &arg1) == FAILURE) { RETURN_FALSE; } php_stream_from_zval(stream, arg1); - if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1 TSRMLS_CC))==NULL) { + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1))==NULL) { RETURN_FALSE; } diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 30a6fda5d6..df7ceae079 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -51,7 +51,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) RETVAL_FALSE; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/z/d", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/z/d", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) { RETURN_FALSE; } @@ -92,7 +92,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) efree(hostname); } if (stream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:" ZEND_LONG_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val); + php_error_docref(NULL, E_WARNING, "unable to connect to %s:" ZEND_LONG_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val); } if (hashkey) { diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index 536fccaa3e..e74fd6b65e 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -35,27 +35,27 @@ PHP_FUNCTION(ftok) size_t pathname_len, proj_len; key_t k; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) { return; } if (pathname_len == 0){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pathname is invalid"); + php_error_docref(NULL, E_WARNING, "Pathname is invalid"); RETURN_LONG(-1); } if (proj_len != 1){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Project identifier is invalid"); + php_error_docref(NULL, E_WARNING, "Project identifier is invalid"); RETURN_LONG(-1); } - if (php_check_open_basedir(pathname TSRMLS_CC)) { + if (php_check_open_basedir(pathname)) { RETURN_LONG(-1); } k = ftok(pathname, proj[0]); if (k == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftok() failed - %s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "ftok() failed - %s", strerror(errno)); } RETURN_LONG(k); diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 526a45b470..361019382e 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -70,7 +70,7 @@ #include "php_fopen_wrappers.h" #define FTPS_ENCRYPT_DATA 1 -#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line) TSRMLS_CC) +#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line)) typedef struct _php_ftp_dirstream_data { php_stream *datastream; @@ -80,7 +80,7 @@ typedef struct _php_ftp_dirstream_data { /* {{{ get_ftp_result */ -static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC) +static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size) { while (php_stream_gets(stream, buffer, buffer_size-1) && !(isdigit((int) buffer[0]) && isdigit((int) buffer[1]) && @@ -91,7 +91,7 @@ static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer /* {{{ php_stream_ftp_stream_stat */ -static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) +static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb) { /* For now, we return with a failure code to prevent the underlying * file's details from being used instead. */ @@ -101,7 +101,7 @@ static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *s /* {{{ php_stream_ftp_stream_close */ -static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC) +static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream) { php_stream *controlstream = stream->wrapperthis; int ret = 0; @@ -114,7 +114,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream * /* For write modes close data stream first to signal EOF to server */ result = GET_FTP_RESULT(controlstream); if (result != 226 && result != 250) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FTP server error %d:%s", result, tmp_line); + php_error_docref(NULL, E_WARNING, "FTP server error %d:%s", result, tmp_line); ret = EOF; } } @@ -132,7 +132,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream * */ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context, php_stream **preuseid, - php_url **presource, int *puse_ssl, int *puse_ssl_on_data TSRMLS_DC) + php_url **presource, int *puse_ssl, int *puse_ssl_on_data) { php_stream *stream = NULL, *reuseid = NULL; php_url *resource = NULL; @@ -163,7 +163,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char goto connect_errexit; } - php_stream_context_set(stream, context TSRMLS_CC); + php_stream_context_set(stream, context); php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0); /* Start talking to ftp server */ @@ -203,9 +203,9 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char if (use_ssl) { if (php_stream_xport_crypto_setup(stream, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 - || php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode"); + STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 + || php_stream_xport_crypto_enable(stream, 1) < 0) { + php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode"); php_stream_close(stream); stream = NULL; goto connect_errexit; @@ -236,7 +236,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char unsigned char *s = val, *e = s + val_len; \ while (s < e) { \ if (iscntrl(*s)) { \ - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, err_msg, val); \ + php_stream_wrapper_log_error(wrapper, options, err_msg, val); \ goto connect_errexit; \ } \ s++; \ @@ -249,7 +249,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char PHP_FTP_CNTRL_CHK(resource->user, tmp_len, "Invalid login %s") - php_stream_printf(stream TSRMLS_CC, "USER %s\r\n", resource->user); + php_stream_printf(stream, "USER %s\r\n", resource->user); } else { php_stream_write_string(stream, "USER anonymous\r\n"); } @@ -266,12 +266,12 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char PHP_FTP_CNTRL_CHK(resource->pass, tmp_len, "Invalid password %s") - php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", resource->pass); + php_stream_printf(stream, "PASS %s\r\n", resource->pass); } else { /* if the user has configured who they are, send that as the password */ if (FG(from_address)) { - php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", FG(from_address)); + php_stream_printf(stream, "PASS %s\r\n", FG(from_address)); } else { php_stream_write_string(stream, "PASS anonymous\r\n"); } @@ -320,7 +320,7 @@ connect_errexit: /* {{{ php_fopen_do_pasv */ -static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phoststart TSRMLS_DC) +static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phoststart) { char tmp_line[512]; int result, i; @@ -412,7 +412,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ /* {{{ php_fopen_url_wrap_ftp */ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) + int options, char **opened_path, php_stream_context *context STREAMS_DC) { php_stream *stream = NULL, *datastream = NULL; php_url *resource = NULL; @@ -436,7 +436,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } if (strpbrk(mode, "wa+")) { if (read_write) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP does not support simultaneous read/write connections"); + php_stream_wrapper_log_error(wrapper, options, "FTP does not support simultaneous read/write connections"); return NULL; } if (strchr(mode, 'a')) { @@ -447,7 +447,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } if (!read_write) { /* No mode specified? */ - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unknown file open mode"); + php_stream_wrapper_log_error(wrapper, options, "Unknown file open mode"); return NULL; } @@ -455,15 +455,15 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa (tmpzval = php_stream_context_get_option(context, "ftp", "proxy")) != NULL) { if (read_write == 1) { /* Use http wrapper to proxy ftp request */ - return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC TSRMLS_CC); + return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC); } else { /* ftp proxy is read-only */ - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP proxy may only be used in read mode"); + php_stream_wrapper_log_error(wrapper, options, "FTP proxy may only be used in read mode"); return NULL; } } - stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC); + stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data); if (!stream) { goto errexit; } @@ -475,7 +475,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa goto errexit; /* find out the size of the file (verifying it exists) */ - php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", resource->path); + php_stream_printf(stream, "SIZE %s\r\n", resource->path); /* read the response */ result = GET_FTP_RESULT(stream); @@ -504,13 +504,13 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa if (allow_overwrite) { /* Context permits overwriting file, so we just delete whatever's there in preparation */ - php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path); + php_stream_printf(stream, "DELE %s\r\n", resource->path); result = GET_FTP_RESULT(stream); if (result >= 300 || result <= 199) { goto errexit; } } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Remote file already exists and overwrite context option not specified"); + php_stream_wrapper_log_error(wrapper, options, "Remote file already exists and overwrite context option not specified"); errno = EEXIST; goto errexit; } @@ -518,7 +518,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } /* set up the passive connection */ - portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC); + portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart); if (!portno) { goto errexit; @@ -531,10 +531,10 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa (tmpzval = php_stream_context_get_option(context, "ftp", "resume_pos")) != NULL && Z_TYPE_P(tmpzval) == IS_LONG && Z_LVAL_P(tmpzval) > 0) { - php_stream_printf(stream TSRMLS_CC, "REST %pd\r\n", Z_LVAL_P(tmpzval)); + php_stream_printf(stream, "REST %pd\r\n", Z_LVAL_P(tmpzval)); result = GET_FTP_RESULT(stream); if (result < 300 || result > 399) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval)); + php_stream_wrapper_log_error(wrapper, options, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval)); goto errexit; } } @@ -548,7 +548,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa /* Append */ memcpy(tmp_line, "APPE", sizeof("APPE")); } - php_stream_printf(stream TSRMLS_CC, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/")); + php_stream_printf(stream, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/")); /* open the data channel */ if (hoststart == NULL) { @@ -571,14 +571,14 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa goto errexit; } - php_stream_context_set(datastream, context TSRMLS_CC); + php_stream_context_set(datastream, context); php_stream_notify_progress_init(context, 0, file_size); if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 || - php_stream_xport_crypto_enable(datastream, 1 TSRMLS_CC) < 0)) { + STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 || + php_stream_xport_crypto_enable(datastream, 1) < 0)) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode"); + php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode"); php_stream_close(datastream); datastream = NULL; goto errexit; @@ -599,14 +599,14 @@ errexit: php_stream_close(stream); } if (tmp_line[0] != '\0') - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP server reports %s", tmp_line); + php_stream_wrapper_log_error(wrapper, options, "FTP server reports %s", tmp_line); return NULL; } /* }}} */ /* {{{ php_ftp_dirsteam_read */ -static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count) { php_stream_dirent *ent = (php_stream_dirent *)buf; php_stream *innerstream; @@ -627,7 +627,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count return 0; } - basename = php_basename(ent->d_name, tmp_len, NULL, 0 TSRMLS_CC); + basename = php_basename(ent->d_name, tmp_len, NULL, 0); tmp_len = MIN(sizeof(ent->d_name), basename->len - 1); memcpy(ent->d_name, basename->val, tmp_len); @@ -647,7 +647,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count /* {{{ php_ftp_dirstream_close */ -static int php_ftp_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_ftp_dirstream_close(php_stream *stream, int close_handle) { php_ftp_dirstream_data *data = stream->abstract; @@ -684,7 +684,7 @@ static php_stream_ops php_ftp_dirstream_ops = { /* {{{ php_stream_ftp_opendir */ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) + char **opened_path, php_stream_context *context STREAMS_DC) { php_stream *stream, *reuseid, *datastream = NULL; php_ftp_dirstream_data *dirsdata; @@ -696,7 +696,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat tmp_line[0] = '\0'; - stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC); + stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data); if (!stream) { goto opendir_errexit; } @@ -708,13 +708,13 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat goto opendir_errexit; /* set up the passive connection */ - portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC); + portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart); if (!portno) { goto opendir_errexit; } - php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/")); + php_stream_printf(stream, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/")); /* open the data channel */ if (hoststart == NULL) { @@ -735,13 +735,13 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat goto opendir_errexit; } - php_stream_context_set(datastream, context TSRMLS_CC); + php_stream_context_set(datastream, context); if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 || - php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0)) { + STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 || + php_stream_xport_crypto_enable(stream, 1) < 0)) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode"); + php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode"); php_stream_close(datastream); datastream = NULL; goto opendir_errexit; @@ -765,7 +765,7 @@ opendir_errexit: php_stream_close(stream); } if (tmp_line[0] != '\0') { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP server reports %s", tmp_line); + php_stream_wrapper_log_error(wrapper, options, "FTP server reports %s", tmp_line); } return NULL; } @@ -773,7 +773,7 @@ opendir_errexit: /* {{{ php_stream_ftp_url_stat */ -static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context) { php_stream *stream = NULL; php_url *resource = NULL; @@ -783,13 +783,13 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, /* If ssb is NULL then someone is misbehaving */ if (!ssb) return -1; - stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL TSRMLS_CC); + stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL); if (!stream) { goto stat_errexit; } ssb->sb.st_mode = 0644; /* FTP won't give us a valid mode, so approximate one based on being readable */ - php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */ + php_stream_printf(stream, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */ result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { ssb->sb.st_mode |= S_IFREG; @@ -805,7 +805,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, goto stat_errexit; } - php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")); + php_stream_printf(stream, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { /* Failure either means it doesn't exist @@ -820,7 +820,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, ssb->sb.st_size = atoi(tmp_line + 4); } - php_stream_printf(stream TSRMLS_CC, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/")); + php_stream_printf(stream, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/")); result = GET_FTP_RESULT(stream); if (result == 213) { char *p = tmp_line + 4; @@ -896,35 +896,35 @@ stat_errexit: /* {{{ php_stream_ftp_unlink */ -static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) { php_stream *stream = NULL; php_url *resource = NULL; int result; char tmp_line[512]; - stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC); + stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL); if (!stream) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url); + php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url); } goto unlink_errexit; } if (resource->path == NULL) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url); + php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url); } goto unlink_errexit; } /* Attempt to delete the file */ - php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/")); + php_stream_printf(stream, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/")); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Deleting file: %s", tmp_line); + php_error_docref(NULL, E_WARNING, "Error Deleting file: %s", tmp_line); } goto unlink_errexit; } @@ -946,7 +946,7 @@ unlink_errexit: /* {{{ php_stream_ftp_rename */ -static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context) { php_stream *stream = NULL; php_url *resource_from = NULL, *resource_to = NULL; @@ -974,32 +974,32 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr goto rename_errexit; } - stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL TSRMLS_CC); + stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL); if (!stream) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", resource_from->host); + php_error_docref(NULL, E_WARNING, "Unable to connect to %s", resource_from->host); } goto rename_errexit; } /* Rename FROM */ - php_stream_printf(stream TSRMLS_CC, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/")); + php_stream_printf(stream, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/")); result = GET_FTP_RESULT(stream); if (result < 300 || result > 399) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Renaming file: %s", tmp_line); + php_error_docref(NULL, E_WARNING, "Error Renaming file: %s", tmp_line); } goto rename_errexit; } /* Rename TO */ - php_stream_printf(stream TSRMLS_CC, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/")); + php_stream_printf(stream, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/")); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Renaming file: %s", tmp_line); + php_error_docref(NULL, E_WARNING, "Error Renaming file: %s", tmp_line); } goto rename_errexit; } @@ -1025,30 +1025,30 @@ rename_errexit: /* {{{ php_stream_ftp_mkdir */ -static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context) { php_stream *stream = NULL; php_url *resource = NULL; int result, recursive = options & PHP_STREAM_MKDIR_RECURSIVE; char tmp_line[512]; - stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC); + stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL); if (!stream) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url); + php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url); } goto mkdir_errexit; } if (resource->path == NULL) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url); + php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url); } goto mkdir_errexit; } if (!recursive) { - php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path); + php_stream_printf(stream, "MKD %s\r\n", resource->path); result = GET_FTP_RESULT(stream); } else { /* we look for directory separator from the end of string, thus hopefuly reducing our work load */ @@ -1060,7 +1060,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in /* find a top level directory we need to create */ while ((p = strrchr(buf, '/'))) { *p = '\0'; - php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", buf); + php_stream_printf(stream, "CWD %s\r\n", buf); result = GET_FTP_RESULT(stream); if (result >= 200 && result <= 299) { *p = '/'; @@ -1068,10 +1068,10 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in } } if (p == buf) { - php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path); + php_stream_printf(stream, "MKD %s\r\n", resource->path); result = GET_FTP_RESULT(stream); } else { - php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf); + php_stream_printf(stream, "MKD %s\r\n", buf); result = GET_FTP_RESULT(stream); if (result >= 200 && result <= 299) { if (!p) { @@ -1081,11 +1081,11 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in while (++p != e) { if (*p == '\0' && *(p + 1) != '\0') { *p = '/'; - php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf); + php_stream_printf(stream, "MKD %s\r\n", buf); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_line); + php_error_docref(NULL, E_WARNING, "%s", tmp_line); } break; } @@ -1119,34 +1119,34 @@ mkdir_errexit: /* {{{ php_stream_ftp_rmdir */ -static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) { php_stream *stream = NULL; php_url *resource = NULL; int result; char tmp_line[512]; - stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC); + stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL); if (!stream) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url); + php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url); } goto rmdir_errexit; } if (resource->path == NULL) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url); + php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url); } goto rmdir_errexit; } - php_stream_printf(stream TSRMLS_CC, "RMD %s\r\n", resource->path); + php_stream_printf(stream, "RMD %s\r\n", resource->path); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_line); + php_error_docref(NULL, E_WARNING, "%s", tmp_line); } goto rmdir_errexit; } diff --git a/ext/standard/head.c b/ext/standard/head.c index 56f02a3989..6a7f8582a0 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -42,12 +42,12 @@ PHP_FUNCTION(header) sapi_header_line ctr = {0}; size_t len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &ctr.line, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &ctr.line, &len, &rep, &ctr.response_code) == FAILURE) return; ctr.line_len = (uint)len; - sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr TSRMLS_CC); + sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr); } /* }}} */ @@ -58,18 +58,18 @@ PHP_FUNCTION(header_remove) sapi_header_line ctr = {0}; size_t len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ctr.line, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ctr.line, &len) == FAILURE) return; ctr.line_len = (uint)len; - sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr TSRMLS_CC); + sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr); } /* }}} */ -PHPAPI int php_header(TSRMLS_D) +PHPAPI int php_header(void) { - if (sapi_send_headers(TSRMLS_C)==FAILURE || SG(request_info).headers_only) { + if (sapi_send_headers()==FAILURE || SG(request_info).headers_only) { return 0; /* don't allow output */ } else { return 1; /* allow output */ @@ -77,7 +77,7 @@ PHPAPI int php_header(TSRMLS_D) } -PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC) +PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly) { char *cookie; size_t len=sizeof("Set-Cookie: "); @@ -120,7 +120,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_ * so in order to force cookies to be deleted, even on MSIE, we * pick an expiry date in the past */ - dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, 1, 0 TSRMLS_CC); + dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, 1, 0); snprintf(cookie, len + 100, "Set-Cookie: %s=deleted; expires=%s; Max-Age=0", name, dt->val); zend_string_free(dt); } else { @@ -129,7 +129,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_ const char *p; char tsdelta[13]; strlcat(cookie, COOKIE_EXPIRES, len + 100); - dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC); + dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0); /* check to make sure that the year does not exceed 4 digits in length */ p = zend_memrchr(dt->val, '-', dt->len); if (!p || *(p + 5) != ' ') { @@ -170,7 +170,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_ ctr.line = cookie; ctr.line_len = (uint)strlen(cookie); - result = sapi_header_op(SAPI_HEADER_ADD, &ctr TSRMLS_CC); + result = sapi_header_op(SAPI_HEADER_ADD, &ctr); efree(cookie); return result; } @@ -186,13 +186,13 @@ PHP_FUNCTION(setcookie) zend_bool secure = 0, httponly = 0; size_t name_len, value_len = 0, path_len = 0, domain_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|slssbb", &name, &name_len, &value, &value_len, &expires, &path, &path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) { return; } - if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly TSRMLS_CC) == SUCCESS) { + if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly) == SUCCESS) { RETVAL_TRUE; } else { RETVAL_FALSE; @@ -209,13 +209,13 @@ PHP_FUNCTION(setrawcookie) zend_bool secure = 0, httponly = 0; size_t name_len, value_len = 0, path_len = 0, domain_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|slssbb", &name, &name_len, &value, &value_len, &expires, &path, &path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) { return; } - if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly TSRMLS_CC) == SUCCESS) { + if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly) == SUCCESS) { RETVAL_TRUE; } else { RETVAL_FALSE; @@ -232,12 +232,12 @@ PHP_FUNCTION(headers_sent) const char *file=""; int line=0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z/z/", &arg1, &arg2) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z/z/", &arg1, &arg2) == FAILURE) return; if (SG(headers_sent)) { - line = php_output_get_start_lineno(TSRMLS_C); - file = php_output_get_start_filename(TSRMLS_C); + line = php_output_get_start_lineno(); + file = php_output_get_start_filename(); } switch(ZEND_NUM_ARGS()) { @@ -264,7 +264,7 @@ PHP_FUNCTION(headers_sent) /* {{{ php_head_apply_header_list_to_hash Turn an llist of sapi_header_struct headers into a numerically indexed zval hash */ -static void php_head_apply_header_list_to_hash(void *data, void *arg TSRMLS_DC) +static void php_head_apply_header_list_to_hash(void *data, void *arg) { sapi_header_struct *sapi_header = (sapi_header_struct *)data; @@ -285,7 +285,7 @@ PHP_FUNCTION(headers_list) RETURN_FALSE; } array_init(return_value); - zend_llist_apply_with_argument(&SG(sapi_headers).headers, php_head_apply_header_list_to_hash, return_value TSRMLS_CC); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, php_head_apply_header_list_to_hash, return_value); } /* }}} */ @@ -295,7 +295,7 @@ PHP_FUNCTION(http_response_code) { zend_long response_code = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &response_code) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &response_code) == FAILURE) { return; } diff --git a/ext/standard/head.h b/ext/standard/head.h index 850a71dc74..1f272e0238 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -37,7 +37,7 @@ PHP_FUNCTION(headers_sent); PHP_FUNCTION(headers_list); PHP_FUNCTION(http_response_code); -PHPAPI int php_header(TSRMLS_D); -PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC); +PHPAPI int php_header(void); +PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly); #endif diff --git a/ext/standard/html.c b/ext/standard/html.c index 516bcc4ef7..18bab7d090 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -86,7 +86,7 @@ /* {{{ get_default_charset */ -static char *get_default_charset(TSRMLS_D) { +static char *get_default_charset(void) { if (PG(internal_encoding) && PG(internal_encoding)[0]) { return PG(internal_encoding); } else if (SG(default_charset) && SG(default_charset)[0] ) { @@ -373,7 +373,7 @@ static inline unsigned int get_next_char( /* {{{ entity_charset determine_charset * returns the charset identifier based on current locale or a hint. * defaults to UTF-8 */ -static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC) +static enum entity_charset determine_charset(char *charset_hint) { int i; enum entity_charset charset = cs_utf_8; @@ -388,7 +388,7 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC) goto det_charset; } - zenc = zend_multibyte_get_internal_encoding(TSRMLS_C); + zenc = zend_multibyte_get_internal_encoding(); if (zenc != NULL) { charset_hint = (char *)zend_multibyte_get_encoding_name(zenc); if (charset_hint != NULL && (len=strlen(charset_hint)) != 0) { @@ -459,7 +459,7 @@ det_charset: } } if (!found) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "charset `%s' not supported, assuming utf-8", + php_error_docref(NULL, E_WARNING, "charset `%s' not supported, assuming utf-8", charset_hint); } } @@ -1094,7 +1094,7 @@ static entity_table_opt determine_entity_table(int all, int doctype) * only the basic ones, i.e., those in basic_entities_ex + the numeric entities * that correspond to quotes. */ -PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC) +PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset) { size_t retlen; zend_string *ret; @@ -1103,7 +1103,7 @@ PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen size_t new_size = TRAVERSE_FOR_ENTITIES_EXPAND_SIZE(oldlen); if (all) { - charset = determine_charset(hint_charset TSRMLS_CC); + charset = determine_charset(hint_charset); } else { charset = cs_8859_1; /* charset shouldn't matter, use ISO-8859-1 for performance */ } @@ -1134,9 +1134,9 @@ empty_source: } /* }}} */ -PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC) +PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset) { - return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, 1 TSRMLS_CC); + return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, 1); } /* {{{ find_entity_for_char */ @@ -1222,11 +1222,11 @@ static inline void find_entity_for_char_basic( /* {{{ php_escape_html_entities */ -PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC) +PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode) { size_t cursor, maxlen, len; zend_string *replaced; - enum entity_charset charset = determine_charset(hint_charset TSRMLS_CC); + enum entity_charset charset = determine_charset(hint_charset); int doctype = flags & ENT_HTML_DOC_TYPE_MASK; entity_table_opt entity_table; const enc_to_uni *to_uni_table = NULL; @@ -1237,7 +1237,7 @@ PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldle if (all) { /* replace with all named entities */ if (CHARSET_PARTIAL_SUPPORT(charset)) { - php_error_docref0(NULL TSRMLS_CC, E_STRICT, "Only basic entities " + php_error_docref0(NULL, E_STRICT, "Only basic entities " "substitution is supported for multi-byte encodings other than UTF-8; " "functionality is equivalent to htmlspecialchars"); } @@ -1449,7 +1449,7 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all) zend_bool double_encode = 1; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lS!b", &str, &flags, &hint_charset, &double_encode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS!b", &str, &flags, &hint_charset, &double_encode) == FAILURE) { return; } #else @@ -1463,9 +1463,9 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all) #endif if (!hint_charset) { - default_charset = get_default_charset(TSRMLS_C); + default_charset = get_default_charset(); } - replaced = php_escape_html_entities_ex((unsigned char*)str->val, str->len, all, (int) flags, (hint_charset ? hint_charset->val : default_charset), double_encode TSRMLS_CC); + replaced = php_escape_html_entities_ex((unsigned char*)str->val, str->len, all, (int) flags, (hint_charset ? hint_charset->val : default_charset), double_encode); RETVAL_STR(replaced); } /* }}} */ @@ -1509,11 +1509,11 @@ PHP_FUNCTION(htmlspecialchars_decode) zend_long quote_style = ENT_COMPAT; zend_string *replaced; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, "e_style) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, "e_style) == FAILURE) { return; } - replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, (int)quote_style, NULL TSRMLS_CC); + replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, (int)quote_style, NULL); if (replaced) { RETURN_STR(replaced); } @@ -1531,7 +1531,7 @@ PHP_FUNCTION(html_entity_decode) zend_string *replaced; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lS", &str, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS", &str, "e_style, &hint_charset) == FAILURE) { return; } @@ -1545,9 +1545,9 @@ PHP_FUNCTION(html_entity_decode) #endif if (!hint_charset) { - default_charset = get_default_charset(TSRMLS_C); + default_charset = get_default_charset(); } - replaced = php_unescape_html_entities((unsigned char*)str->val, str->len, 1 /*all*/, (int)quote_style, (hint_charset ? hint_charset->val : default_charset) TSRMLS_CC); + replaced = php_unescape_html_entities((unsigned char*)str->val, str->len, 1 /*all*/, (int)quote_style, (hint_charset ? hint_charset->val : default_charset)); if (replaced) { RETURN_STR(replaced); @@ -1638,12 +1638,12 @@ PHP_FUNCTION(get_html_translation_table) * getting the translated table from data structures that are optimized for * random access, not traversal */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls", &all, &flags, &charset_hint, &charset_hint_len) == FAILURE) { return; } - charset = determine_charset(charset_hint TSRMLS_CC); + charset = determine_charset(charset_hint); doctype = flags & ENT_HTML_DOC_TYPE_MASK; LIMIT_ALL(all, doctype, charset); diff --git a/ext/standard/html.h b/ext/standard/html.h index c7c297c90b..6fcea6b380 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -54,9 +54,9 @@ PHP_FUNCTION(htmlspecialchars_decode); PHP_FUNCTION(html_entity_decode); PHP_FUNCTION(get_html_translation_table); -PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC); -PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC); -PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC); +PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset); +PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode); +PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset); PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, int *status); #endif /* HTML_H */ diff --git a/ext/standard/http.c b/ext/standard/http.c index e5ba87d870..9c9d1dc530 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -29,7 +29,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *num_prefix, size_t num_prefix_len, const char *key_prefix, size_t key_prefix_len, const char *key_suffix, size_t key_suffix_len, - zval *type, char *arg_sep, int enc_type TSRMLS_DC) + zval *type, char *arg_sep, int enc_type) { zend_string *key = NULL; char *newprefix, *p; @@ -62,7 +62,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *tmp; zend_object *zobj = Z_OBJ_P(type); - if (zend_check_property_access(zobj, key TSRMLS_CC) != SUCCESS) { + if (zend_check_property_access(zobj, key) != SUCCESS) { /* private or protected property access outside of the class */ continue; } @@ -138,7 +138,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, if (ZEND_HASH_APPLY_PROTECTION(ht)) { ht->u.v.nApplyCount++; } - php_url_encode_hash_ex(HASH_OF(zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_P(zdata) == IS_OBJECT ? zdata : NULL), arg_sep, enc_type TSRMLS_CC); + php_url_encode_hash_ex(HASH_OF(zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_P(zdata) == IS_OBJECT ? zdata : NULL), arg_sep, enc_type); if (ZEND_HASH_APPLY_PROTECTION(ht)) { ht->u.v.nApplyCount--; } @@ -233,16 +233,16 @@ PHP_FUNCTION(http_build_query) smart_str formstr = {0}; zend_long enc_type = PHP_QUERY_RFC1738; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) { RETURN_FALSE; } if (Z_TYPE_P(formdata) != IS_ARRAY && Z_TYPE_P(formdata) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given"); + php_error_docref(NULL, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given"); RETURN_FALSE; } - if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type TSRMLS_CC) == FAILURE) { + if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type) == FAILURE) { if (formstr.s) { smart_str_free(&formstr); } diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index e1f8653c8d..032c6c7e36 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -111,7 +111,7 @@ static inline void strip_header(char *header_bag, char *lc_header_bag, php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, - php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ + php_stream_context *context, int redirect_max, int flags STREAMS_DC) /* {{{ */ { php_stream *stream = NULL; php_url *resource = NULL; @@ -149,7 +149,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, tmp_line[0] = '\0'; if (redirect_max < 1) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Redirection limit reached, aborting"); + php_stream_wrapper_log_error(wrapper, options, "Redirection limit reached, aborting"); return NULL; } @@ -177,7 +177,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, /* Normal http request (possibly with proxy) */ if (strpbrk(mode, "awx+")) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper does not support writeable connections"); + php_stream_wrapper_log_error(wrapper, options, "HTTP wrapper does not support writeable connections"); php_url_free(resource); return NULL; } @@ -228,7 +228,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, } if (errstr) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", errstr->val); + php_stream_wrapper_log_error(wrapper, options, "%s", errstr->val); zend_string_release(errstr); errstr = NULL; } @@ -310,7 +310,7 @@ finish: smart_str_appendl(&header, "\r\n", sizeof("\r\n")-1); if (php_stream_write(stream, header.s->val, header.s->len) != header.s->len) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy"); + php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy"); php_stream_close(stream); stream = NULL; } @@ -331,9 +331,9 @@ finish: /* enable SSL transport layer */ if (stream) { - if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL TSRMLS_CC) < 0 || - php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy"); + if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL) < 0 || + php_stream_xport_crypto_enable(stream, 1) < 0) { + php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy"); php_stream_close(stream); stream = NULL; } @@ -352,7 +352,7 @@ finish: eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC); stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC); - php_stream_context_set(stream, context TSRMLS_CC); + php_stream_context_set(stream, context); php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0); @@ -389,7 +389,7 @@ finish: /* Should we send the entire path in the request line, default to no. */ if (!request_fulluri && context && (tmpzval = php_stream_context_get_option(context, "http", "request_fulluri")) != NULL) { - request_fulluri = zend_is_true(tmpzval TSRMLS_CC); + request_fulluri = zend_is_true(tmpzval); } if (request_fulluri) { @@ -440,13 +440,13 @@ finish: smart_str_0(&tmpstr); /* Remove newlines and spaces from start and end. there's at least one extra \r\n at the end that needs to go. */ if (tmpstr.s) { - tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3 TSRMLS_CC); + tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3); smart_str_free(&tmpstr); } } if (Z_TYPE_P(tmpzval) == IS_STRING && Z_STRLEN_P(tmpzval)) { /* Remove newlines and spaces from start and end php_trim will estrndup() */ - tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC); + tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3); } if (tmp && tmp[0] != '\0') { char *s; @@ -602,7 +602,7 @@ finish: ua[ua_len] = 0; php_stream_write(stream, ua, ua_len); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot construct User-agent header"); + php_error_docref(NULL, E_WARNING, "Cannot construct User-agent header"); } if (ua) { @@ -643,7 +643,7 @@ finish: if (!(have_header & HTTP_HEADER_TYPE)) { php_stream_write(stream, "Content-Type: application/x-www-form-urlencoded\r\n", sizeof("Content-Type: application/x-www-form-urlencoded\r\n") - 1); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded"); + php_error_docref(NULL, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded"); } php_stream_write(stream, "\r\n", sizeof("\r\n")-1); php_stream_write(stream, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval)); @@ -653,12 +653,12 @@ finish: location[0] = '\0'; - symbol_table = zend_rebuild_symbol_table(TSRMLS_C); + symbol_table = zend_rebuild_symbol_table(); if (header_init) { zval ztmp; array_init(&ztmp); - zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0 TSRMLS_CC); + zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0); } response_header = zend_hash_str_find_ind(&symbol_table->ht, "http_response_header", sizeof("http_response_header")-1); @@ -676,7 +676,7 @@ finish: response_code = 0; } if (context && NULL != (tmpzval = php_stream_context_get_option(context, "http", "ignore_errors"))) { - ignore_errors = zend_is_true(tmpzval TSRMLS_CC); + ignore_errors = zend_is_true(tmpzval); } /* when we request only the header, don't fail even on error codes */ if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) { @@ -712,7 +712,7 @@ finish: zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_response); } } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed, unexpected end of socket!"); + php_stream_wrapper_log_error(wrapper, options, "HTTP request failed, unexpected end of socket!"); goto out; } @@ -727,7 +727,7 @@ finish: if (*e != '\n') { do { /* partial header */ if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) == NULL) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed to read HTTP headers"); + php_stream_wrapper_log_error(wrapper, options, "Failed to read HTTP headers"); goto out; } e = http_header_line + http_header_line_length - 1; @@ -763,10 +763,10 @@ finish: zend_long decode = 1; if (context && (tmpzval = php_stream_context_get_option(context, "http", "auto_decode")) != NULL) { - decode = zend_is_true(tmpzval TSRMLS_CC); + decode = zend_is_true(tmpzval); } if (decode) { - transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream) TSRMLS_CC); + transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream)); if (transfer_encoding) { /* don't store transfer-encodeing header */ continue; @@ -847,7 +847,7 @@ finish: php_url_free(resource); /* check for invalid redirection URLs */ if ((resource = php_url_parse(new_path)) == NULL) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); + php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path); goto out; } @@ -859,7 +859,7 @@ finish: s = (unsigned char*)val; e = s + l; \ while (s < e) { \ if (iscntrl(*s)) { \ - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \ + php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path); \ goto out; \ } \ s++; \ @@ -872,9 +872,9 @@ finish: CHECK_FOR_CNTRL_CHARS(resource->pass) CHECK_FOR_CNTRL_CHARS(resource->path) } - stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC TSRMLS_CC); + stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC); } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed! %s", tmp_line); + php_stream_wrapper_log_error(wrapper, options, "HTTP request failed! %s", tmp_line); } } out: @@ -918,20 +918,20 @@ out: php_stream_filter_append(&stream->readfilters, transfer_encoding); } } else if (transfer_encoding) { - php_stream_filter_free(transfer_encoding TSRMLS_CC); + php_stream_filter_free(transfer_encoding); } return stream; } /* }}} */ -php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ +php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */ { - return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC TSRMLS_CC); + return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC); } /* }}} */ -static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */ +static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb) /* {{{ */ { /* one day, we could fill in the details based on Date: and Content-Length: * headers. For now, we return with a failure code to prevent the underlying diff --git a/ext/standard/image.c b/ext/standard/image.c index adeb1c5be6..4828a48623 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -100,7 +100,7 @@ PHP_MINIT_FUNCTION(imagetypes) /* {{{ php_handle_gif * routine to handle GIF files. If only everything were that easy... ;} */ -static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_gif (php_stream * stream) { struct gfxinfo *result = NULL; unsigned char dim[5]; @@ -123,7 +123,7 @@ static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC) /* {{{ php_handle_psd */ -static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_psd (php_stream * stream) { struct gfxinfo *result = NULL; unsigned char dim[8]; @@ -144,7 +144,7 @@ static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC) /* {{{ php_handle_bmp */ -static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_bmp (php_stream * stream) { struct gfxinfo *result = NULL; unsigned char dim[16]; @@ -195,7 +195,7 @@ static unsigned long int php_swf_get_bits (unsigned char* buffer, unsigned int p #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) /* {{{ php_handle_swc */ -static struct gfxinfo *php_handle_swc(php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_swc(php_stream * stream) { struct gfxinfo *result = NULL; @@ -268,7 +268,7 @@ static struct gfxinfo *php_handle_swc(php_stream * stream TSRMLS_DC) /* {{{ php_handle_swf */ -static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_swf (php_stream * stream) { struct gfxinfo *result = NULL; long bits; @@ -294,7 +294,7 @@ static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC) /* {{{ php_handle_png * routine to handle PNG files */ -static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_png (php_stream * stream) { struct gfxinfo *result = NULL; unsigned char dim[9]; @@ -362,7 +362,7 @@ static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC) /* {{{ php_read2 */ -static unsigned short php_read2(php_stream * stream TSRMLS_DC) +static unsigned short php_read2(php_stream * stream) { unsigned char a[2]; @@ -375,7 +375,7 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC) /* {{{ php_next_marker * get next marker byte from file */ -static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read TSRMLS_DC) +static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read) { int a=0, marker; @@ -423,9 +423,9 @@ static unsigned int php_next_marker(php_stream * stream, int last_marker, int co /* {{{ php_skip_variable * skip over a variable-length block; assumes proper length marker */ -static int php_skip_variable(php_stream * stream TSRMLS_DC) +static int php_skip_variable(php_stream * stream) { - zend_off_t length = ((unsigned int)php_read2(stream TSRMLS_CC)); + zend_off_t length = ((unsigned int)php_read2(stream)); if (length < 2) { return 0; @@ -438,14 +438,14 @@ static int php_skip_variable(php_stream * stream TSRMLS_DC) /* {{{ php_read_APP */ -static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSRMLS_DC) +static int php_read_APP(php_stream * stream, unsigned int marker, zval *info) { unsigned short length; char *buffer; char markername[16]; zval *tmp; - length = php_read2(stream TSRMLS_CC); + length = php_read2(stream); if (length < 2) { return 0; } @@ -472,14 +472,14 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR /* {{{ php_handle_jpeg main loop to parse JPEG structure */ -static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_DC) +static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info) { struct gfxinfo *result = NULL; unsigned int marker = M_PSEUDO; unsigned short length, ff_read=1; for (;;) { - marker = php_next_marker(stream, marker, 1, ff_read TSRMLS_CC); + marker = php_next_marker(stream, marker, 1, ff_read); ff_read = 0; switch (marker) { case M_SOF0: @@ -498,10 +498,10 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D if (result == NULL) { /* handle SOFn block */ result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo)); - length = php_read2(stream TSRMLS_CC); + length = php_read2(stream); result->bits = php_stream_getc(stream); - result->height = php_read2(stream TSRMLS_CC); - result->width = php_read2(stream TSRMLS_CC); + result->height = php_read2(stream); + result->width = php_read2(stream); result->channels = php_stream_getc(stream); if (!info || length < 8) { /* if we don't want an extanded info -> return */ return result; @@ -510,7 +510,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D return result; } } else { - if (!php_skip_variable(stream TSRMLS_CC)) { + if (!php_skip_variable(stream)) { return result; } } @@ -533,11 +533,11 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D case M_APP14: case M_APP15: if (info) { - if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app marks... */ + if (!php_read_APP(stream, marker, info)) { /* read all the app marks... */ return result; } } else { - if (!php_skip_variable(stream TSRMLS_CC)) { + if (!php_skip_variable(stream)) { return result; } } @@ -548,7 +548,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D return result; /* we're about to hit image data, or are at EOF. stop processing. */ default: - if (!php_skip_variable(stream TSRMLS_CC)) { /* anything else isn't interesting */ + if (!php_skip_variable(stream)) { /* anything else isn't interesting */ return result; } break; @@ -561,7 +561,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D /* {{{ php_read4 */ -static unsigned int php_read4(php_stream * stream TSRMLS_DC) +static unsigned int php_read4(php_stream * stream) { unsigned char a[4]; @@ -601,7 +601,7 @@ static unsigned int php_read4(php_stream * stream TSRMLS_DC) /* {{{ php_handle_jpc Main loop to parse JPEG2000 raw codestream structure */ -static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_jpc(php_stream * stream) { struct gfxinfo *result = NULL; unsigned short dummy_short; @@ -621,24 +621,24 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) /* Ensure that this marker is SIZ (as is mandated by the standard) */ if (first_marker_id != JPEG2000_MARKER_SIZ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "JPEG2000 codestream corrupt(Expected SIZ marker not found after SOC)"); + php_error_docref(NULL, E_WARNING, "JPEG2000 codestream corrupt(Expected SIZ marker not found after SOC)"); return NULL; } result = (struct gfxinfo *)ecalloc(1, sizeof(struct gfxinfo)); - dummy_short = php_read2(stream TSRMLS_CC); /* Lsiz */ - dummy_short = php_read2(stream TSRMLS_CC); /* Rsiz */ - result->width = php_read4(stream TSRMLS_CC); /* Xsiz */ - result->height = php_read4(stream TSRMLS_CC); /* Ysiz */ + dummy_short = php_read2(stream); /* Lsiz */ + dummy_short = php_read2(stream); /* Rsiz */ + result->width = php_read4(stream); /* Xsiz */ + result->height = php_read4(stream); /* Ysiz */ #if MBO_0 - php_read4(stream TSRMLS_CC); /* XOsiz */ - php_read4(stream TSRMLS_CC); /* YOsiz */ - php_read4(stream TSRMLS_CC); /* XTsiz */ - php_read4(stream TSRMLS_CC); /* YTsiz */ - php_read4(stream TSRMLS_CC); /* XTOsiz */ - php_read4(stream TSRMLS_CC); /* YTOsiz */ + php_read4(stream); /* XOsiz */ + php_read4(stream); /* YOsiz */ + php_read4(stream); /* XTsiz */ + php_read4(stream); /* YTsiz */ + php_read4(stream); /* XTOsiz */ + php_read4(stream); /* YTOsiz */ #else if (php_stream_seek(stream, 24, SEEK_CUR)) { efree(result); @@ -646,7 +646,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) } #endif - result->channels = php_read2(stream TSRMLS_CC); /* Csiz */ + result->channels = php_read2(stream); /* Csiz */ if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) { efree(result); return NULL; @@ -673,7 +673,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) /* {{{ php_handle_jp2 main loop to parse JPEG 2000 JP2 wrapper format structure */ -static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC) +static struct gfxinfo *php_handle_jp2(php_stream *stream) { struct gfxinfo *result = NULL; unsigned int box_length; @@ -691,7 +691,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC) for (;;) { - box_length = php_read4(stream TSRMLS_CC); /* LBox */ + box_length = php_read4(stream); /* LBox */ /* TBox */ if (php_stream_read(stream, (void *)&box_type, sizeof(box_type)) != sizeof(box_type)) { /* Use this as a general "out of stream" error */ @@ -708,7 +708,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC) /* Skip the first 3 bytes to emulate the file type examination */ php_stream_seek(stream, 3, SEEK_CUR); - result = php_handle_jpc(stream TSRMLS_CC); + result = php_handle_jpc(stream); break; } @@ -724,7 +724,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC) } if (result == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "JP2 file has no codestreams at root level"); + php_error_docref(NULL, E_WARNING, "JP2 file has no codestreams at root level"); } return result; @@ -800,7 +800,7 @@ static unsigned php_ifd_get32u(void *Long, int motorola_intel) /* {{{ php_handle_tiff main loop to parse TIFF structure */ -static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel TSRMLS_DC) +static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel) { struct gfxinfo *result = NULL; int i, num_entries; @@ -881,7 +881,7 @@ static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int mot /* {{{ php_handle_psd */ -static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_iff(php_stream * stream) { struct gfxinfo * result; unsigned char a[10]; @@ -942,7 +942,7 @@ static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC) * int Number of columns * int Number of rows */ -static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check TSRMLS_DC) +static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check) { int i, width = 0, height = 0; @@ -997,11 +997,11 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check T /* {{{ php_handle_wbmp */ -static struct gfxinfo *php_handle_wbmp(php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_wbmp(php_stream * stream) { struct gfxinfo *result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo)); - if (!php_get_wbmp(stream, &result, 0 TSRMLS_CC)) { + if (!php_get_wbmp(stream, &result, 0)) { efree(result); return NULL; } @@ -1012,7 +1012,7 @@ static struct gfxinfo *php_handle_wbmp(php_stream * stream TSRMLS_DC) /* {{{ php_get_xbm */ -static int php_get_xbm(php_stream *stream, struct gfxinfo **result TSRMLS_DC) +static int php_get_xbm(php_stream *stream, struct gfxinfo **result) { char *fline; char *iname; @@ -1072,17 +1072,17 @@ static int php_get_xbm(php_stream *stream, struct gfxinfo **result TSRMLS_DC) /* {{{ php_handle_xbm */ -static struct gfxinfo *php_handle_xbm(php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_xbm(php_stream * stream) { struct gfxinfo *result; - php_get_xbm(stream, &result TSRMLS_CC); + php_get_xbm(stream, &result); return result; } /* }}} */ /* {{{ php_handle_ico */ -static struct gfxinfo *php_handle_ico(php_stream * stream TSRMLS_DC) +static struct gfxinfo *php_handle_ico(php_stream * stream) { struct gfxinfo *result = NULL; unsigned char dim[16]; @@ -1162,7 +1162,7 @@ PHP_FUNCTION(image_type_to_mime_type) { zend_long p_image_type; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &p_image_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &p_image_type) == FAILURE) { return; } @@ -1177,7 +1177,7 @@ PHP_FUNCTION(image_type_to_extension) zend_long image_type; zend_bool inc_dot=1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|b", &image_type, &inc_dot) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &image_type, &inc_dot) == FAILURE) { RETURN_FALSE; } @@ -1221,13 +1221,13 @@ PHP_FUNCTION(image_type_to_extension) /* {{{ php_imagetype detect filetype from first bytes */ -PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) +PHPAPI int php_getimagetype(php_stream * stream, char *filetype) { char tmp[12]; if ( !filetype) filetype = tmp; if((php_stream_read(stream, filetype, 3)) != 3) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!"); + php_error_docref(NULL, E_NOTICE, "Read error!"); return IMAGE_FILETYPE_UNKNOWN; } @@ -1238,13 +1238,13 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) return IMAGE_FILETYPE_JPEG; } else if (!memcmp(filetype, php_sig_png, 3)) { if (php_stream_read(stream, filetype+3, 5) != 5) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!"); + php_error_docref(NULL, E_NOTICE, "Read error!"); return IMAGE_FILETYPE_UNKNOWN; } if (!memcmp(filetype, php_sig_png, 8)) { return IMAGE_FILETYPE_PNG; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PNG file corrupted by ASCII conversion"); + php_error_docref(NULL, E_WARNING, "PNG file corrupted by ASCII conversion"); return IMAGE_FILETYPE_UNKNOWN; } } else if (!memcmp(filetype, php_sig_swf, 3)) { @@ -1260,7 +1260,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) } if (php_stream_read(stream, filetype+3, 1) != 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!"); + php_error_docref(NULL, E_NOTICE, "Read error!"); return IMAGE_FILETYPE_UNKNOWN; } /* BYTES READ: 4 */ @@ -1275,7 +1275,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) } if (php_stream_read(stream, filetype+4, 8) != 8) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!"); + php_error_docref(NULL, E_NOTICE, "Read error!"); return IMAGE_FILETYPE_UNKNOWN; } /* BYTES READ: 12 */ @@ -1284,10 +1284,10 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) } /* AFTER ALL ABOVE FAILED */ - if (php_get_wbmp(stream, NULL, 1 TSRMLS_CC)) { + if (php_get_wbmp(stream, NULL, 1)) { return IMAGE_FILETYPE_WBMP; } - if (php_get_xbm(stream, NULL TSRMLS_CC)) { + if (php_get_xbm(stream, NULL)) { return IMAGE_FILETYPE_XBM; } return IMAGE_FILETYPE_UNKNOWN; @@ -1303,60 +1303,60 @@ static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNA RETURN_FALSE; } - itype = php_getimagetype(stream, NULL TSRMLS_CC); + itype = php_getimagetype(stream, NULL); switch( itype) { case IMAGE_FILETYPE_GIF: - result = php_handle_gif(stream TSRMLS_CC); + result = php_handle_gif(stream); break; case IMAGE_FILETYPE_JPEG: if (info) { - result = php_handle_jpeg(stream, info TSRMLS_CC); + result = php_handle_jpeg(stream, info); } else { - result = php_handle_jpeg(stream, NULL TSRMLS_CC); + result = php_handle_jpeg(stream, NULL); } break; case IMAGE_FILETYPE_PNG: - result = php_handle_png(stream TSRMLS_CC); + result = php_handle_png(stream); break; case IMAGE_FILETYPE_SWF: - result = php_handle_swf(stream TSRMLS_CC); + result = php_handle_swf(stream); break; case IMAGE_FILETYPE_SWC: #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) - result = php_handle_swc(stream TSRMLS_CC); + result = php_handle_swc(stream); #else - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled"); + php_error_docref(NULL, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled"); #endif break; case IMAGE_FILETYPE_PSD: - result = php_handle_psd(stream TSRMLS_CC); + result = php_handle_psd(stream); break; case IMAGE_FILETYPE_BMP: - result = php_handle_bmp(stream TSRMLS_CC); + result = php_handle_bmp(stream); break; case IMAGE_FILETYPE_TIFF_II: - result = php_handle_tiff(stream, NULL, 0 TSRMLS_CC); + result = php_handle_tiff(stream, NULL, 0); break; case IMAGE_FILETYPE_TIFF_MM: - result = php_handle_tiff(stream, NULL, 1 TSRMLS_CC); + result = php_handle_tiff(stream, NULL, 1); break; case IMAGE_FILETYPE_JPC: - result = php_handle_jpc(stream TSRMLS_CC); + result = php_handle_jpc(stream); break; case IMAGE_FILETYPE_JP2: - result = php_handle_jp2(stream TSRMLS_CC); + result = php_handle_jp2(stream); break; case IMAGE_FILETYPE_IFF: - result = php_handle_iff(stream TSRMLS_CC); + result = php_handle_iff(stream); break; case IMAGE_FILETYPE_WBMP: - result = php_handle_wbmp(stream TSRMLS_CC); + result = php_handle_wbmp(stream); break; case IMAGE_FILETYPE_XBM: - result = php_handle_xbm(stream TSRMLS_CC); + result = php_handle_xbm(stream); break; case IMAGE_FILETYPE_ICO: - result = php_handle_ico(stream TSRMLS_CC); + result = php_handle_ico(stream); break; default: case IMAGE_FILETYPE_UNKNOWN: @@ -1396,7 +1396,7 @@ static void php_getimagesize_from_any(INTERNAL_FUNCTION_PARAMETERS, int mode) { size_t input_len; const int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc TSRMLS_CC, "s|z/", &input, &input_len, &info) == FAILURE) { + if (zend_parse_parameters(argc, "s|z/", &input, &input_len, &info) == FAILURE) { return; } diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index bb1b9c5a6a..6d5ef77e2d 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -34,24 +34,24 @@ static zend_object_handlers php_incomplete_object_handlers; /* {{{ incomplete_class_message */ -static void incomplete_class_message(zval *object, int error_type TSRMLS_DC) +static void incomplete_class_message(zval *object, int error_type) { zend_string *class_name; class_name = php_lookup_class_name(object); if (class_name) { - php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, class_name->val); + php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, class_name->val); zend_string_release(class_name); } else { - php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, "unknown"); + php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, "unknown"); } } /* }}} */ -static zval *incomplete_class_get_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */ +static zval *incomplete_class_get_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */ { - incomplete_class_message(object, E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE); if (type == BP_VAR_W || type == BP_VAR_RW) { return &EG(error_zval); @@ -61,49 +61,49 @@ static zval *incomplete_class_get_property(zval *object, zval *member, int type, } /* }}} */ -static void incomplete_class_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */ +static void incomplete_class_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */ { - incomplete_class_message(object, E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE); } /* }}} */ -static zval *incomplete_class_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */ +static zval *incomplete_class_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */ { - incomplete_class_message(object, E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE); return &EG(error_zval); } /* }}} */ -static void incomplete_class_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */ +static void incomplete_class_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */ { - incomplete_class_message(object, E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE); } /* }}} */ -static int incomplete_class_has_property(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC) /* {{{ */ +static int incomplete_class_has_property(zval *object, zval *member, int check_empty, void **cache_slot) /* {{{ */ { - incomplete_class_message(object, E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE); return 0; } /* }}} */ -static union _zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */ +static union _zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */ { zval zobject; ZVAL_OBJ(&zobject, *object); - incomplete_class_message(&zobject, E_ERROR TSRMLS_CC); + incomplete_class_message(&zobject, E_ERROR); return NULL; } /* }}} */ /* {{{ php_create_incomplete_class */ -static zend_object *php_create_incomplete_object(zend_class_entry *class_type TSRMLS_DC) +static zend_object *php_create_incomplete_object(zend_class_entry *class_type) { zend_object *object; - object = zend_objects_new( class_type TSRMLS_CC); + object = zend_objects_new( class_type); object->handlers = &php_incomplete_object_handlers; object_properties_init(object, class_type); @@ -111,7 +111,7 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type TS return object; } -PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D) +PHPAPI zend_class_entry *php_create_incomplete_class(void) { zend_class_entry incomplete_class; @@ -126,7 +126,7 @@ PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D) php_incomplete_object_handlers.get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr; php_incomplete_object_handlers.get_method = incomplete_class_get_method; - return zend_register_internal_class(&incomplete_class TSRMLS_CC); + return zend_register_internal_class(&incomplete_class); } /* }}} */ @@ -136,7 +136,6 @@ PHPAPI zend_string *php_lookup_class_name(zval *object) { zval *val; HashTable *object_properties; - TSRMLS_FETCH(); object_properties = Z_OBJPROP_P(object); @@ -153,7 +152,6 @@ PHPAPI zend_string *php_lookup_class_name(zval *object) PHPAPI void php_store_class_name(zval *object, const char *name, size_t len) { zval val; - TSRMLS_FETCH(); ZVAL_STRINGL(&val, name, len); diff --git a/ext/standard/info.c b/ext/standard/info.c index 7a118af7b4..8c00c521fd 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -65,10 +65,9 @@ static int php_info_print_html_esc(const char *str, size_t len) /* {{{ */ { size_t written; zend_string *new_str; - TSRMLS_FETCH(); - new_str = php_escape_html_entities((unsigned char *) str, len, 0, ENT_QUOTES, "utf-8" TSRMLS_CC); - written = php_output_write(new_str->val, new_str->len TSRMLS_CC); + new_str = php_escape_html_entities((unsigned char *) str, len, 0, ENT_QUOTES, "utf-8"); + written = php_output_write(new_str->val, new_str->len); zend_string_free(new_str); return written; } @@ -79,13 +78,12 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */ char *buf; size_t len, written; va_list argv; - TSRMLS_FETCH(); va_start(argv, fmt); len = vspprintf(&buf, 0, fmt, argv); va_end(argv); - written = php_output_write(buf, len TSRMLS_CC); + written = php_output_write(buf, len); efree(buf); return written; } @@ -93,12 +91,11 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */ static int php_info_print(const char *str) /* {{{ */ { - TSRMLS_FETCH(); - return php_output_write(str, strlen(str) TSRMLS_CC); + return php_output_write(str, strlen(str)); } /* }}} */ -static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC) /* {{{ */ +static void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ */ { zend_string *key; @@ -142,7 +139,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC } /* }}} */ -PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {{{ */ +PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */ { if (zend_module->info_func || zend_module->version) { if (!sapi_module.phpinfo_as_text) { @@ -153,7 +150,7 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* { php_info_print_table_end(); } if (zend_module->info_func) { - zend_module->info_func(zend_module TSRMLS_CC); + zend_module->info_func(zend_module); } else { php_info_print_table_start(); php_info_print_table_row(2, "Version", zend_module->version); @@ -170,21 +167,21 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* { } /* }}} */ -static int _display_module_info_func(zval *el TSRMLS_DC) /* {{{ */ +static int _display_module_info_func(zval *el) /* {{{ */ { zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el); if (module->info_func || module->version) { - php_info_print_module(module TSRMLS_CC); + php_info_print_module(module); } return ZEND_HASH_APPLY_KEEP; } /* }}} */ -static int _display_module_info_def(zval *el TSRMLS_DC) /* {{{ */ +static int _display_module_info_def(zval *el) /* {{{ */ { zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el); if (!module->info_func && !module->version) { - php_info_print_module(module TSRMLS_CC); + php_info_print_module(module); } return ZEND_HASH_APPLY_KEEP; } @@ -192,7 +189,7 @@ static int _display_module_info_def(zval *el TSRMLS_DC) /* {{{ */ /* {{{ php_print_gpcse_array */ -static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) +static void php_print_gpcse_array(char *name, uint name_length) { zval *data, *tmp, tmp2; zend_string *string_key; @@ -200,7 +197,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) zend_string *key; key = zend_string_init(name, name_length, 0); - zend_is_auto_global(key TSRMLS_CC); + zend_is_auto_global(key); if ((data = zend_hash_find(&EG(symbol_table).ht, key)) != NULL && (Z_TYPE_P(data) == IS_ARRAY)) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_key, string_key, tmp) { @@ -230,10 +227,10 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) if (Z_TYPE_P(tmp) == IS_ARRAY) { if (!sapi_module.phpinfo_as_text) { php_info_print("<pre>"); - zend_print_zval_r_ex((zend_write_func_t) php_info_print_html_esc, tmp, 0 TSRMLS_CC); + zend_print_zval_r_ex((zend_write_func_t) php_info_print_html_esc, tmp, 0); php_info_print("</pre>"); } else { - zend_print_zval_r(tmp, 0 TSRMLS_CC); + zend_print_zval_r(tmp, 0); } } else { ZVAL_COPY_VALUE(&tmp2, tmp); @@ -270,19 +267,19 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) /* {{{ php_info_print_style */ -void php_info_print_style(TSRMLS_D) +void php_info_print_style(void) { php_info_printf("<style type=\"text/css\">\n"); - php_info_print_css(TSRMLS_C); + php_info_print_css(); php_info_printf("</style>\n"); } /* }}} */ /* {{{ php_info_html_esc */ -PHPAPI zend_string *php_info_html_esc(char *string TSRMLS_DC) +PHPAPI zend_string *php_info_html_esc(char *string) { - return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL TSRMLS_CC); + return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL); } /* }}} */ @@ -663,12 +660,12 @@ PHPAPI zend_string *php_get_uname(char mode) /* {{{ php_print_info_htmlhead */ -PHPAPI void php_print_info_htmlhead(TSRMLS_D) +PHPAPI void php_print_info_htmlhead(void) { php_info_print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n"); php_info_print("<html xmlns=\"http://www.w3.org/1999/xhtml\">"); php_info_print("<head>\n"); - php_info_print_style(TSRMLS_C); + php_info_print_style(); php_info_print("<title>phpinfo()</title>"); php_info_print("<meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />"); php_info_print("</head>\n"); @@ -677,7 +674,7 @@ PHPAPI void php_print_info_htmlhead(TSRMLS_D) /* }}} */ /* {{{ module_name_cmp */ -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) +static int module_name_cmp(const void *a, const void *b) { Bucket *f = (Bucket *) a; Bucket *s = (Bucket *) b; @@ -689,13 +686,13 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ php_print_info */ -PHPAPI void php_print_info(int flag TSRMLS_DC) +PHPAPI void php_print_info(int flag) { char **env, *tmp1, *tmp2; zend_string *php_uname; if (!sapi_module.phpinfo_as_text) { - php_print_info_htmlhead(TSRMLS_C); + php_print_info_htmlhead(); } else { php_info_print("phpinfo()\n"); } @@ -789,10 +786,10 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) php_info_print_table_row(2, "Zend Signal Handling", "disabled" ); #endif - php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm(TSRMLS_C) ? "enabled" : "disabled" ); + php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm() ? "enabled" : "disabled" ); { - const zend_multibyte_functions *functions = zend_multibyte_get_functions(TSRMLS_C); + const zend_multibyte_functions *functions = zend_multibyte_get_functions(); char *descr; if (functions) { spprintf(&descr, 0, "provided by %s", functions->provider_name); @@ -815,9 +812,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) php_info_print_table_row(2, "DTrace Support", "disabled" ); #endif - php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash() TSRMLS_CC); - php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash() TSRMLS_CC); - php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash() TSRMLS_CC); + php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash()); + php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash()); + php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash()); php_info_print_table_end(); @@ -832,13 +829,13 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) if (sapi_module.phpinfo_as_text) { php_info_print(zend_version); } else { - zend_html_puts(zend_version, strlen(zend_version) TSRMLS_CC); + zend_html_puts(zend_version, strlen(zend_version)); } php_info_print_box_end(); zend_string_free(php_uname); } - zend_ini_sort_entries(TSRMLS_C); + zend_ini_sort_entries(); if (flag & PHP_INFO_CONFIGURATION) { php_info_print_hr(); @@ -858,14 +855,14 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) zend_hash_init(&sorted_registry, zend_hash_num_elements(&module_registry), NULL, NULL, 1); zend_hash_copy(&sorted_registry, &module_registry, NULL); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); + zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0); - zend_hash_apply(&sorted_registry, _display_module_info_func TSRMLS_CC); + zend_hash_apply(&sorted_registry, _display_module_info_func); SECTION("Additional Modules"); php_info_print_table_start(); php_info_print_table_header(1, "Module Name"); - zend_hash_apply(&sorted_registry, _display_module_info_def TSRMLS_CC); + zend_hash_apply(&sorted_registry, _display_module_info_def); php_info_print_table_end(); zend_hash_destroy(&sorted_registry); @@ -908,20 +905,20 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) if ((data = zend_hash_str_find(&EG(symbol_table).ht, "PHP_AUTH_PW", sizeof("PHP_AUTH_PW")-1)) != NULL && Z_TYPE_P(data) == IS_STRING) { php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_P(data)); } - php_print_gpcse_array(ZEND_STRL("_REQUEST") TSRMLS_CC); - php_print_gpcse_array(ZEND_STRL("_GET") TSRMLS_CC); - php_print_gpcse_array(ZEND_STRL("_POST") TSRMLS_CC); - php_print_gpcse_array(ZEND_STRL("_FILES") TSRMLS_CC); - php_print_gpcse_array(ZEND_STRL("_COOKIE") TSRMLS_CC); - php_print_gpcse_array(ZEND_STRL("_SERVER") TSRMLS_CC); - php_print_gpcse_array(ZEND_STRL("_ENV") TSRMLS_CC); + php_print_gpcse_array(ZEND_STRL("_REQUEST")); + php_print_gpcse_array(ZEND_STRL("_GET")); + php_print_gpcse_array(ZEND_STRL("_POST")); + php_print_gpcse_array(ZEND_STRL("_FILES")); + php_print_gpcse_array(ZEND_STRL("_COOKIE")); + php_print_gpcse_array(ZEND_STRL("_SERVER")); + php_print_gpcse_array(ZEND_STRL("_ENV")); php_info_print_table_end(); } if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) { php_info_print_hr(); - php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE TSRMLS_CC); + php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE); } if (flag & PHP_INFO_LICENSE) { @@ -1170,14 +1167,14 @@ PHP_FUNCTION(phpinfo) { zend_long flag = PHP_INFO_ALL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) { return; } /* Andale! Andale! Yee-Hah! */ - php_output_start_default(TSRMLS_C); - php_print_info((int)flag TSRMLS_CC); - php_output_end(TSRMLS_C); + php_output_start_default(); + php_print_info((int)flag); + php_output_end(); RETURN_TRUE; } @@ -1191,7 +1188,7 @@ PHP_FUNCTION(phpversion) char *ext_name = NULL; size_t ext_name_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ext_name, &ext_name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ext_name, &ext_name_len) == FAILURE) { return; } @@ -1214,11 +1211,11 @@ PHP_FUNCTION(phpcredits) { zend_long flag = PHP_CREDITS_ALL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) { return; } - php_print_credits((int)flag TSRMLS_CC); + php_print_credits((int)flag); RETURN_TRUE; } /* }}} */ @@ -1247,7 +1244,7 @@ PHP_FUNCTION(php_uname) char *mode = "a"; size_t modelen = sizeof("a")-1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &mode, &modelen) == FAILURE) { return; } RETURN_STR(php_get_uname(*mode)); diff --git a/ext/standard/info.h b/ext/standard/info.h index a28ac564ab..f54325fdaf 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -63,12 +63,12 @@ PHP_FUNCTION(php_sapi_name); PHP_FUNCTION(php_uname); PHP_FUNCTION(php_ini_scanned_files); PHP_FUNCTION(php_ini_loaded_file); -PHPAPI zend_string *php_info_html_esc(char *string TSRMLS_DC); -PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC); -PHPAPI void php_print_info_htmlhead(TSRMLS_D); -PHPAPI void php_print_info(int flag TSRMLS_DC); +PHPAPI zend_string *php_info_html_esc(char *string); +PHPAPI void php_info_html_esc_write(char *string, int str_len); +PHPAPI void php_print_info_htmlhead(void); +PHPAPI void php_print_info(int flag); PHPAPI void php_print_style(void); -PHPAPI void php_info_print_style(TSRMLS_D); +PHPAPI void php_info_print_style(void); PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header); PHPAPI void php_info_print_table_header(int num_cols, ...); PHPAPI void php_info_print_table_row(int num_cols, ...); @@ -78,7 +78,7 @@ PHPAPI void php_info_print_table_end(void); PHPAPI void php_info_print_box_start(int bg); PHPAPI void php_info_print_box_end(void); PHPAPI void php_info_print_hr(void); -PHPAPI void php_info_print_module(zend_module_entry *module TSRMLS_DC); +PHPAPI void php_info_print_module(zend_module_entry *module); PHPAPI zend_string *php_get_uname(char mode); void register_phpinfo_constants(INIT_FUNC_ARGS); diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 75bbdd22ce..c536f4b19f 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -75,7 +75,7 @@ /* {{{ php_iptc_put1 */ -static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf TSRMLS_DC) +static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf) { if (spool > 0) PUTC(c); @@ -88,7 +88,7 @@ static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **s /* {{{ php_iptc_get1 */ -static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) +static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf) { int c; char cc; @@ -110,9 +110,9 @@ static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC /* {{{ php_iptc_read_remaining */ -static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) +static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf) { - while (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) != EOF) continue; + while (php_iptc_get1(fp, spool, spoolbuf) != EOF) continue; return M_EOI; } @@ -120,21 +120,21 @@ static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf /* {{{ php_iptc_skip_variable */ -static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) +static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf) { unsigned int length; int c1, c2; - if ((c1 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI; + if ((c1 = php_iptc_get1(fp, spool, spoolbuf)) == EOF) return M_EOI; - if ((c2 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI; + if ((c2 = php_iptc_get1(fp, spool, spoolbuf)) == EOF) return M_EOI; length = (((unsigned char) c1) << 8) + ((unsigned char) c2); length -= 2; while (length--) - if (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) == EOF) return M_EOI; + if (php_iptc_get1(fp, spool, spoolbuf) == EOF) return M_EOI; return 0; } @@ -142,29 +142,29 @@ static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf /* {{{ php_iptc_next_marker */ -static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) +static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf) { int c; /* skip unimportant stuff */ - c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC); + c = php_iptc_get1(fp, spool, spoolbuf); if (c == EOF) return M_EOI; while (c != 0xff) { - if ((c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) + if ((c = php_iptc_get1(fp, spool, spoolbuf)) == EOF) return M_EOI; /* we hit EOF */ } /* get marker byte, swallowing possible padding */ do { - c = php_iptc_get1(fp, 0, 0 TSRMLS_CC); + c = php_iptc_get1(fp, 0, 0); if (c == EOF) return M_EOI; /* we hit EOF */ else if (c == 0xff) - php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf TSRMLS_CC); + php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf); } while (c == 0xff); return (unsigned int) c; @@ -187,16 +187,16 @@ PHP_FUNCTION(iptcembed) zend_stat_t sb; zend_bool written = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) { return; } - if (php_check_open_basedir(jpeg_file TSRMLS_CC)) { + if (php_check_open_basedir(jpeg_file)) { RETURN_FALSE; } if ((fp = VCWD_FOPEN(jpeg_file, "rb")) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open %s", jpeg_file); + php_error_docref(NULL, E_WARNING, "Unable to open %s", jpeg_file); RETURN_FALSE; } @@ -207,7 +207,7 @@ PHP_FUNCTION(iptcembed) memset(poi, 0, iptcdata_len + sizeof(psheader) + sb.st_size + 1024 + 1); } - if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) { + if (php_iptc_get1(fp, spool, poi?&poi:0) != 0xFF) { fclose(fp); if (spoolbuf) { efree(spoolbuf); @@ -215,7 +215,7 @@ PHP_FUNCTION(iptcembed) RETURN_FALSE; } - if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) { + if (php_iptc_get1(fp, spool, poi?&poi:0) != 0xD8) { fclose(fp); if (spoolbuf) { efree(spoolbuf); @@ -224,19 +224,19 @@ PHP_FUNCTION(iptcembed) } while (!done) { - marker = php_iptc_next_marker(fp, spool, poi?&poi:0 TSRMLS_CC); + marker = php_iptc_next_marker(fp, spool, poi?&poi:0); if (marker == M_EOI) { /* EOF */ break; } else if (marker != M_APP13) { - php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0 TSRMLS_CC); + php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0); } switch (marker) { case M_APP13: /* we are going to write a new APP13 marker, so don't output the old one */ - php_iptc_skip_variable(fp, 0, 0 TSRMLS_CC); - php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC); + php_iptc_skip_variable(fp, 0, 0); + php_iptc_read_remaining(fp, spool, poi?&poi:0); done = 1; break; @@ -249,7 +249,7 @@ PHP_FUNCTION(iptcembed) } written = 1; - php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC); + php_iptc_skip_variable(fp, spool, poi?&poi:0); if (iptcdata_len & 1) { iptcdata_len++; /* make the length even */ @@ -259,25 +259,25 @@ PHP_FUNCTION(iptcembed) psheader[ 3 ] = (iptcdata_len+28)&0xff; for (inx = 0; inx < 28; inx++) { - php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0 TSRMLS_CC); + php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0); } - php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len>>8), poi?&poi:0 TSRMLS_CC); - php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len&0xff), poi?&poi:0 TSRMLS_CC); + php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len>>8), poi?&poi:0); + php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len&0xff), poi?&poi:0); for (inx = 0; inx < iptcdata_len; inx++) { - php_iptc_put1(fp, spool, iptcdata[inx], poi?&poi:0 TSRMLS_CC); + php_iptc_put1(fp, spool, iptcdata[inx], poi?&poi:0); } break; case M_SOS: /* we hit data, no more marker-inserting can be done! */ - php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC); + php_iptc_read_remaining(fp, spool, poi?&poi:0); done = 1; break; default: - php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC); + php_iptc_skip_variable(fp, spool, poi?&poi:0); break; } } @@ -305,7 +305,7 @@ PHP_FUNCTION(iptcparse) size_t str_len; zval values, *element; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) != SUCCESS) { return; } diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 8bfa05555b..424604c0e9 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -50,15 +50,15 @@ static php_lcg_globals lcg_globals; #define MODMULT(a, b, c, m, s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m -static void lcg_seed(TSRMLS_D); +static void lcg_seed(void); -PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */ +PHPAPI double php_combined_lcg(void) /* {{{ */ { php_int32 q; php_int32 z; if (!LCG(seeded)) { - lcg_seed(TSRMLS_C); + lcg_seed(); } MODMULT(53668, 40014, 12211, 2147483563L, LCG(s1)); @@ -73,7 +73,7 @@ PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */ } /* }}} */ -static void lcg_seed(TSRMLS_D) /* {{{ */ +static void lcg_seed(void) /* {{{ */ { struct timeval tv; @@ -97,7 +97,7 @@ static void lcg_seed(TSRMLS_D) /* {{{ */ } /* }}} */ -static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC) /* {{{ */ +static void lcg_init_globals(php_lcg_globals *lcg_globals_p) /* {{{ */ { LCG(seeded) = 0; } @@ -118,7 +118,7 @@ PHP_MINIT_FUNCTION(lcg) /* {{{ */ Returns a value from the combined linear congruential generator */ PHP_FUNCTION(lcg_value) { - RETURN_DOUBLE(php_combined_lcg(TSRMLS_C)); + RETURN_DOUBLE(php_combined_lcg()); } /* }}} */ diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index e776934e1f..0723781c49 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -79,9 +79,9 @@ static zend_long reference_levdist(const char *s1, size_t l1, const char *s2, si /* {{{ custom_levdist */ -static int custom_levdist(char *str1, char *str2, char *callback_name TSRMLS_DC) +static int custom_levdist(char *str1, char *str2, char *callback_name) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support is not there yet"); + php_error_docref(NULL, E_WARNING, "The general Levenshtein support is not there yet"); /* not there yet */ return -1; @@ -101,24 +101,24 @@ PHP_FUNCTION(levenshtein) switch (argc) { case 2: /* just two strings: use maximum performance version */ - if (zend_parse_parameters(2 TSRMLS_CC, "ss", &str1, &str1_len, &str2, &str2_len) == FAILURE) { + if (zend_parse_parameters(2, "ss", &str1, &str1_len, &str2, &str2_len) == FAILURE) { return; } distance = reference_levdist(str1, str1_len, str2, str2_len, 1, 1, 1); break; case 5: /* more general version: calc cost by ins/rep/del weights */ - if (zend_parse_parameters(5 TSRMLS_CC, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) { + if (zend_parse_parameters(5, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) { return; } distance = reference_levdist(str1, str1_len, str2, str2_len, cost_ins, cost_rep, cost_del); break; case 3: /* most general version: calc cost by user-supplied function */ - if (zend_parse_parameters(3 TSRMLS_CC, "sss", &str1, &str1_len, &str2, &str2_len, &callback_name, &callback_len) == FAILURE) { + if (zend_parse_parameters(3, "sss", &str1, &str1_len, &str2, &str2_len, &callback_name, &callback_len) == FAILURE) { return; } - distance = custom_levdist(str1, str2, callback_name TSRMLS_CC); + distance = custom_levdist(str1, str2, callback_name); break; default: @@ -126,7 +126,7 @@ PHP_FUNCTION(levenshtein) } if (distance < 0 && /* TODO */ ZEND_NUM_ARGS() != 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument string(s) too long"); + php_error_docref(NULL, E_WARNING, "Argument string(s) too long"); } RETURN_LONG(distance); diff --git a/ext/standard/link.c b/ext/standard/link.c index 4618ffe983..7bdb48e973 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -59,18 +59,18 @@ PHP_FUNCTION(readlink) char buff[MAXPATHLEN]; int ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &link, &link_len) == FAILURE) { return; } - if (php_check_open_basedir(link TSRMLS_CC)) { + if (php_check_open_basedir(link)) { RETURN_FALSE; } ret = php_sys_readlink(link, buff, MAXPATHLEN-1); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } /* Append NULL to the end of the string */ @@ -90,21 +90,21 @@ PHP_FUNCTION(linkinfo) zend_stat_t sb; int ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) { return; } dirname = estrndup(link, link_len); dir_len = php_dirname(dirname, link_len); - if (php_check_open_basedir(dirname TSRMLS_CC)) { + if (php_check_open_basedir(dirname)) { efree(dirname); RETURN_FALSE; } ret = VCWD_LSTAT(link, &sb); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); efree(dirname); RETURN_LONG(-1L); } @@ -126,35 +126,35 @@ PHP_FUNCTION(symlink) char dirname[MAXPATHLEN]; size_t len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; } - if (!expand_filepath(frompath, source_p TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); + if (!expand_filepath(frompath, source_p)) { + php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; } memcpy(dirname, source_p, sizeof(source_p)); len = php_dirname(dirname, strlen(dirname)); - if (!expand_filepath_ex(topath, dest_p, dirname, len TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); + if (!expand_filepath_ex(topath, dest_p, dirname, len)) { + php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; } - if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) + if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL"); + php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL"); RETURN_FALSE; } - if (php_check_open_basedir(dest_p TSRMLS_CC)) { + if (php_check_open_basedir(dest_p)) { RETURN_FALSE; } - if (php_check_open_basedir(source_p TSRMLS_CC)) { + if (php_check_open_basedir(source_p)) { RETURN_FALSE; } @@ -164,7 +164,7 @@ PHP_FUNCTION(symlink) ret = symlink(topath, source_p); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } @@ -182,27 +182,27 @@ PHP_FUNCTION(link) char source_p[MAXPATHLEN]; char dest_p[MAXPATHLEN]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; } - if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); + if (!expand_filepath(frompath, source_p) || !expand_filepath(topath, dest_p)) { + php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; } - if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) + if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL"); + php_error_docref(NULL, E_WARNING, "Unable to link to a URL"); RETURN_FALSE; } - if (php_check_open_basedir(dest_p TSRMLS_CC)) { + if (php_check_open_basedir(dest_p)) { RETURN_FALSE; } - if (php_check_open_basedir(source_p TSRMLS_CC)) { + if (php_check_open_basedir(source_p)) { RETURN_FALSE; } @@ -212,7 +212,7 @@ PHP_FUNCTION(link) ret = link(dest_p, source_p); #endif if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c index ab904d9571..9fa60a1c3d 100644 --- a/ext/standard/link_win32.c +++ b/ext/standard/link_win32.c @@ -66,7 +66,7 @@ PHP_FUNCTION(readlink) size_t link_len; char target[MAXPATHLEN]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) { return; } @@ -75,7 +75,7 @@ PHP_FUNCTION(readlink) } if (php_sys_readlink(link, target, MAXPATHLEN) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError()); + php_error_docref(NULL, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError()); RETURN_FALSE; } RETURN_STRING(target); @@ -91,13 +91,13 @@ PHP_FUNCTION(linkinfo) zend_stat_t sb; int ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) { return; } ret = VCWD_STAT(link, &sb); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_LONG(Z_L(-1)); } @@ -126,35 +126,35 @@ PHP_FUNCTION(symlink) if (kernel32) { pCreateSymbolicLinkA = (csla_func)GetProcAddress(kernel32, "CreateSymbolicLinkA"); if (pCreateSymbolicLinkA == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't call CreateSymbolicLinkA"); + php_error_docref(NULL, E_WARNING, "Can't call CreateSymbolicLinkA"); RETURN_FALSE; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't call get a handle on kernel32.dll"); + php_error_docref(NULL, E_WARNING, "Can't call get a handle on kernel32.dll"); RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; } - if (!expand_filepath(frompath, source_p TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); + if (!expand_filepath(frompath, source_p)) { + php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; } memcpy(dirname, source_p, sizeof(source_p)); len = php_dirname(dirname, strlen(dirname)); - if (!expand_filepath_ex(topath, dest_p, dirname, len TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); + if (!expand_filepath_ex(topath, dest_p, dirname, len)) { + php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; } - if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) + if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL"); + php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL"); RETURN_FALSE; } @@ -167,7 +167,7 @@ PHP_FUNCTION(symlink) } if ((attr = GetFileAttributes(topath)) == INVALID_FILE_ATTRIBUTES) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch file information(error %d)", GetLastError()); + php_error_docref(NULL, E_WARNING, "Could not fetch file information(error %d)", GetLastError()); RETURN_FALSE; } @@ -177,7 +177,7 @@ PHP_FUNCTION(symlink) ret = pCreateSymbolicLinkA(source_p, topath, (attr & FILE_ATTRIBUTE_DIRECTORY ? 1 : 0)); if (!ret) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create symlink, error code(%d)", GetLastError()); + php_error_docref(NULL, E_WARNING, "Cannot create symlink, error code(%d)", GetLastError()); RETURN_FALSE; } @@ -197,19 +197,19 @@ PHP_FUNCTION(link) /*First argument to link function is the target and hence should go to frompath Second argument to link function is the link itself and hence should go to topath */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &frompath, &frompath_len, &topath, &topath_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &frompath, &frompath_len, &topath, &topath_len) == FAILURE) { return; } - if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); + if (!expand_filepath(frompath, source_p) || !expand_filepath(topath, dest_p)) { + php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; } - if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) + if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL"); + php_error_docref(NULL, E_WARNING, "Unable to link to a URL"); RETURN_FALSE; } @@ -228,7 +228,7 @@ PHP_FUNCTION(link) #endif if (ret == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 5d2b576c7e..69b80e7baa 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -72,7 +72,7 @@ *p = ' '; \ } \ -extern zend_long php_getuid(TSRMLS_D); +extern zend_long php_getuid(void); /* {{{ proto int ezmlm_hash(string addr) Calculate EZMLM list hash value. */ @@ -82,7 +82,7 @@ PHP_FUNCTION(ezmlm_hash) unsigned int h = 5381; size_t j, str_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { return; } @@ -109,7 +109,7 @@ PHP_FUNCTION(mail) char *to_r, *subject_r; char *p, *e; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) { return; } @@ -119,7 +119,7 @@ PHP_FUNCTION(mail) MAIL_ASCIIZ_CHECK(message, message_len); if (headers) { MAIL_ASCIIZ_CHECK(headers, headers_len); - headers_trimmed = php_trim(headers, headers_len, NULL, 0, NULL, 2 TSRMLS_CC); + headers_trimmed = php_trim(headers, headers_len, NULL, 0, NULL, 2); } if (extra_cmd) { MAIL_ASCIIZ_CHECK(extra_cmd->val, extra_cmd->len); @@ -171,7 +171,7 @@ PHP_FUNCTION(mail) extra_cmd = php_escape_shell_cmd(extra_cmd->val); } - if (php_mail(to_r, subject_r, message, headers_trimmed, extra_cmd ? extra_cmd->val : NULL TSRMLS_CC)) { + if (php_mail(to_r, subject_r, message, headers_trimmed, extra_cmd ? extra_cmd->val : NULL)) { RETVAL_TRUE; } else { RETVAL_FALSE; @@ -213,7 +213,7 @@ void php_mail_log_to_syslog(char *message) { } -void php_mail_log_to_file(char *filename, char *message, size_t message_size TSRMLS_DC) { +void php_mail_log_to_file(char *filename, char *message, size_t message_size) { /* Write 'message' to the given file. */ uint flags = IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR; php_stream *stream = php_stream_open_wrapper(filename, "a", flags, NULL); @@ -226,7 +226,7 @@ void php_mail_log_to_file(char *filename, char *message, size_t message_size TSR /* {{{ php_mail */ -PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC) +PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd) { #if (defined PHP_WIN32 || defined NETWARE) int tsm_err; @@ -255,9 +255,9 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char zend_string *date_str; time(&curtime); - date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1 TSRMLS_CC); + date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1); - l = spprintf(&tmp, 0, "[%s] mail() on [%s:%d]: To: %s -- Headers: %s\n", date_str->val, zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : ""); + l = spprintf(&tmp, 0, "[%s] mail() on [%s:%d]: To: %s -- Headers: %s\n", date_str->val, zend_get_executed_filename(), zend_get_executed_lineno(), to, hdr ? hdr : ""); zend_string_free(date_str); @@ -273,21 +273,21 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char else { /* Convert the final space to a newline when logging to file. */ tmp[l - 1] = '\n'; - php_mail_log_to_file(mail_log, tmp, l TSRMLS_CC); + php_mail_log_to_file(mail_log, tmp, l); } efree(tmp); } if (PG(mail_x_header)) { - const char *tmp = zend_get_executed_filename(TSRMLS_C); + const char *tmp = zend_get_executed_filename(); zend_string *f; - f = php_basename(tmp, strlen(tmp), NULL, 0 TSRMLS_CC); + f = php_basename(tmp, strlen(tmp), NULL, 0); if (headers != NULL) { - spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(TSRMLS_C), f->val, headers); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(), f->val, headers); } else { - spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(TSRMLS_C), f->val); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(), f->val); } zend_string_release(f); } @@ -295,12 +295,12 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char if (!sendmail_path) { #if (defined PHP_WIN32 || defined NETWARE) /* handle old style win smtp sending */ - if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) { + if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL) == FAILURE) { if (tsm_errmsg) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg); + php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg); efree(tsm_errmsg); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err)); + php_error_docref(NULL, E_WARNING, "%s", GetSMErrorText(tsm_err)); } MAIL_RET(0); } @@ -326,7 +326,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char #endif #ifdef PHP_WIN32 - sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL TSRMLS_CC); + sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL); #else /* Since popen() doesn't indicate if the internal fork() doesn't work * (e.g. the shell can't be executed) we explicitly set it to 0 to be @@ -341,7 +341,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char if (sendmail) { #ifndef PHP_WIN32 if (EACCES == errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path); + php_error_docref(NULL, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path); pclose(sendmail); #if PHP_SIGCHILD /* Restore handler in case of error on Windows @@ -384,7 +384,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char MAIL_RET(1); } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path); + php_error_docref(NULL, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path); #if PHP_SIGCHILD if (sig_handler) { signal(SIGCHLD, sig_handler); diff --git a/ext/standard/math.c b/ext/standard/math.c index 31eb259829..6d18c0b2dd 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -295,7 +295,7 @@ PHP_FUNCTION(abs) { 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; } convert_scalar_to_number_ex(value); @@ -319,7 +319,7 @@ PHP_FUNCTION(ceil) { 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; } convert_scalar_to_number_ex(value); @@ -339,7 +339,7 @@ PHP_FUNCTION(floor) { 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; } convert_scalar_to_number_ex(value); @@ -363,7 +363,7 @@ PHP_FUNCTION(round) zend_long mode = PHP_ROUND_HALF_UP; double return_val; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &value, &precision, &mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &value, &precision, &mode) == FAILURE) { return; } @@ -400,7 +400,7 @@ PHP_FUNCTION(sin) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -419,7 +419,7 @@ PHP_FUNCTION(cos) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -438,7 +438,7 @@ PHP_FUNCTION(tan) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -457,7 +457,7 @@ PHP_FUNCTION(asin) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -476,7 +476,7 @@ PHP_FUNCTION(acos) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -495,7 +495,7 @@ PHP_FUNCTION(atan) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -514,7 +514,7 @@ PHP_FUNCTION(atan2) double num1, num2; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) { return; } #else @@ -534,7 +534,7 @@ PHP_FUNCTION(sinh) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -553,7 +553,7 @@ PHP_FUNCTION(cosh) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -572,7 +572,7 @@ PHP_FUNCTION(tanh) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -591,7 +591,7 @@ PHP_FUNCTION(asinh) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -610,7 +610,7 @@ PHP_FUNCTION(acosh) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -629,7 +629,7 @@ PHP_FUNCTION(atanh) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -656,7 +656,7 @@ PHP_FUNCTION(is_finite) double dval; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) { return; } #else @@ -675,7 +675,7 @@ PHP_FUNCTION(is_infinite) double dval; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) { return; } #else @@ -694,7 +694,7 @@ PHP_FUNCTION(is_nan) double dval; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) { return; } #else @@ -712,11 +712,11 @@ PHP_FUNCTION(pow) { zval *zbase, *zexp; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &zbase, &zexp) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z/", &zbase, &zexp) == FAILURE) { return; } - pow_function(return_value, zbase, zexp TSRMLS_CC); + pow_function(return_value, zbase, zexp); } /* }}} */ @@ -727,7 +727,7 @@ PHP_FUNCTION(exp) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -751,7 +751,7 @@ PHP_FUNCTION(expm1) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -775,7 +775,7 @@ PHP_FUNCTION(log1p) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -795,7 +795,7 @@ PHP_FUNCTION(log) double num, base = 0; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|d", &num, &base) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|d", &num, &base) == FAILURE) { return; } #else @@ -825,7 +825,7 @@ PHP_FUNCTION(log) } if (base <= 0.0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0"); + php_error_docref(NULL, E_WARNING, "base must be greater than 0"); RETURN_FALSE; } @@ -840,7 +840,7 @@ PHP_FUNCTION(log10) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -860,7 +860,7 @@ PHP_FUNCTION(sqrt) double num; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; } #else @@ -880,7 +880,7 @@ PHP_FUNCTION(hypot) double num1, num2; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) { return; } #else @@ -907,7 +907,7 @@ PHP_FUNCTION(deg2rad) double deg; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", °) == FAILURE) { return; } #else @@ -926,7 +926,7 @@ PHP_FUNCTION(rad2deg) double rad; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &rad) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &rad) == FAILURE) { return; } #else @@ -973,9 +973,8 @@ PHPAPI zend_long _php_math_basetolong(zval *arg, int base) continue; { - TSRMLS_FETCH(); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number '%s' is too big to fit in long", s); + + php_error_docref(NULL, E_WARNING, "Number '%s' is too big to fit in long", s); return ZEND_LONG_MAX; } } @@ -1052,7 +1051,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret) * Convert a long to a string containing a base(2-36) representation of * the number. */ -PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC) +PHPAPI zend_string * _php_math_longtobase(zval *arg, int base) { static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; char buf[(sizeof(zend_ulong) << 3) + 1]; @@ -1082,7 +1081,7 @@ PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC) * Convert a zval to a string containing a base(2-36) representation of * the number. */ -PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC) +PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base) { static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; @@ -1097,7 +1096,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC) /* Don't try to convert +/- infinity */ if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number too large"); + php_error_docref(NULL, E_WARNING, "Number too large"); return STR_EMPTY_ALLOC(); } @@ -1112,7 +1111,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC) return zend_string_init(ptr, end - ptr, 0); } - return _php_math_longtobase(arg, base TSRMLS_CC); + return _php_math_longtobase(arg, base); } /* }}} */ @@ -1122,7 +1121,7 @@ PHP_FUNCTION(bindec) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } convert_to_string_ex(arg); @@ -1138,7 +1137,7 @@ PHP_FUNCTION(hexdec) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } convert_to_string_ex(arg); @@ -1154,7 +1153,7 @@ PHP_FUNCTION(octdec) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } convert_to_string_ex(arg); @@ -1171,11 +1170,11 @@ PHP_FUNCTION(decbin) zval *arg; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } convert_to_long_ex(arg); - result = _php_math_longtobase(arg, 2 TSRMLS_CC); + result = _php_math_longtobase(arg, 2); RETURN_STR(result); } /* }}} */ @@ -1187,11 +1186,11 @@ PHP_FUNCTION(decoct) zval *arg; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } convert_to_long_ex(arg); - result = _php_math_longtobase(arg, 8 TSRMLS_CC); + result = _php_math_longtobase(arg, 8); RETURN_STR(result); } /* }}} */ @@ -1203,11 +1202,11 @@ PHP_FUNCTION(dechex) zval *arg; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } convert_to_long_ex(arg); - result = _php_math_longtobase(arg, 16 TSRMLS_CC); + result = _php_math_longtobase(arg, 16); RETURN_STR(result); } /* }}} */ @@ -1220,24 +1219,24 @@ PHP_FUNCTION(base_convert) zend_long frombase, tobase; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &number, &frombase, &tobase) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zll", &number, &frombase, &tobase) == FAILURE) { return; } convert_to_string_ex(number); if (frombase < 2 || frombase > 36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `from base' (%pd)", frombase); + php_error_docref(NULL, E_WARNING, "Invalid `from base' (%pd)", frombase); RETURN_FALSE; } if (tobase < 2 || tobase > 36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `to base' (%pd)", tobase); + php_error_docref(NULL, E_WARNING, "Invalid `to base' (%pd)", tobase); RETURN_FALSE; } if(_php_math_basetozval(number, (int)frombase, &temp) == FAILURE) { RETURN_FALSE; } - result = _php_math_zvaltobase(&temp, (int)tobase TSRMLS_CC); + result = _php_math_zvaltobase(&temp, (int)tobase); RETVAL_STR(result); } /* }}} */ @@ -1373,7 +1372,7 @@ PHP_FUNCTION(number_format) size_t thousand_sep_len = 0, dec_point_len = 0; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) { return; } #else @@ -1421,7 +1420,7 @@ PHP_FUNCTION(fmod) double num1, num2; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) { return; } #else @@ -1441,12 +1440,12 @@ PHP_FUNCTION(intdiv) { zend_long numerator, divisor; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &numerator, &divisor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &numerator, &divisor) == FAILURE) { return; } if (divisor == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero"); + php_error_docref(NULL, E_WARNING, "Division by zero"); RETURN_BOOL(0); } else if (divisor == -1 && numerator == ZEND_LONG_MIN) { /* Prevent overflow error/crash diff --git a/ext/standard/md5.c b/ext/standard/md5.c index e5359c2bcf..1a06e95b40 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -52,7 +52,7 @@ PHP_NAMED_FUNCTION(php_if_md5) PHP_MD5_CTX context; unsigned char digest[16]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &raw_output) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) { return; } @@ -84,7 +84,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file) size_t n; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) { return; } diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 55b8509f04..8ce43c6710 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -35,7 +35,7 @@ PHP_FUNCTION(metaphone) zend_string *result = NULL; zend_long phones = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &str, &phones) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &str, &phones) == FAILURE) { return; } diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index 811731ee20..d8f72b20d4 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -55,7 +55,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) zend_bool get_as_float = 0; struct timeval tp = {0}; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &get_as_float) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &get_as_float) == FAILURE) { return; } @@ -70,7 +70,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) if (mode) { timelib_time_offset *offset; - offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info(TSRMLS_C)); + offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info()); array_init(return_value); add_assoc_long(return_value, "sec", tp.tv_sec); @@ -114,7 +114,7 @@ PHP_FUNCTION(getrusage) zend_long pwho = 0; int who = RUSAGE_SELF; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &pwho) == FAILURE) { return; } diff --git a/ext/standard/pack.c b/ext/standard/pack.c index f773eb26c5..d1c7cf9e0b 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -57,7 +57,7 @@ if ((a) < 0 || ((INT_MAX - outputpos)/((int)b)) < (a)) { \ efree(formatcodes); \ efree(formatargs); \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \ + php_error_docref(NULL, E_WARNING, "Type %c: integer overflow in format string", code); \ RETURN_FALSE; \ } \ outputpos += (a)*(b); @@ -122,7 +122,7 @@ PHP_FUNCTION(pack) int outputpos = 0, outputsize = 0; char *output; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &argv, &num_args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &argv, &num_args) == FAILURE) { return; } @@ -168,7 +168,7 @@ PHP_FUNCTION(pack) case 'X': case '@': if (arg < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: '*' ignored", code); + php_error_docref(NULL, E_WARNING, "Type %c: '*' ignored", code); arg = 1; } break; @@ -182,7 +182,7 @@ PHP_FUNCTION(pack) if (currentarg >= num_args) { efree(formatcodes); efree(formatargs); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough arguments", code); + php_error_docref(NULL, E_WARNING, "Type %c: not enough arguments", code); RETURN_FALSE; } @@ -211,7 +211,7 @@ PHP_FUNCTION(pack) #if SIZEOF_ZEND_LONG < 8 efree(formatcodes); efree(formatargs); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); + php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); RETURN_FALSE; #endif case 'c': @@ -237,7 +237,7 @@ PHP_FUNCTION(pack) if (currentarg > num_args) { efree(formatcodes); efree(formatargs); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: too few arguments", code); + php_error_docref(NULL, E_WARNING, "Type %c: too few arguments", code); RETURN_FALSE; } break; @@ -245,7 +245,7 @@ PHP_FUNCTION(pack) default: efree(formatcodes); efree(formatargs); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: unknown format code", code); + php_error_docref(NULL, E_WARNING, "Type %c: unknown format code", code); RETURN_FALSE; } @@ -254,7 +254,7 @@ PHP_FUNCTION(pack) } if (currentarg < num_args) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d arguments unused", (num_args - currentarg)); + php_error_docref(NULL, E_WARNING, "%d arguments unused", (num_args - currentarg)); } /* Calculate output length and upper bound while processing*/ @@ -317,7 +317,7 @@ PHP_FUNCTION(pack) outputpos -= arg; if (outputpos < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", code); + php_error_docref(NULL, E_WARNING, "Type %c: outside of string", code); outputpos = 0; } break; @@ -368,7 +368,7 @@ PHP_FUNCTION(pack) outputpos--; if(arg > str->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough characters in string", code); + php_error_docref(NULL, E_WARNING, "Type %c: not enough characters in string", code); arg = str->len; } @@ -382,7 +382,7 @@ PHP_FUNCTION(pack) } else if (n >= 'a' && n <= 'f') { n -= ('a' - 10); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: illegal hex digit %c", code, n); + php_error_docref(NULL, E_WARNING, "Type %c: illegal hex digit %c", code, n); n = 0; } @@ -563,7 +563,7 @@ PHP_FUNCTION(unpack) zend_long formatlen, inputpos, inputlen; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &formatarg, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &formatarg, &inputarg) == FAILURE) { return; } @@ -677,7 +677,7 @@ PHP_FUNCTION(unpack) size = 8; break; #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); + php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); zval_dtor(return_value); RETURN_FALSE; #endif @@ -693,7 +693,7 @@ PHP_FUNCTION(unpack) break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format type %c", type); + php_error_docref(NULL, E_WARNING, "Invalid format type %c", type); zval_dtor(return_value); RETURN_FALSE; break; @@ -713,7 +713,7 @@ PHP_FUNCTION(unpack) } if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow", type); + php_error_docref(NULL, E_WARNING, "Type %c: integer overflow", type); inputpos = 0; } @@ -963,7 +963,7 @@ PHP_FUNCTION(unpack) i = arg - 1; /* Break out of for loop */ if (arg >= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type); + php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type); } } break; @@ -972,7 +972,7 @@ PHP_FUNCTION(unpack) if (arg <= inputlen) { inputpos = arg; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type); + php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type); } i = arg - 1; /* Done, break out of for loop */ @@ -982,7 +982,7 @@ PHP_FUNCTION(unpack) inputpos += size; if (inputpos < 0) { if (size != -1) { /* only print warning if not working with * */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type); + php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type); } inputpos = 0; } @@ -990,7 +990,7 @@ PHP_FUNCTION(unpack) /* Reached end of input for '*' repeater */ break; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos); + php_error_docref(NULL, E_WARNING, "Type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos); zval_dtor(return_value); RETURN_FALSE; } diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 8db9995d27..de13dd399f 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -57,11 +57,11 @@ /* {{{ php_statpage */ -PHPAPI void php_statpage(TSRMLS_D) +PHPAPI void php_statpage(void) { zend_stat_t *pstat; - pstat = sapi_get_stat(TSRMLS_C); + pstat = sapi_get_stat(); if (BG(page_uid)==-1 || BG(page_gid)==-1) { if(pstat) { @@ -79,16 +79,16 @@ PHPAPI void php_statpage(TSRMLS_D) /* {{{ php_getuid */ -zend_long php_getuid(TSRMLS_D) +zend_long php_getuid(void) { - php_statpage(TSRMLS_C); + php_statpage(); return (BG(page_uid)); } /* }}} */ -zend_long php_getgid(TSRMLS_D) +zend_long php_getgid(void) { - php_statpage(TSRMLS_C); + php_statpage(); return (BG(page_gid)); } @@ -102,7 +102,7 @@ PHP_FUNCTION(getmyuid) return; } - uid = php_getuid(TSRMLS_C); + uid = php_getuid(); if (uid < 0) { RETURN_FALSE; } else { @@ -121,7 +121,7 @@ PHP_FUNCTION(getmygid) return; } - gid = php_getgid(TSRMLS_C); + gid = php_getgid(); if (gid < 0) { RETURN_FALSE; } else { @@ -157,7 +157,7 @@ PHP_FUNCTION(getmyinode) return; } - php_statpage(TSRMLS_C); + php_statpage(); if (BG(page_inode) < 0) { RETURN_FALSE; } else { @@ -166,9 +166,9 @@ PHP_FUNCTION(getmyinode) } /* }}} */ -PHPAPI time_t php_getlastmod(TSRMLS_D) +PHPAPI time_t php_getlastmod(void) { - php_statpage(TSRMLS_C); + php_statpage(); return BG(page_mtime); } @@ -182,7 +182,7 @@ PHP_FUNCTION(getlastmod) return; } - lm = php_getlastmod(TSRMLS_C); + lm = php_getlastmod(); if (lm < 0) { RETURN_FALSE; } else { diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h index ec5823246a..338d162cfe 100644 --- a/ext/standard/pageinfo.h +++ b/ext/standard/pageinfo.h @@ -27,9 +27,9 @@ PHP_FUNCTION(getmypid); PHP_FUNCTION(getmyinode); PHP_FUNCTION(getlastmod); -PHPAPI void php_statpage(TSRMLS_D); -PHPAPI time_t php_getlastmod(TSRMLS_D); -extern zend_long php_getuid(TSRMLS_D); -extern zend_long php_getgid(TSRMLS_D); +PHPAPI void php_statpage(void); +PHPAPI time_t php_getlastmod(void); +extern zend_long php_getuid(void); +extern zend_long php_getgid(void); #endif diff --git a/ext/standard/password.c b/ext/standard/password.c index 087b3ace76..5e1c26de54 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -107,7 +107,7 @@ static int php_password_salt_to64(const char *str, const size_t str_len, const s } /* }}} */ -static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */ +static int php_password_make_salt(size_t length, char *ret) /* {{{ */ { int buffer_valid = 0; size_t i, raw_length; @@ -115,7 +115,7 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */ char *result; if (length > (INT_MAX / 3)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length is too large to safely generate"); + php_error_docref(NULL, E_WARNING, "Length is too large to safely generate"); return FAILURE; } @@ -152,13 +152,13 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */ #endif if (!buffer_valid) { for (i = 0; i < raw_length; i++) { - buffer[i] ^= (char) (255.0 * php_rand(TSRMLS_C) / RAND_MAX); + buffer[i] ^= (char) (255.0 * php_rand() / RAND_MAX); } } result = safe_emalloc(length, 1, 1); if (php_password_salt_to64(buffer, raw_length, length, result) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Generated salt too short"); + php_error_docref(NULL, E_WARNING, "Generated salt too short"); efree(buffer); efree(result); return FAILURE; @@ -178,7 +178,7 @@ PHP_FUNCTION(password_get_info) char *hash, *algo_name; zval options; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hash, &hash_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hash, &hash_len) == FAILURE) { return; } @@ -216,7 +216,7 @@ PHP_FUNCTION(password_needs_rehash) HashTable *options = 0; zval *option_buffer; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) { return; } @@ -265,7 +265,7 @@ PHP_FUNCTION(password_verify) char *password, *hash; zend_string *ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &password, &password_len, &hash, &hash_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &password, &password_len, &hash, &hash_len) == FAILURE) { RETURN_FALSE; } if ((ret = php_crypt(password, (int)password_len, hash, (int)hash_len)) == NULL) { @@ -305,7 +305,7 @@ PHP_FUNCTION(password_hash) zval *option_buffer; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &password, &password_len, &algo, &options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|H", &password, &password_len, &algo, &options) == FAILURE) { return; } @@ -327,7 +327,7 @@ PHP_FUNCTION(password_hash) } if (cost < 4 || cost > 31) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost); + php_error_docref(NULL, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost); RETURN_NULL(); } @@ -339,7 +339,7 @@ PHP_FUNCTION(password_hash) break; case PHP_PASSWORD_UNKNOWN: default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: " ZEND_LONG_FMT, algo); + php_error_docref(NULL, E_WARNING, "Unknown password hashing algorithm: " ZEND_LONG_FMT, algo); RETURN_NULL(); } @@ -373,7 +373,7 @@ PHP_FUNCTION(password_hash) case IS_ARRAY: default: efree(hash_format); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-string salt parameter supplied"); + php_error_docref(NULL, E_WARNING, "Non-string salt parameter supplied"); RETURN_NULL(); } @@ -383,12 +383,12 @@ PHP_FUNCTION(password_hash) if (buffer_len > INT_MAX) { efree(hash_format); efree(buffer); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long"); + php_error_docref(NULL, E_WARNING, "Supplied salt is too long"); RETURN_NULL(); } else if (buffer_len < required_salt_len) { efree(hash_format); efree(buffer); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len); + php_error_docref(NULL, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len); RETURN_NULL(); } else if (php_password_salt_is_alphabet(buffer, buffer_len) == FAILURE) { salt = safe_emalloc(required_salt_len, 1, 1); @@ -396,7 +396,7 @@ PHP_FUNCTION(password_hash) efree(hash_format); efree(buffer); efree(salt); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd", buffer_len); + php_error_docref(NULL, E_WARNING, "Provided salt is too short: %zd", buffer_len); RETURN_NULL(); } salt_len = required_salt_len; @@ -408,7 +408,7 @@ PHP_FUNCTION(password_hash) efree(buffer); } else { salt = safe_emalloc(required_salt_len, 1, 1); - if (php_password_make_salt(required_salt_len, salt TSRMLS_CC) == FAILURE) { + if (php_password_make_salt(required_salt_len, salt) == FAILURE) { efree(hash_format); efree(salt); RETURN_FALSE; diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index dee00e6218..b35ce30c8b 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -104,11 +104,11 @@ PHP_FUNCTION(array_chunk); PHP_FUNCTION(array_combine); PHPAPI HashTable* php_splice(HashTable *, int, int, zval *, int, HashTable *); -PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC); -PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC); -PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC); -PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC); -PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC); +PHPAPI int php_array_merge(HashTable *dest, HashTable *src); +PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src); +PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src); +PHPAPI int php_multisort_compare(const void *a, const void *b); +PHPAPI zend_long php_count_recursive(zval *array, zend_long mode); #define PHP_SORT_REGULAR 0 #define PHP_SORT_NUMERIC 1 @@ -127,7 +127,7 @@ PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC); ZEND_BEGIN_MODULE_GLOBALS(array) int *multisort_flags[2]; - int (*compare_func)(zval *result, zval *op1, zval *op2 TSRMLS_DC); + int (*compare_func)(zval *result, zval *op1, zval *op2); ZEND_END_MODULE_GLOBALS(array) #ifdef ZTS diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h index e32c4a2cb9..2018694e65 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -84,8 +84,8 @@ typedef unsigned int php_stat_len; typedef int php_stat_len; #endif -PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC); -PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC); +PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len); +PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value); /* Switches for various filestat functions: */ #define FS_PERMS 0 diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 8026b08d45..9239b37032 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -31,21 +31,21 @@ #include "php_fopen_wrappers.h" #include "SAPI.h" -static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count) /* {{{ */ { PHPWRITE(buf, count); return count; } /* }}} */ -static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count) /* {{{ */ { stream->eof = 1; return 0; } /* }}} */ -static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ +static int php_stream_output_close(php_stream *stream, int close_handle) /* {{{ */ { return 0; } @@ -69,20 +69,20 @@ typedef struct php_stream_input { /* {{{ */ } php_stream_input_t; /* }}} */ -static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count) /* {{{ */ { return -1; } /* }}} */ -static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count) /* {{{ */ { php_stream_input_t *input = stream->abstract; size_t read; if (!SG(post_read) && SG(read_post_bytes) < (int64_t)(input->position + count)) { /* read requested data from SAPI */ - int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC); + int read_bytes = sapi_read_post_block(buf, count); if (read_bytes > 0) { php_stream_seek(input->body, 0, SEEK_END); @@ -103,7 +103,7 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count } /* }}} */ -static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ +static int php_stream_input_close(php_stream *stream, int close_handle) /* {{{ */ { efree(stream->abstract); stream->abstract = NULL; @@ -112,13 +112,13 @@ static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC } /* }}} */ -static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */ +static int php_stream_input_flush(php_stream *stream) /* {{{ */ { return -1; } /* }}} */ -static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */ +static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */ { php_stream_input_t *input = stream->abstract; @@ -144,7 +144,7 @@ php_stream_ops php_stream_input_ops = { NULL /* set_option */ }; -static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) /* {{{ */ +static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain) /* {{{ */ { char *p, *token; php_stream_filter *temp_filter; @@ -153,17 +153,17 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i while (p) { php_url_decode(p, strlen(p)); if (read_chain) { - if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) { + if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) { php_stream_filter_append(&stream->readfilters, temp_filter); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p); + php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p); } } if (write_chain) { - if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) { + if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) { php_stream_filter_append(&stream->writefilters, temp_filter); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p); + php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p); } } p = php_strtok_r(NULL, "|", &token); @@ -172,7 +172,7 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i /* }}} */ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ + char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */ { int fd = -1; int mode_rw = 0; @@ -192,7 +192,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa path += 11; max_memory = ZEND_STRTOL(path, NULL, 10); if (max_memory < 0) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); return NULL; } } @@ -222,7 +222,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); + php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } @@ -241,7 +241,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa if (!strcasecmp(path, "stdin")) { if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); + php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } @@ -291,14 +291,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa if (strcmp(sapi_module.name, "cli")) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Direct access to file descriptors is only available from command-line PHP"); + php_error_docref(NULL, E_WARNING, "Direct access to file descriptors is only available from command-line PHP"); } return NULL; } if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); + php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } @@ -306,7 +306,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa start = &path[3]; fildes_ori = ZEND_STRTOL(start, &end, 10); if (end == start || *end != '\0') { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options, "php://fd/ stream must be specified in the form php://fd/<orig fd>"); return NULL; } @@ -318,14 +318,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa #endif if (fildes_ori < 0 || fildes_ori >= dtablesize) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options, "The file descriptors must be non-negative numbers smaller than %d", dtablesize); return NULL; } fd = dup((int)fildes_ori); if (fd == -1) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options, "Error duping file descriptor " ZEND_LONG_FMT "; possibly it doesn't exist: " "[%d]: %s", fildes_ori, errno, strerror(errno)); return NULL; @@ -341,7 +341,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa pathdup = estrndup(path + 6, strlen(path + 6)); p = strstr(pathdup, "/resource="); if (!p) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "No URL resource specified"); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "No URL resource specified"); efree(pathdup); return NULL; } @@ -355,11 +355,11 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa p = php_strtok_r(pathdup + 1, "/", &token); while (p) { if (!strncasecmp(p, "read=", 5)) { - php_stream_apply_filter_list(stream, p + 5, 1, 0 TSRMLS_CC); + php_stream_apply_filter_list(stream, p + 5, 1, 0); } else if (!strncasecmp(p, "write=", 6)) { - php_stream_apply_filter_list(stream, p + 6, 0, 1 TSRMLS_CC); + php_stream_apply_filter_list(stream, p + 6, 0, 1); } else { - php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE TSRMLS_CC); + php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE); } p = php_strtok_r(NULL, "/", &token); } @@ -368,7 +368,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa return stream; } else { /* invalid php://thingy */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid php:// URL specified"); + php_error_docref(NULL, E_WARNING, "Invalid php:// URL specified"); return NULL; } diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index 6d6a5bde27..b82a1f8913 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -23,8 +23,8 @@ #ifndef PHP_FOPEN_WRAPPERS_H #define PHP_FOPEN_WRAPPERS_H -php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC); +php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC); extern PHPAPI php_stream_wrapper php_stream_http_wrapper; extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper; extern PHPAPI php_stream_wrapper php_stream_php_wrapper; diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 712e297fe3..81a5b45bb6 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -28,8 +28,8 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *num_prefix, size_t num_prefix_len, const char *key_prefix, size_t key_prefix_len, const char *key_suffix, size_t key_suffix_len, - zval *type, char *arg_sep, int enc_type TSRMLS_DC); -#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL TSRMLS_CC) + zval *type, char *arg_sep, int enc_type); +#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL) PHP_FUNCTION(http_build_query); diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h index 3853b0e6c3..de6527ebb2 100644 --- a/ext/standard/php_image.h +++ b/ext/standard/php_image.h @@ -59,7 +59,7 @@ typedef enum PHP_MINIT_FUNCTION(imagetypes); -PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC); +PHPAPI int php_getimagetype(php_stream *stream, char *filetype); PHPAPI char * php_image_type_to_mime_type(int image_type); diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index fa2747f3bf..6fb97e9d77 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -52,7 +52,7 @@ extern "C" { #endif -PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D); +PHPAPI zend_class_entry *php_create_incomplete_class(void); PHPAPI zend_string *php_lookup_class_name(zval *object); PHPAPI void php_store_class_name(zval *object, const char *name, size_t len); diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h index 81d251c513..c89f4f3034 100644 --- a/ext/standard/php_lcg.h +++ b/ext/standard/php_lcg.h @@ -29,7 +29,7 @@ typedef struct { int seeded; } php_lcg_globals; -PHPAPI double php_combined_lcg(TSRMLS_D); +PHPAPI double php_combined_lcg(void); PHP_FUNCTION(lcg_value); PHP_MINIT_FUNCTION(lcg); diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index f7ee5e983a..68f806db5d 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -25,6 +25,6 @@ PHP_FUNCTION(mail); PHP_MINFO_FUNCTION(mail); PHP_FUNCTION(ezmlm_hash); -PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC); +PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd); #endif /* PHP_MAIL_H */ diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index 7fb6909e7f..075e69058d 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -24,10 +24,10 @@ PHPAPI zend_string *_php_math_number_format(double, int, char, char); PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t); -PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC); +PHPAPI zend_string * _php_math_longtobase(zval *arg, int base); PHPAPI zend_long _php_math_basetolong(zval *arg, int base); PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret); -PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC); +PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base); PHP_FUNCTION(sin); PHP_FUNCTION(cos); diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h index bbdf16d385..e775d1b465 100644 --- a/ext/standard/php_rand.h +++ b/ext/standard/php_rand.h @@ -48,14 +48,14 @@ #define PHP_MT_RAND_MAX ((zend_long) (0x7FFFFFFF)) /* (1<<31) - 1 */ #ifdef PHP_WIN32 -#define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg(TSRMLS_C)))) +#define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg()))) #else -#define GENERATE_SEED() (((zend_long) (time(0) * getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg(TSRMLS_C)))) +#define GENERATE_SEED() (((zend_long) (time(0) * getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg()))) #endif -PHPAPI void php_srand(zend_long seed TSRMLS_DC); -PHPAPI zend_long php_rand(TSRMLS_D); -PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC); -PHPAPI php_uint32 php_mt_rand(TSRMLS_D); +PHPAPI void php_srand(zend_long seed); +PHPAPI zend_long php_rand(void); +PHPAPI void php_mt_srand(php_uint32 seed); +PHPAPI php_uint32 php_mt_rand(void); #endif /* PHP_RAND_H */ diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 0b655bfbdf..c79bfb20fe 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -121,31 +121,31 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out); PHPAPI char *php_strtoupper(char *s, size_t len); PHPAPI char *php_strtolower(char *s, size_t len); PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size_t trlen); -PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC); -PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t wlength TSRMLS_DC); -PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC); +PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free); +PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t wlength); +PHPAPI void php_stripslashes(char *str, size_t *len); PHPAPI void php_stripcslashes(char *str, size_t *len); -PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen TSRMLS_DC); +PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen); PHPAPI size_t php_dirname(char *str, size_t len); PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len); PHPAPI zend_string *php_str_to_str_ex(char *haystack, size_t length, char *needle, size_t needle_len, char *str, size_t str_len, int case_sensitivity, size_t *replace_count); PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle, size_t needle_len, char *str, size_t str_len); -PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC); +PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode); PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *state, char *allow, size_t allow_len); PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, int *stateptr, char *allow, size_t allow_len, zend_bool allow_tag_spaces); PHPAPI size_t php_char_to_str_ex(char *str, size_t len, char from, char *to, size_t to_len, zval *result, int case_sensitivity, size_t *replace_count); PHPAPI size_t php_char_to_str(char *str, size_t len, char from, char *to, size_t to_len, zval *result); -PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC); +PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value); PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit); PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end); PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end); -PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC); -PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); +PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive); +PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2); +PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2); #ifndef HAVE_STRERROR PHPAPI char *php_strerror(int errnum); diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index a4df8f51f9..a3b0dbf94f 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -32,11 +32,11 @@ PHP_FUNCTION(unserialize); PHP_FUNCTION(memory_get_usage); PHP_FUNCTION(memory_get_peak_usage); -PHPAPI void php_var_dump(zval *struc, int level TSRMLS_DC); -PHPAPI void php_var_export(zval *struc, int level TSRMLS_DC); -PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC); +PHPAPI void php_var_dump(zval *struc, int level); +PHPAPI void php_var_export(zval *struc, int level); +PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf); -PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC); +PHPAPI void php_debug_zval_dump(zval *struc, int level); struct php_serialize_data { HashTable ht; @@ -53,11 +53,11 @@ struct php_unserialize_data { typedef struct php_serialize_data *php_serialize_data_t; typedef struct php_unserialize_data *php_unserialize_data_t; -PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC); -PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC); -PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC); -PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC); -PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC); +PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data); +PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash); +PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash); +PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash); +PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes); #define PHP_VAR_SERIALIZE_INIT(d) \ do { \ diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index d6a6f2be50..6f2516bca6 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -73,7 +73,7 @@ static int le_proc_open; /* {{{ _php_array_to_envp */ -static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent TSRMLS_DC) +static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent) { zval *element; php_process_env_t env; @@ -186,7 +186,7 @@ static void _php_free_envp(php_process_env_t env, int is_persistent) /* }}} */ /* {{{ proc_open_rsrc_dtor */ -static void proc_open_rsrc_dtor(zend_resource *rsrc TSRMLS_DC) +static void proc_open_rsrc_dtor(zend_resource *rsrc) { struct php_process_handle *proc = (struct php_process_handle*)rsrc->ptr; int i; @@ -262,7 +262,7 @@ PHP_FUNCTION(proc_terminate) struct php_process_handle *proc; zend_long sig_no = SIGTERM; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zproc, &sig_no) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zproc, &sig_no) == FAILURE) { RETURN_FALSE; } @@ -291,7 +291,7 @@ PHP_FUNCTION(proc_close) zval *zproc; struct php_process_handle *proc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zproc) == FAILURE) { RETURN_FALSE; } @@ -319,7 +319,7 @@ PHP_FUNCTION(proc_get_status) int running = 1, signaled = 0, stopped = 0; int exitcode = -1, termsig = 0, stopsig = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zproc) == FAILURE) { RETURN_FALSE; } @@ -459,7 +459,7 @@ PHP_FUNCTION(proc_open) php_file_descriptor_t slave_pty = -1; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz/|s!a!a!", &command, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "saz/|s!a!a!", &command, &command_len, &descriptorspec, &pipes, &cwd, &cwd_len, &environment, &other_options) == FAILURE) { RETURN_FALSE; @@ -488,7 +488,7 @@ PHP_FUNCTION(proc_open) command_len = strlen(command); if (environment) { - env = _php_array_to_envp(environment, is_persistent TSRMLS_CC); + env = _php_array_to_envp(environment, is_persistent); } else { memset(&env, 0, sizeof(env)); } @@ -508,7 +508,7 @@ PHP_FUNCTION(proc_open) zval *ztype; if (str_index) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "descriptor spec must be an integer indexed array"); + php_error_docref(NULL, E_WARNING, "descriptor spec must be an integer indexed array"); goto exit_fail; } @@ -528,27 +528,27 @@ PHP_FUNCTION(proc_open) #ifdef PHP_WIN32 descriptors[ndesc].childend = dup_fd_as_handle((int)fd); if (descriptors[ndesc].childend == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex); + php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex); goto exit_fail; } #else descriptors[ndesc].childend = dup(fd); if (descriptors[ndesc].childend < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno)); + php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno)); goto exit_fail; } #endif descriptors[ndesc].mode = DESC_FILE; } else if (Z_TYPE_P(descitem) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Descriptor item must be either an array or a File-Handle"); + php_error_docref(NULL, E_WARNING, "Descriptor item must be either an array or a File-Handle"); goto exit_fail; } else { if ((ztype = zend_hash_index_find(Z_ARRVAL_P(descitem), 0)) != NULL) { convert_to_string_ex(ztype); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing handle qualifier in array"); + php_error_docref(NULL, E_WARNING, "Missing handle qualifier in array"); goto exit_fail; } @@ -559,14 +559,14 @@ PHP_FUNCTION(proc_open) if ((zmode = zend_hash_index_find(Z_ARRVAL_P(descitem), 1)) != NULL) { convert_to_string_ex(zmode); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'pipe'"); + php_error_docref(NULL, E_WARNING, "Missing mode parameter for 'pipe'"); goto exit_fail; } descriptors[ndesc].mode = DESC_PIPE; if (0 != pipe(newpipe)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create pipe %s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "unable to create pipe %s", strerror(errno)); goto exit_fail; } @@ -598,14 +598,14 @@ PHP_FUNCTION(proc_open) if ((zfile = zend_hash_index_find(Z_ARRVAL_P(descitem), 1)) != NULL) { convert_to_string_ex(zfile); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing file name parameter for 'file'"); + php_error_docref(NULL, E_WARNING, "Missing file name parameter for 'file'"); goto exit_fail; } if ((zmode = zend_hash_index_find(Z_ARRVAL_P(descitem), 2)) != NULL) { convert_to_string_ex(zmode); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'file'"); + php_error_docref(NULL, E_WARNING, "Missing mode parameter for 'file'"); goto exit_fail; } @@ -638,7 +638,7 @@ PHP_FUNCTION(proc_open) /* open things up */ dev_ptmx = open("/dev/ptmx", O_RDWR); if (dev_ptmx == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open /dev/ptmx, errno %d", errno); + php_error_docref(NULL, E_WARNING, "failed to open /dev/ptmx, errno %d", errno); goto exit_fail; } grantpt(dev_ptmx); @@ -646,7 +646,7 @@ PHP_FUNCTION(proc_open) slave_pty = open(ptsname(dev_ptmx), O_RDWR); if (slave_pty == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open slave pty, errno %d", errno); + php_error_docref(NULL, E_WARNING, "failed to open slave pty, errno %d", errno); goto exit_fail; } } @@ -655,11 +655,11 @@ PHP_FUNCTION(proc_open) descriptors[ndesc].parentend = dup(dev_ptmx); descriptors[ndesc].mode_flags = O_RDWR; #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "pty pseudo terminal not supported on this system"); + php_error_docref(NULL, E_WARNING, "pty pseudo terminal not supported on this system"); goto exit_fail; #endif } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_P(ztype)); + php_error_docref(NULL, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_P(ztype)); goto exit_fail; } } @@ -673,7 +673,7 @@ PHP_FUNCTION(proc_open) char *getcwd_result; getcwd_result = VCWD_GETCWD(cur_cwd, MAXPATHLEN); if (!getcwd_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get current directory"); + php_error_docref(NULL, E_WARNING, "Cannot get current directory"); goto exit_fail; } cwd = cur_cwd; @@ -738,7 +738,7 @@ PHP_FUNCTION(proc_open) CloseHandle(descriptors[i].parentend); } } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "CreateProcess failed, error code - %u", dw); + php_error_docref(NULL, E_WARNING, "CreateProcess failed, error code - %u", dw); goto exit_fail; } @@ -787,7 +787,7 @@ PHP_FUNCTION(proc_open) if (descriptors[i].parentend) close(descriptors[i].parentend); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "procve failed - %s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "procve failed - %s", strerror(errno)); goto exit_fail; } #elif HAVE_FORK @@ -856,7 +856,7 @@ PHP_FUNCTION(proc_open) close(descriptors[i].parentend); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork failed - %s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "fork failed - %s", strerror(errno)); goto exit_fail; diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 441b65288c..6699566863 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -206,7 +206,7 @@ PHP_FUNCTION(quoted_printable_decode) zend_string *str_out; size_t i = 0, j = 0, k; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg1) == FAILURE) { return; } @@ -267,7 +267,7 @@ PHP_FUNCTION(quoted_printable_encode) zend_string *str; zend_string *new_str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) != SUCCESS) { return; } diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 47b55af466..528b38fd41 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -38,7 +38,7 @@ /* {{{ php_srand */ -PHPAPI void php_srand(zend_long seed TSRMLS_DC) +PHPAPI void php_srand(zend_long seed) { #ifdef ZTS BG(rand_seed) = (unsigned int) seed; @@ -59,12 +59,12 @@ PHPAPI void php_srand(zend_long seed TSRMLS_DC) /* {{{ php_rand */ -PHPAPI zend_long php_rand(TSRMLS_D) +PHPAPI zend_long php_rand(void) { zend_long ret; if (!BG(rand_is_seeded)) { - php_srand(GENERATE_SEED() TSRMLS_CC); + php_srand(GENERATE_SEED()); } #ifdef ZTS @@ -171,7 +171,7 @@ static inline void php_mt_initialize(php_uint32 seed, php_uint32 *state) /* {{{ php_mt_reload */ -static inline void php_mt_reload(TSRMLS_D) +static inline void php_mt_reload(void) { /* Generate N new values in state Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) */ @@ -192,11 +192,11 @@ static inline void php_mt_reload(TSRMLS_D) /* {{{ php_mt_srand */ -PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC) +PHPAPI void php_mt_srand(php_uint32 seed) { /* Seed the generator with a simple uint32 */ php_mt_initialize(seed, BG(state)); - php_mt_reload(TSRMLS_C); + php_mt_reload(); /* Seed only once */ BG(mt_rand_is_seeded) = 1; @@ -205,7 +205,7 @@ PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC) /* {{{ php_mt_rand */ -PHPAPI php_uint32 php_mt_rand(TSRMLS_D) +PHPAPI php_uint32 php_mt_rand(void) { /* Pull a 32-bit integer from the generator state Every other access function simply transforms the numbers extracted here */ @@ -213,7 +213,7 @@ PHPAPI php_uint32 php_mt_rand(TSRMLS_D) register php_uint32 s1; if (BG(left) == 0) { - php_mt_reload(TSRMLS_C); + php_mt_reload(); } --BG(left); @@ -231,13 +231,13 @@ PHP_FUNCTION(srand) { zend_long seed = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE) return; if (ZEND_NUM_ARGS() == 0) seed = GENERATE_SEED(); - php_srand(seed TSRMLS_CC); + php_srand(seed); } /* }}} */ @@ -247,13 +247,13 @@ PHP_FUNCTION(mt_srand) { zend_long seed = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE) return; if (ZEND_NUM_ARGS() == 0) seed = GENERATE_SEED(); - php_mt_srand(seed TSRMLS_CC); + php_mt_srand(seed); } /* }}} */ @@ -293,10 +293,10 @@ PHP_FUNCTION(rand) zend_long number; int argc = ZEND_NUM_ARGS(); - if (argc != 0 && zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE) + if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) return; - number = php_rand(TSRMLS_C); + number = php_rand(); if (argc == 2) { RAND_RANGE(number, min, max, PHP_RAND_MAX); } @@ -315,16 +315,16 @@ PHP_FUNCTION(mt_rand) int argc = ZEND_NUM_ARGS(); if (argc != 0) { - if (zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE) { + if (zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) { return; } else if (max < min) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min); + php_error_docref(NULL, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min); RETURN_FALSE; } } if (!BG(mt_rand_is_seeded)) { - php_mt_srand(GENERATE_SEED() TSRMLS_CC); + php_mt_srand(GENERATE_SEED()); } /* @@ -335,7 +335,7 @@ PHP_FUNCTION(mt_rand) * Update: * I talked with Cokus via email and it won't ruin the algorithm */ - number = (zend_long) (php_mt_rand(TSRMLS_C) >> 1); + number = (zend_long) (php_mt_rand() >> 1); if (argc == 2) { RAND_RANGE(number, min, max, PHP_MT_RAND_MAX); } diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 62437831bb..ad5e2d1850 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -316,7 +316,6 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs) int staticAssign[STATIC_LIST_SIZE]; int *nassign = staticAssign; int objIndex, xpgSize, nspace = STATIC_LIST_SIZE; - TSRMLS_FETCH(); /* * Initialize an array that records the number of times a variable @@ -394,7 +393,7 @@ notXpg: gotSequential = 1; if (gotXpg) { mixedXPG: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers"); + php_error_docref(NULL, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers"); goto error; } @@ -445,7 +444,7 @@ xpgCheckDone: /* problem - cc */ /* if (flags & SCAN_WIDTH) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field width may not be specified in %c conversion"); + php_error_docref(NULL, E_WARNING, "Field width may not be specified in %c conversion"); goto error; } */ @@ -476,11 +475,11 @@ xpgCheckDone: } break; badSet: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unmatched [ in format string"); + php_error_docref(NULL, E_WARNING, "Unmatched [ in format string"); goto error; default: { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad scan conversion character \"%c\"", *ch); + php_error_docref(NULL, E_WARNING, "Bad scan conversion character \"%c\"", *ch); goto error; } } @@ -530,14 +529,14 @@ badSet: } for (i = 0; i < numVars; i++) { if (nassign[i] > 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers"); + php_error_docref(NULL, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers"); goto error; } else if (!xpgSize && (nassign[i] == 0)) { /* * If the space is empty, and xpgSize is 0 (means XPG wasn't * used, and/or numVars != 0), then too many vars were given */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable is not assigned by any conversion specifiers"); + php_error_docref(NULL, E_WARNING, "Variable is not assigned by any conversion specifiers"); goto error; } } @@ -549,9 +548,9 @@ badSet: badIndex: if (gotXpg) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "\"%n$\" argument index out of range"); + php_error_docref(NULL, E_WARNING, "%s", "\"%n$\" argument index out of range"); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Different numbers of variable names and field specifiers"); + php_error_docref(NULL, E_WARNING, "Different numbers of variable names and field specifiers"); } error: @@ -578,7 +577,7 @@ error: PHPAPI int php_sscanf_internal( char *string, char *format, int argCount, zval *args, - int varStart, zval *return_value TSRMLS_DC) + int varStart, zval *return_value) { int numVars, nconversions, totalVars = -1; int i, result; @@ -625,7 +624,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format, if (numVars) { for (i = varStart;i < argCount;i++){ if ( ! Z_ISREF(args[ i ] ) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d must be passed by reference", i); + php_error_docref(NULL, E_WARNING, "Parameter %d must be passed by reference", i); scan_set_error_return(numVars, return_value); return SCAN_ERROR_VAR_PASSED_BYVAL; } diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index 6d9e8a443c..a94e8006de 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -43,7 +43,7 @@ */ PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars); PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval *args, - int varStart, zval *return_value TSRMLS_DC); + int varStart, zval *return_value); #endif /* SCANF_H */ diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 249828fb3d..e966149e76 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -40,7 +40,7 @@ PHP_FUNCTION(sha1) PHP_SHA1_CTX context; unsigned char digest[20]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &raw_output) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) { return; } @@ -74,7 +74,7 @@ PHP_FUNCTION(sha1_file) size_t n; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) { return; } diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index d882f5cab6..b9f89a8ac1 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -60,7 +60,7 @@ PHP_FUNCTION(soundex) 0, /* Y */ '2'}; /* Z */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { return; } if (str_len == 0) { diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 51e3c14e7a..31ab31cf3f 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -42,7 +42,7 @@ typedef unsigned __int64 php_timeout_ull; #define GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), wrapper, name))) -static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC); +static php_stream_context *decode_context_param(zval *contextresource); /* Streams based network functions */ @@ -55,14 +55,14 @@ PHP_FUNCTION(stream_socket_pair) php_stream *s1, *s2; php_socket_t pair[2]; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &domain, &type, &protocol)) { RETURN_FALSE; } if (0 != socketpair((int)domain, (int)type, (int)protocol, pair)) { char errbuf[256]; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create sockets: [%d]: %s", + php_error_docref(NULL, E_WARNING, "failed to create sockets: [%d]: %s", php_socket_errno(), php_socket_strerror(php_socket_errno(), errbuf, sizeof(errbuf))); RETURN_FALSE; } @@ -102,7 +102,7 @@ PHP_FUNCTION(stream_socket_client) RETVAL_FALSE; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) { RETURN_FALSE; } @@ -138,9 +138,9 @@ PHP_FUNCTION(stream_socket_client) if (stream == NULL) { /* host might contain binary characters */ - zend_string *quoted_host = php_addslashes(host, host_len, 0 TSRMLS_CC); + zend_string *quoted_host = php_addslashes(host, host_len, 0); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", quoted_host->val, errstr == NULL ? "Unknown error" : errstr->val); + php_error_docref(NULL, E_WARNING, "unable to connect to %s (%s)", quoted_host->val, errstr == NULL ? "Unknown error" : errstr->val); zend_string_release(quoted_host); } @@ -186,7 +186,7 @@ PHP_FUNCTION(stream_socket_server) RETVAL_FALSE; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) { RETURN_FALSE; } @@ -210,7 +210,7 @@ PHP_FUNCTION(stream_socket_server) NULL, NULL, context, &errstr, &err); if (stream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr->val); + php_error_docref(NULL, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr->val); } if (stream == NULL) { @@ -248,7 +248,7 @@ PHP_FUNCTION(stream_socket_accept) zval *zstream; zend_string *errstr = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|dz/", &zstream, &timeout, &zpeername) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|dz/", &zstream, &timeout, &zpeername) == FAILURE) { RETURN_FALSE; } @@ -279,7 +279,7 @@ PHP_FUNCTION(stream_socket_accept) } php_stream_to_zval(clistream, return_value); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr->val : "Unknown error"); + php_error_docref(NULL, E_WARNING, "accept failed: %s", errstr ? errstr->val : "Unknown error"); RETVAL_FALSE; } @@ -298,7 +298,7 @@ PHP_FUNCTION(stream_socket_get_name) zend_bool want_peer; zend_string *name = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &zstream, &want_peer) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &zstream, &want_peer) == FAILURE) { RETURN_FALSE; } @@ -327,20 +327,20 @@ PHP_FUNCTION(stream_socket_sendto) php_sockaddr_storage sa; socklen_t sl = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) { RETURN_FALSE; } php_stream_from_zval(stream, zstream); if (target_addr_len) { /* parse the address */ - if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)&sa, &sl TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse `%s' into a valid network address", target_addr); + if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)&sa, &sl)) { + php_error_docref(NULL, E_WARNING, "Failed to parse `%s' into a valid network address", target_addr); RETURN_FALSE; } } - RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr ? &sa : NULL, sl TSRMLS_CC)); + RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr ? &sa : NULL, sl)); } /* }}} */ @@ -356,7 +356,7 @@ PHP_FUNCTION(stream_socket_recvfrom) zend_long flags = 0; int recvd; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) { RETURN_FALSE; } @@ -368,7 +368,7 @@ PHP_FUNCTION(stream_socket_recvfrom) } if (to_read <= 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; } @@ -402,7 +402,7 @@ PHP_FUNCTION(stream_get_contents) desiredpos = -1L; zend_string *contents; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) { RETURN_FALSE; } @@ -422,14 +422,14 @@ PHP_FUNCTION(stream_get_contents) } if (seek_res != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "Failed to seek to position %pd in the stream", desiredpos); RETURN_FALSE; } } if (maxlen > INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX); + php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX); maxlen = INT_MAX; } if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { @@ -450,7 +450,7 @@ PHP_FUNCTION(stream_copy_to_stream) size_t len; int ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) { RETURN_FALSE; } @@ -458,7 +458,7 @@ PHP_FUNCTION(stream_copy_to_stream) php_stream_from_zval(dest, zdest); if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", pos); + php_error_docref(NULL, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", pos); RETURN_FALSE; } @@ -478,7 +478,7 @@ PHP_FUNCTION(stream_get_meta_data) zval *arg1; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) { return; } php_stream_from_zval(stream, arg1); @@ -575,7 +575,7 @@ PHP_FUNCTION(stream_get_wrappers) /* }}} */ /* {{{ stream_select related functions */ -static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd TSRMLS_DC) +static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd) { zval *elem; php_stream *stream; @@ -613,7 +613,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t return cnt ? 1 : 0; } -static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) +static int stream_array_from_fd_set(zval *stream_array, fd_set *fds) { zval *elem, *dest_elem, new_array; php_stream *stream; @@ -666,7 +666,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) return ret; } -static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC) +static int stream_array_emulate_read_fd_set(zval *stream_array) { zval *elem, *dest_elem, new_array; php_stream *stream; @@ -726,7 +726,7 @@ PHP_FUNCTION(stream_select) zend_long usec = 0; int set_count, max_set_count = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) return; FD_ZERO(&rfds); @@ -734,28 +734,28 @@ PHP_FUNCTION(stream_select) FD_ZERO(&efds); if (r_array != NULL) { - set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC); + set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd); if (set_count > max_set_count) max_set_count = set_count; sets += set_count; } if (w_array != NULL) { - set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC); + set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd); if (set_count > max_set_count) max_set_count = set_count; sets += set_count; } if (e_array != NULL) { - set_count = stream_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC); + set_count = stream_array_to_fd_set(e_array, &efds, &max_fd); if (set_count > max_set_count) max_set_count = set_count; sets += set_count; } if (!sets) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed"); + php_error_docref(NULL, E_WARNING, "No stream arrays were passed"); RETURN_FALSE; } @@ -766,10 +766,10 @@ PHP_FUNCTION(stream_select) convert_to_long_ex(sec); if (Z_LVAL_P(sec) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater than 0"); + php_error_docref(NULL, E_WARNING, "The seconds parameter must be greater than 0"); RETURN_FALSE; } else if (usec < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The microseconds parameter must be greater than 0"); + php_error_docref(NULL, E_WARNING, "The microseconds parameter must be greater than 0"); RETURN_FALSE; } @@ -794,7 +794,7 @@ PHP_FUNCTION(stream_select) * that we selected, but return only the readable sockets */ if (r_array != NULL) { - retval = stream_array_emulate_read_fd_set(r_array TSRMLS_CC); + retval = stream_array_emulate_read_fd_set(r_array); if (retval > 0) { if (w_array != NULL) { zend_hash_clean(Z_ARRVAL_P(w_array)); @@ -809,14 +809,14 @@ PHP_FUNCTION(stream_select) retval = php_select(max_fd+1, &rfds, &wfds, &efds, tv_p); if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s (max_fd=%d)", + php_error_docref(NULL, E_WARNING, "unable to select [%d]: %s (max_fd=%d)", errno, strerror(errno), max_fd); RETURN_FALSE; } - if (r_array != NULL) stream_array_from_fd_set(r_array, &rfds TSRMLS_CC); - if (w_array != NULL) stream_array_from_fd_set(w_array, &wfds TSRMLS_CC); - if (e_array != NULL) stream_array_from_fd_set(e_array, &efds TSRMLS_CC); + if (r_array != NULL) stream_array_from_fd_set(r_array, &rfds); + if (w_array != NULL) stream_array_from_fd_set(w_array, &wfds); + if (e_array != NULL) stream_array_from_fd_set(e_array, &efds); RETURN_LONG(retval); } @@ -824,7 +824,7 @@ PHP_FUNCTION(stream_select) /* {{{ stream_context related functions */ static void user_space_stream_notifier(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC) + char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr) { zval *callback = &context->notifier->ptr; zval retval; @@ -842,8 +842,8 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco ZVAL_LONG(&zvs[4], bytes_sofar); ZVAL_LONG(&zvs[5], bytes_max); - if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, zvs, 0, NULL TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier"); + if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, zvs, 0, NULL)) { + php_error_docref(NULL, E_WARNING, "failed to call user notifier"); } for (i = 0; i < 6; i++) { zval_ptr_dtor(&zvs[i]); @@ -859,7 +859,7 @@ static void user_space_stream_notifier_dtor(php_stream_notifier *notifier) } } -static int parse_context_options(php_stream_context *context, zval *options TSRMLS_DC) +static int parse_context_options(php_stream_context *context, zval *options) { zval *wval, *oval; zend_string *wkey, *okey; @@ -875,14 +875,14 @@ static int parse_context_options(php_stream_context *context, zval *options TSRM } ZEND_HASH_FOREACH_END(); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "options should have the form [\"wrappername\"][\"optionname\"] = $value"); + php_error_docref(NULL, E_WARNING, "options should have the form [\"wrappername\"][\"optionname\"] = $value"); } } ZEND_HASH_FOREACH_END(); return ret; } -static int parse_context_params(php_stream_context *context, zval *params TSRMLS_DC) +static int parse_context_params(php_stream_context *context, zval *params) { int ret = SUCCESS; zval *tmp; @@ -901,9 +901,9 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS } if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(params), "options", sizeof("options")-1))) { if (Z_TYPE_P(tmp) == IS_ARRAY) { - parse_context_options(context, tmp TSRMLS_CC); + parse_context_options(context, tmp); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter"); + php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter"); } } @@ -913,15 +913,15 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS /* given a zval which is either a stream or a context, return the underlying * stream_context. If it is a stream that does not have a context assigned, it * will create and assign a context and return that. */ -static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC) +static php_stream_context *decode_context_param(zval *contextresource) { php_stream_context *context = NULL; - context = zend_fetch_resource(contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context(TSRMLS_C)); + context = zend_fetch_resource(contextresource, -1, NULL, NULL, 1, php_le_stream_context()); if (context == NULL) { php_stream *stream; - stream = zend_fetch_resource(contextresource TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream); + stream = zend_fetch_resource(contextresource, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream); if (stream) { context = PHP_STREAM_CONTEXT(stream); @@ -930,7 +930,7 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC) param, but then something is called which requires a context. Don't give them the default one though since they already said they didn't want it. */ - context = php_stream_context_alloc(TSRMLS_C); + context = php_stream_context_alloc(); stream->ctx = context->res; } } @@ -947,12 +947,12 @@ PHP_FUNCTION(stream_context_get_options) zval *zcontext; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) { RETURN_FALSE; } - context = decode_context_param(zcontext TSRMLS_CC); + context = decode_context_param(zcontext); if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter"); + php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter"); RETURN_FALSE; } @@ -969,26 +969,26 @@ PHP_FUNCTION(stream_context_set_option) char *wrappername, *optionname; size_t wrapperlen, optionlen; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rssz", &zcontext, &wrappername, &wrapperlen, &optionname, &optionlen, &zvalue) == FAILURE) { - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "ra", &zcontext, &options) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "called with wrong number or type of parameters; please RTM"); + php_error_docref(NULL, E_WARNING, "called with wrong number or type of parameters; please RTM"); RETURN_FALSE; } } /* figure out where the context is coming from exactly */ - context = decode_context_param(zcontext TSRMLS_CC); + context = decode_context_param(zcontext); if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter"); + php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter"); RETURN_FALSE; } if (options) { /* handle the array syntax */ - RETVAL_BOOL(parse_context_options(context, options TSRMLS_CC) == SUCCESS); + RETVAL_BOOL(parse_context_options(context, options) == SUCCESS); } else { php_stream_context_set_option(context, wrappername, optionname, zvalue); RETVAL_TRUE; @@ -1003,17 +1003,17 @@ PHP_FUNCTION(stream_context_set_params) zval *params, *zcontext; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &zcontext, ¶ms) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &zcontext, ¶ms) == FAILURE) { RETURN_FALSE; } - context = decode_context_param(zcontext TSRMLS_CC); + context = decode_context_param(zcontext); if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter"); + php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter"); RETURN_FALSE; } - RETVAL_BOOL(parse_context_params(context, params TSRMLS_CC) == SUCCESS); + RETVAL_BOOL(parse_context_params(context, params) == SUCCESS); } /* }}} */ @@ -1024,13 +1024,13 @@ PHP_FUNCTION(stream_context_get_params) zval *zcontext, options; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) { RETURN_FALSE; } - context = decode_context_param(zcontext TSRMLS_CC); + context = decode_context_param(zcontext); if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter"); + php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter"); RETURN_FALSE; } @@ -1051,17 +1051,17 @@ PHP_FUNCTION(stream_context_get_default) zval *params = NULL; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", ¶ms) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a", ¶ms) == FAILURE) { RETURN_FALSE; } if (FG(default_context) == NULL) { - FG(default_context) = php_stream_context_alloc(TSRMLS_C); + FG(default_context) = php_stream_context_alloc(); } context = FG(default_context); if (params) { - parse_context_options(context, params TSRMLS_CC); + parse_context_options(context, params); } php_stream_context_to_zval(context, return_value); @@ -1075,16 +1075,16 @@ PHP_FUNCTION(stream_context_set_default) zval *options = NULL; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &options) == FAILURE) { return; } if (FG(default_context) == NULL) { - FG(default_context) = php_stream_context_alloc(TSRMLS_C); + FG(default_context) = php_stream_context_alloc(); } context = FG(default_context); - parse_context_options(context, options TSRMLS_CC); + parse_context_options(context, options); php_stream_context_to_zval(context, return_value); } @@ -1097,18 +1097,18 @@ PHP_FUNCTION(stream_context_create) zval *options = NULL, *params = NULL; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &options, ¶ms) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a!a!", &options, ¶ms) == FAILURE) { RETURN_FALSE; } - context = php_stream_context_alloc(TSRMLS_C); + context = php_stream_context_alloc(); if (options) { - parse_context_options(context, options TSRMLS_CC); + parse_context_options(context, options); } if (params) { - parse_context_params(context, params TSRMLS_CC); + parse_context_params(context, params); } RETURN_RES(context->res); @@ -1127,7 +1127,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS) php_stream_filter *filter = NULL; int ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz", &zstream, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|lz", &zstream, &filtername, &filternamelen, &read_write, &filterparams) == FAILURE) { RETURN_FALSE; } @@ -1149,35 +1149,35 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS) } if (read_write & PHP_STREAM_FILTER_READ) { - filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC); + filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); if (filter == NULL) { RETURN_FALSE; } if (append) { - ret = php_stream_filter_append_ex(&stream->readfilters, filter TSRMLS_CC); + ret = php_stream_filter_append_ex(&stream->readfilters, filter); } else { - ret = php_stream_filter_prepend_ex(&stream->readfilters, filter TSRMLS_CC); + ret = php_stream_filter_prepend_ex(&stream->readfilters, filter); } if (ret != SUCCESS) { - php_stream_filter_remove(filter, 1 TSRMLS_CC); + php_stream_filter_remove(filter, 1); RETURN_FALSE; } } if (read_write & PHP_STREAM_FILTER_WRITE) { - filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC); + filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); if (filter == NULL) { RETURN_FALSE; } if (append) { - ret = php_stream_filter_append_ex(&stream->writefilters, filter TSRMLS_CC); + ret = php_stream_filter_append_ex(&stream->writefilters, filter); } else { - ret = php_stream_filter_prepend_ex(&stream->writefilters, filter TSRMLS_CC); + ret = php_stream_filter_prepend_ex(&stream->writefilters, filter); } if (ret != SUCCESS) { - php_stream_filter_remove(filter, 1 TSRMLS_CC); + php_stream_filter_remove(filter, 1); RETURN_FALSE; } } @@ -1215,26 +1215,26 @@ PHP_FUNCTION(stream_filter_remove) zval *zfilter; php_stream_filter *filter; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfilter) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zfilter) == FAILURE) { RETURN_FALSE; } - filter = zend_fetch_resource(zfilter TSRMLS_CC, -1, NULL, NULL, 1, php_file_le_stream_filter()); + filter = zend_fetch_resource(zfilter, -1, NULL, NULL, 1, php_file_le_stream_filter()); if (!filter) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid resource given, not a stream filter"); + php_error_docref(NULL, E_WARNING, "Invalid resource given, not a stream filter"); RETURN_FALSE; } if (php_stream_filter_flush(filter, 1) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to flush filter, not removing"); + php_error_docref(NULL, E_WARNING, "Unable to flush filter, not removing"); RETURN_FALSE; } if (zend_list_close(Z_RES_P(zfilter)) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not invalidate filter, not removing"); + php_error_docref(NULL, E_WARNING, "Could not invalidate filter, not removing"); RETURN_FALSE; } else { - php_stream_filter_remove(filter, 1 TSRMLS_CC); + php_stream_filter_remove(filter, 1); RETURN_TRUE; } } @@ -1251,12 +1251,12 @@ PHP_FUNCTION(stream_get_line) zend_string *buf; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) { RETURN_FALSE; } if (max_length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The maximum allowed length must be greater than or equal to zero"); + php_error_docref(NULL, E_WARNING, "The maximum allowed length must be greater than or equal to zero"); RETURN_FALSE; } if (!max_length) { @@ -1265,7 +1265,7 @@ PHP_FUNCTION(stream_get_line) php_stream_from_zval(stream, zstream); - if ((buf = php_stream_get_record(stream, max_length, str, str_len TSRMLS_CC))) { + if ((buf = php_stream_get_record(stream, max_length, str, str_len))) { RETURN_STR(buf); } else { RETURN_FALSE; @@ -1282,7 +1282,7 @@ PHP_FUNCTION(stream_set_blocking) zend_long block; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &block) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &block) == FAILURE) { return; } @@ -1308,7 +1308,7 @@ PHP_FUNCTION(stream_set_timeout) php_stream *stream; int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &socket, &seconds, µseconds) == FAILURE) { + if (zend_parse_parameters(argc, "rl|l", &socket, &seconds, µseconds) == FAILURE) { return; } @@ -1353,7 +1353,7 @@ PHP_FUNCTION(stream_set_write_buffer) size_t buff; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &arg2) == FAILURE) { RETURN_FALSE; } @@ -1381,12 +1381,12 @@ PHP_FUNCTION(stream_set_chunk_size) zval *zstream; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &csize) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &csize) == FAILURE) { RETURN_FALSE; } if (csize <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize); + php_error_docref(NULL, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize); RETURN_FALSE; } /* stream.chunk_size is actually a size_t, but php_stream_set_option @@ -1394,7 +1394,7 @@ PHP_FUNCTION(stream_set_chunk_size) * In any case, values larger than INT_MAX for a chunk size make no sense. */ if (csize > INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size cannot be larger than %d", INT_MAX); + php_error_docref(NULL, E_WARNING, "The chunk size cannot be larger than %d", INT_MAX); RETURN_FALSE; } @@ -1416,7 +1416,7 @@ PHP_FUNCTION(stream_set_read_buffer) size_t buff; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &arg2) == FAILURE) { RETURN_FALSE; } @@ -1445,7 +1445,7 @@ PHP_FUNCTION(stream_socket_enable_crypto) zend_bool enable, cryptokindnull; int ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) { RETURN_FALSE; } @@ -1456,7 +1456,7 @@ PHP_FUNCTION(stream_socket_enable_crypto) zval *val; if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "When enabling encryption you must specify the crypto type"); + php_error_docref(NULL, E_WARNING, "When enabling encryption you must specify the crypto type"); RETURN_FALSE; } @@ -1467,12 +1467,12 @@ PHP_FUNCTION(stream_socket_enable_crypto) php_stream_from_zval(sessstream, zsessstream); } - if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) { + if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) { RETURN_FALSE; } } - ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC); + ret = php_stream_xport_crypto_enable(stream, enable); switch (ret) { case -1: RETURN_FALSE; @@ -1493,11 +1493,11 @@ PHP_FUNCTION(stream_resolve_include_path) char *filename, *resolved_path; size_t filename_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) { return; } - resolved_path = zend_resolve_path(filename, (int)filename_len TSRMLS_CC); + resolved_path = zend_resolve_path(filename, (int)filename_len); if (resolved_path) { // TODO: avoid reallocation ??? @@ -1517,7 +1517,7 @@ PHP_FUNCTION(stream_is_local) php_stream *stream = NULL; php_stream_wrapper *wrapper = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zstream) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zstream) == FAILURE) { RETURN_FALSE; } @@ -1530,7 +1530,7 @@ PHP_FUNCTION(stream_is_local) } else { convert_to_string_ex(zstream); - wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), NULL, 0); } if (!wrapper) { @@ -1548,7 +1548,7 @@ PHP_FUNCTION(stream_supports_lock) php_stream *stream; zval *zsrc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zsrc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zsrc) == FAILURE) { RETURN_FALSE; } @@ -1574,7 +1574,7 @@ PHP_FUNCTION(stream_socket_shutdown) zval *zstream; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &how) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &how) == FAILURE) { RETURN_FALSE; } @@ -1586,7 +1586,7 @@ PHP_FUNCTION(stream_socket_shutdown) php_stream_from_zval(stream, zstream); - RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how TSRMLS_CC) == 0); + RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0); } /* }}} */ #endif diff --git a/ext/standard/string.c b/ext/standard/string.c index ec86b08d3c..c686cdd56a 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -249,7 +249,7 @@ PHP_FUNCTION(bin2hex) zend_string *result; zend_string *data; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &data) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &data) == FAILURE) { return; } @@ -269,19 +269,19 @@ PHP_FUNCTION(hex2bin) { zend_string *result, *data; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &data) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &data) == FAILURE) { return; } if (data->len % 2 != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hexadecimal input string must have an even length"); + php_error_docref(NULL, E_WARNING, "Hexadecimal input string must have an even length"); RETURN_FALSE; } result = php_hex2bin((unsigned char *)data->val, data->len); if (!result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input string must be hexadecimal string"); + php_error_docref(NULL, E_WARNING, "Input string must be hexadecimal string"); RETURN_FALSE; } @@ -294,7 +294,7 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) / zend_string *s11, *s22; zend_long start = 0, len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", &s11, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ll", &s11, &s22, &start, &len) == FAILURE) { return; } @@ -537,7 +537,7 @@ PHP_FUNCTION(nl_langinfo) zend_long item; char *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &item) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &item) == FAILURE) { return; } @@ -702,7 +702,7 @@ PHP_FUNCTION(nl_langinfo) #endif break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Item '" ZEND_LONG_FMT "' is not valid", item); + php_error_docref(NULL, E_WARNING, "Item '" ZEND_LONG_FMT "' is not valid", item); RETURN_FALSE; } /* }}} */ @@ -724,7 +724,7 @@ PHP_FUNCTION(strcoll) { zend_string *s1, *s2; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) { return; } @@ -739,7 +739,7 @@ PHP_FUNCTION(strcoll) * it needs to be incrementing. * Returns: FAILURE/SUCCESS whether the input was correct (i.e. no range errors) */ -static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRMLS_DC) +static inline int php_charmask(unsigned char *input, size_t len, char *mask) { unsigned char *end; unsigned char c; @@ -756,22 +756,22 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM /* Error, try to be as helpful as possible: (a range ending/starting with '.' won't be captured here) */ if (end-len >= input) { /* there was no 'left' char */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the left of '..'"); + php_error_docref(NULL, E_WARNING, "Invalid '..'-range, no character to the left of '..'"); result = FAILURE; continue; } if (input+2 >= end) { /* there is no 'right' char */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the right of '..'"); + php_error_docref(NULL, E_WARNING, "Invalid '..'-range, no character to the right of '..'"); result = FAILURE; continue; } if (input[-1] > input[2]) { /* wrong order */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing"); + php_error_docref(NULL, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing"); result = FAILURE; continue; } /* FIXME: better error (a..b..c is the only left possibility?) */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range"); + php_error_docref(NULL, E_WARNING, "Invalid '..'-range"); result = FAILURE; continue; } else { @@ -788,16 +788,16 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM * mode 3 : trim left and right * what indicates which chars are to be trimmed. NULL->default (' \t\n\r\v\0') */ -PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC) +PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode) { register size_t i; size_t trimmed = 0; char mask[256]; if (what) { - php_charmask((unsigned char*)what, what_len, mask TSRMLS_CC); + php_charmask((unsigned char*)what, what_len, mask); } else { - php_charmask((unsigned char*)" \n\r\t\v\0", 6, mask TSRMLS_CC); + php_charmask((unsigned char*)" \n\r\t\v\0", 6, mask); } if (mode & 1) { @@ -842,7 +842,7 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode) zend_string *what = NULL; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &str, &what) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &what) == FAILURE) { return; } #else @@ -853,7 +853,7 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode) ZEND_PARSE_PARAMETERS_END(); #endif - php_trim(str->val, str->len, (what ? what->val : NULL), (what ? what->len : 0), return_value, mode TSRMLS_CC); + php_trim(str->val, str->len, (what ? what->val : NULL), (what ? what->len : 0), return_value, mode); } /* }}} */ @@ -894,7 +894,7 @@ PHP_FUNCTION(wordwrap) zend_bool docut = 0; zend_string *newtext; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lsb", &text, &linelength, &breakchar, &breakchar_len, &docut) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lsb", &text, &linelength, &breakchar, &breakchar_len, &docut) == FAILURE) { return; } @@ -903,12 +903,12 @@ PHP_FUNCTION(wordwrap) } if (breakchar_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Break string cannot be empty"); + php_error_docref(NULL, E_WARNING, "Break string cannot be empty"); RETURN_FALSE; } if (linelength == 0 && docut) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero"); + php_error_docref(NULL, E_WARNING, "Can't force cut when width is zero"); RETURN_FALSE; } @@ -1094,7 +1094,7 @@ PHP_FUNCTION(explode) zend_long limit = ZEND_LONG_MAX; /* No limit */ #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", &delim, &str, &limit) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|l", &delim, &str, &limit) == FAILURE) { return; } #else @@ -1107,7 +1107,7 @@ PHP_FUNCTION(explode) #endif if (delim->len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter"); + php_error_docref(NULL, E_WARNING, "Empty delimiter"); RETURN_FALSE; } @@ -1136,7 +1136,7 @@ PHP_FUNCTION(explode) /* {{{ php_implode */ -PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC) +PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value) { zval *tmp; smart_str implstr = {0}; @@ -1212,7 +1212,7 @@ PHP_FUNCTION(implode) zend_string *delim; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &arg1, &arg2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|z", &arg1, &arg2) == FAILURE) { return; } #else @@ -1225,7 +1225,7 @@ PHP_FUNCTION(implode) if (arg2 == NULL) { if (Z_TYPE_P(arg1) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument must be an array"); + php_error_docref(NULL, E_WARNING, "Argument must be an array"); return; } @@ -1239,12 +1239,12 @@ PHP_FUNCTION(implode) delim = zval_get_string(arg1); arr = arg2; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments passed"); + php_error_docref(NULL, E_WARNING, "Invalid arguments passed"); return; } } - php_implode(delim, arr, return_value TSRMLS_CC); + php_implode(delim, arr, return_value); zend_string_release(delim); } /* }}} */ @@ -1262,7 +1262,7 @@ PHP_FUNCTION(strtok) char *pe; size_t skipped = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &str, &tok) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &tok) == FAILURE) { return; } @@ -1350,7 +1350,7 @@ PHP_FUNCTION(strtoupper) zend_string *arg; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) { return; } @@ -1385,7 +1385,7 @@ PHP_FUNCTION(strtolower) zend_string *result; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { return; } #else @@ -1402,7 +1402,7 @@ PHP_FUNCTION(strtolower) /* {{{ php_basename */ -PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen TSRMLS_DC) +PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen) { char *c, *comp, *cend; size_t inc_len, cnt; @@ -1487,11 +1487,11 @@ PHP_FUNCTION(basename) char *string, *suffix = NULL; size_t string_len, suffix_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) { return; } - RETURN_STR(php_basename(string, string_len, suffix, suffix_len TSRMLS_CC)); + RETURN_STR(php_basename(string, string_len, suffix, suffix_len)); } /* }}} */ @@ -1511,7 +1511,7 @@ PHP_FUNCTION(dirname) zend_string *ret; size_t str_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { return; } @@ -1533,7 +1533,7 @@ PHP_FUNCTION(pathinfo) zend_long opt = PHP_PATHINFO_ALL; zend_string *ret = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &path_len, &opt) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &path, &path_len, &opt) == FAILURE) { return; } @@ -1551,7 +1551,7 @@ PHP_FUNCTION(pathinfo) } if (have_basename) { - ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC); + ret = php_basename(path, path_len, NULL, 0); add_assoc_str(&tmp, "basename", zend_string_copy(ret)); } @@ -1560,7 +1560,7 @@ PHP_FUNCTION(pathinfo) ptrdiff_t idx; if (!have_basename) { - ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC); + ret = php_basename(path, path_len, NULL, 0); } p = zend_memrchr(ret->val, '.', ret->len); @@ -1577,7 +1577,7 @@ PHP_FUNCTION(pathinfo) /* Have we already looked up the basename? */ if (!have_basename && !ret) { - ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC); + ret = php_basename(path, path_len, NULL, 0); } p = zend_memrchr(ret->val, '.', ret->len); @@ -1655,7 +1655,7 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end) /* {{{ php_needle_char */ -static int php_needle_char(zval *needle, char *target TSRMLS_DC) +static int php_needle_char(zval *needle, char *target) { switch (Z_TYPE_P(needle)) { case IS_LONG: @@ -1675,7 +1675,7 @@ static int php_needle_char(zval *needle, char *target TSRMLS_DC) *target = (char) zval_get_long(needle); return SUCCESS; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is not a string or an integer"); + php_error_docref(NULL, E_WARNING, "needle is not a string or an integer"); return FAILURE; } } @@ -1693,7 +1693,7 @@ PHP_FUNCTION(stristr) char needle_char[2]; zend_bool part = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &haystack, &needle, &part) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &haystack, &needle, &part) == FAILURE) { return; } @@ -1702,7 +1702,7 @@ PHP_FUNCTION(stristr) if (Z_TYPE_P(needle) == IS_STRING) { char *orig_needle; if (!Z_STRLEN_P(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle"); + php_error_docref(NULL, E_WARNING, "Empty needle"); efree(haystack_dup); RETURN_FALSE; } @@ -1710,7 +1710,7 @@ PHP_FUNCTION(stristr) found = php_stristr(haystack_dup, orig_needle, haystack->len, Z_STRLEN_P(needle)); efree(orig_needle); } else { - if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) { + if (php_needle_char(needle, needle_char) != SUCCESS) { efree(haystack_dup); RETURN_FALSE; } @@ -1745,19 +1745,19 @@ PHP_FUNCTION(strstr) zend_long found_offset; zend_bool part = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &haystack, &needle, &part) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &haystack, &needle, &part) == FAILURE) { return; } if (Z_TYPE_P(needle) == IS_STRING) { if (!Z_STRLEN_P(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle"); + php_error_docref(NULL, E_WARNING, "Empty needle"); RETURN_FALSE; } found = (char*)php_memnstr(haystack->val, Z_STRVAL_P(needle), Z_STRLEN_P(needle), haystack->val + haystack->len); } else { - if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) { + if (php_needle_char(needle, needle_char) != SUCCESS) { RETURN_FALSE; } needle_char[1] = 0; @@ -1792,7 +1792,7 @@ PHP_FUNCTION(strpos) zend_long offset = 0; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &needle, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &needle, &offset) == FAILURE) { return; } #else @@ -1805,13 +1805,13 @@ PHP_FUNCTION(strpos) #endif if (offset < 0 || (size_t)offset > haystack->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string"); + php_error_docref(NULL, E_WARNING, "Offset not contained in string"); RETURN_FALSE; } if (Z_TYPE_P(needle) == IS_STRING) { if (!Z_STRLEN_P(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle"); + php_error_docref(NULL, E_WARNING, "Empty needle"); RETURN_FALSE; } @@ -1820,7 +1820,7 @@ PHP_FUNCTION(strpos) Z_STRLEN_P(needle), haystack->val + haystack->len); } else { - if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) { + if (php_needle_char(needle, needle_char) != SUCCESS) { RETURN_FALSE; } needle_char[1] = 0; @@ -1850,12 +1850,12 @@ PHP_FUNCTION(stripos) char needle_char[2]; zval *needle; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &needle, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &needle, &offset) == FAILURE) { return; } if (offset < 0 || (size_t)offset > haystack->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string"); + php_error_docref(NULL, E_WARNING, "Offset not contained in string"); RETURN_FALSE; } @@ -1876,7 +1876,7 @@ PHP_FUNCTION(stripos) php_strtolower(needle_dup, Z_STRLEN_P(needle)); found = (char*)php_memnstr(haystack_dup + offset, needle_dup, Z_STRLEN_P(needle), haystack_dup + haystack->len); } else { - if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) { + if (php_needle_char(needle, needle_char) != SUCCESS) { efree(haystack_dup); RETURN_FALSE; } @@ -1913,7 +1913,7 @@ PHP_FUNCTION(strrpos) char *p, *e, ord_needle[2]; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &zneedle, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &zneedle, &offset) == FAILURE) { RETURN_FALSE; } #else @@ -1929,7 +1929,7 @@ PHP_FUNCTION(strrpos) needle = Z_STRVAL_P(zneedle); needle_len = Z_STRLEN_P(zneedle); } else { - if (php_needle_char(zneedle, ord_needle TSRMLS_CC) != SUCCESS) { + if (php_needle_char(zneedle, ord_needle) != SUCCESS) { RETURN_FALSE; } ord_needle[1] = '\0'; @@ -1943,14 +1943,14 @@ PHP_FUNCTION(strrpos) if (offset >= 0) { if ((size_t)offset > haystack->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); + php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } p = haystack->val + (size_t)offset; e = haystack->val + haystack->len - needle_len; } else { if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); + php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } @@ -1996,7 +1996,7 @@ PHP_FUNCTION(strripos) char *p, *e, ord_needle[2]; char *needle_dup, *haystack_dup; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &zneedle, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &zneedle, &offset) == FAILURE) { RETURN_FALSE; } @@ -2004,7 +2004,7 @@ PHP_FUNCTION(strripos) needle = Z_STRVAL_P(zneedle); needle_len = Z_STRLEN_P(zneedle); } else { - if (php_needle_char(zneedle, ord_needle TSRMLS_CC) != SUCCESS) { + if (php_needle_char(zneedle, ord_needle) != SUCCESS) { RETURN_FALSE; } ord_needle[1] = '\0'; @@ -2021,7 +2021,7 @@ PHP_FUNCTION(strripos) Can also avoid tolower emallocs */ if (offset >= 0) { if ((size_t)offset > haystack->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); + php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } p = haystack->val + offset; @@ -2029,7 +2029,7 @@ PHP_FUNCTION(strripos) } else { p = haystack->val; if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); + php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } e = haystack->val + haystack->len + offset; @@ -2054,7 +2054,7 @@ PHP_FUNCTION(strripos) if ((size_t)offset > haystack->len) { efree(needle_dup); efree(haystack_dup); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); + php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } p = haystack_dup + offset; @@ -2063,7 +2063,7 @@ PHP_FUNCTION(strripos) if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) { efree(needle_dup); efree(haystack_dup); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); + php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } p = haystack_dup; @@ -2098,7 +2098,7 @@ PHP_FUNCTION(strrchr) const char *found = NULL; zend_long found_offset; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &haystack, &needle) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &haystack, &needle) == FAILURE) { return; } @@ -2106,7 +2106,7 @@ PHP_FUNCTION(strrchr) found = zend_memrchr(haystack->val, *Z_STRVAL_P(needle), haystack->len); } else { char needle_chr; - if (php_needle_char(needle, &needle_chr TSRMLS_CC) != SUCCESS) { + if (php_needle_char(needle, &needle_chr) != SUCCESS) { RETURN_FALSE; } @@ -2182,12 +2182,12 @@ PHP_FUNCTION(chunk_split) zend_long chunklen = 76; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls", &str, &chunklen, &end, &endlen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls", &str, &chunklen, &end, &endlen) == FAILURE) { return; } if (chunklen <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Chunk length should be greater than zero"); + php_error_docref(NULL, E_WARNING, "Chunk length should be greater than zero"); RETURN_FALSE; } @@ -2223,7 +2223,7 @@ PHP_FUNCTION(substr) int argc = ZEND_NUM_ARGS(); #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", &str, &f, &l) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l", &str, &f, &l) == FAILURE) { return; } #else @@ -2303,7 +2303,7 @@ PHP_FUNCTION(substr_replace) HashPosition pos_from, pos_repl, pos_len; zval *tmp_str = NULL, *tmp_from = NULL, *tmp_repl = NULL, *tmp_len= NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z/", &str, &repl, &from, &len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|z/", &str, &repl, &from, &len) == FAILURE) { return; } @@ -2332,12 +2332,12 @@ PHP_FUNCTION(substr_replace) (argc == 3 && Z_TYPE_P(from) == IS_ARRAY) || (argc == 4 && Z_TYPE_P(from) != Z_TYPE_P(len)) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should be of same type - numerical or array "); + php_error_docref(NULL, E_WARNING, "'from' and 'len' should be of same type - numerical or array "); RETURN_STR(zend_string_copy(Z_STR_P(str))); } if (argc == 4 && Z_TYPE_P(from) == IS_ARRAY) { if (zend_hash_num_elements(Z_ARRVAL_P(from)) != zend_hash_num_elements(Z_ARRVAL_P(len))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should have the same number of elements"); + php_error_docref(NULL, E_WARNING, "'from' and 'len' should have the same number of elements"); RETURN_STR(zend_string_copy(Z_STR_P(str))); } } @@ -2399,7 +2399,7 @@ PHP_FUNCTION(substr_replace) result->val[result->len] = '\0'; RETURN_NEW_STR(result); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented"); + php_error_docref(NULL, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented"); RETURN_STR(zend_string_copy(Z_STR_P(str))); } } else { /* str is array of strings */ @@ -2511,7 +2511,7 @@ PHP_FUNCTION(substr_replace) } /*??? if (Z_REFCOUNT_P(orig_str) != refcount) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument was modified while replacing"); + php_error_docref(NULL, E_WARNING, "Argument was modified while replacing"); if (Z_TYPE_P(tmp_repl) != IS_STRING) { zval_dtor(repl_str); } @@ -2576,7 +2576,7 @@ PHP_FUNCTION(quotemeta) char c; zend_string *str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &old) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &old) == FAILURE) { return; } @@ -2623,7 +2623,7 @@ PHP_FUNCTION(ord) size_t str_len; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { return; } #else @@ -2647,7 +2647,7 @@ PHP_FUNCTION(chr) WRONG_PARAM_COUNT; } - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "l", &c) == FAILURE) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "l", &c) == FAILURE) { c = 0; } @@ -2675,7 +2675,7 @@ PHP_FUNCTION(ucfirst) zend_string *str; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { return; } #else @@ -2709,7 +2709,7 @@ PHP_FUNCTION(lcfirst) { zend_string *str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { return; } @@ -2733,7 +2733,7 @@ PHP_FUNCTION(ucwords) char mask[256]; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|s", &str, &delims, &delims_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s", &str, &delims, &delims_len) == FAILURE) { return; } #else @@ -2748,7 +2748,7 @@ PHP_FUNCTION(ucwords) RETURN_EMPTY_STRING(); } - php_charmask((unsigned char *)delims, delims_len, mask TSRMLS_CC); + php_charmask((unsigned char *)delims, delims_len, mask); ZVAL_STRINGL(return_value, str->val, str->len); r = Z_STRVAL_P(return_value); @@ -2787,7 +2787,7 @@ PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size } /* }}} */ -static int php_strtr_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int php_strtr_key_compare(const void *a, const void *b) /* {{{ */ { Bucket *f = (Bucket *) a; Bucket *s = (Bucket *) b; @@ -2797,7 +2797,7 @@ static int php_strtr_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ /* }}} */ /* {{{ php_strtr_array */ -static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTable *pats TSRMLS_DC) +static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTable *pats) { zend_ulong num_key; zend_string *str_key; @@ -2887,7 +2887,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl len = zend_hash_num_elements(&num_hash); if ((maxlen - (minlen - 1) - len > 0) && /* smart algorithm, sort key lengths first */ - zend_hash_sort(&num_hash, zend_qsort, php_strtr_key_compare, 0 TSRMLS_CC) == SUCCESS) { + zend_hash_sort(&num_hash, zend_qsort, php_strtr_key_compare, 0) == SUCCESS) { pos = 0; while (pos <= slen - minlen) { @@ -2956,7 +2956,7 @@ PHP_FUNCTION(strtr) int ac = ZEND_NUM_ARGS(); #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|s", &str, &str_len, &from, &to, &to_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|s", &str, &str_len, &from, &to, &to_len) == FAILURE) { return; } #else @@ -2969,7 +2969,7 @@ PHP_FUNCTION(strtr) #endif if (ac == 2 && Z_TYPE_P(from) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument is not an array"); + php_error_docref(NULL, E_WARNING, "The second argument is not an array"); RETURN_FALSE; } @@ -2979,7 +2979,7 @@ PHP_FUNCTION(strtr) } if (ac == 2) { - php_strtr_array(return_value, str, str_len, HASH_OF(from) TSRMLS_CC); + php_strtr_array(return_value, str, str_len, HASH_OF(from)); } else { convert_to_string_ex(from); @@ -3003,7 +3003,7 @@ PHP_FUNCTION(strrev) char *e, *p; zend_string *n; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { return; } @@ -3077,7 +3077,7 @@ PHP_FUNCTION(similar_text) int ac = ZEND_NUM_ARGS(); size_t sim; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|z/", &t1, &t2, &percent) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|z/", &t1, &t2, &percent) == FAILURE) { return; } @@ -3106,7 +3106,7 @@ PHP_FUNCTION(similar_text) /* {{{ php_stripslashes * * be careful, this edits the string in-place */ -PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC) +PHPAPI void php_stripslashes(char *str, size_t *len) { char *s, *t; size_t l; @@ -3152,7 +3152,7 @@ PHP_FUNCTION(addcslashes) { zend_string *str, *what; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &str, &what) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &str, &what) == FAILURE) { return; } @@ -3164,7 +3164,7 @@ PHP_FUNCTION(addcslashes) RETURN_STRINGL(str->val, str->len); } - RETURN_STR(php_addcslashes(str->val, str->len, 0, what->val, what->len TSRMLS_CC)); + RETURN_STR(php_addcslashes(str->val, str->len, 0, what->val, what->len)); } /* }}} */ @@ -3175,7 +3175,7 @@ PHP_FUNCTION(addslashes) zend_string *str; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { return; } #else @@ -3188,7 +3188,7 @@ PHP_FUNCTION(addslashes) RETURN_EMPTY_STRING(); } - RETURN_STR(php_addslashes(str->val, str->len, 0 TSRMLS_CC)); + RETURN_STR(php_addslashes(str->val, str->len, 0)); } /* }}} */ @@ -3198,7 +3198,7 @@ PHP_FUNCTION(stripcslashes) { zend_string *str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { return; } @@ -3213,12 +3213,12 @@ PHP_FUNCTION(stripslashes) { zend_string *str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { return; } ZVAL_STRINGL(return_value, str->val, str->len); - php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC); + php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value)); } /* }}} */ @@ -3229,7 +3229,6 @@ char *php_strerror(int errnum) { extern int sys_nerr; extern char *sys_errlist[]; - TSRMLS_FETCH(); if ((unsigned int) errnum < sys_nerr) { return(sys_errlist[errnum]); @@ -3306,7 +3305,7 @@ PHPAPI void php_stripcslashes(char *str, size_t *len) /* {{{ php_addcslashes */ -PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_free, char *what, size_t wlength TSRMLS_DC) +PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_free, char *what, size_t wlength) { char flags[256]; char *source, *target; @@ -3319,7 +3318,7 @@ PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_f wlength = strlen(what); } - php_charmask((unsigned char *)what, wlength, flags TSRMLS_CC); + php_charmask((unsigned char *)what, wlength, flags); for (source = (char*)str, end = source + length, target = new_str->val; source < end; source++) { c = *source; @@ -3356,7 +3355,7 @@ PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_f /* {{{ php_addslashes */ -PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC) +PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free) { /* maximum string length, worst case situation */ char *source, *target; @@ -3663,7 +3662,7 @@ PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle, /* {{{ php_str_replace_in_subject */ -static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, size_t *replace_count TSRMLS_DC) +static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, size_t *replace_count) { zval *search_entry, *replace_entry = NULL, @@ -3792,7 +3791,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit int argc = ZEND_NUM_ARGS(); #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z/", &search, &replace, &subject, &zcount) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|z/", &search, &replace, &subject, &zcount) == FAILURE) { return; } #else @@ -3826,7 +3825,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit and add the result to the return_value array. */ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(subject), num_key, string_key, subject_entry) { if (Z_TYPE_P(subject_entry) != IS_ARRAY && Z_TYPE_P(subject_entry) != IS_OBJECT) { - php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC); + php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL); } else { ZVAL_COPY(&result, subject_entry); } @@ -3838,7 +3837,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit } } ZEND_HASH_FOREACH_END(); } else { /* if subject is not an array */ - php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC); + php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL); } if (argc > 3) { zval_dtor(zcount); @@ -3878,7 +3877,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines) size_t str_len; zend_string *broken_str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &max_chars) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &max_chars) == FAILURE) { return; } @@ -4063,7 +4062,7 @@ PHP_FUNCTION(nl2br) zend_bool is_xhtml = 1; zend_string *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &str, &is_xhtml) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &str, &is_xhtml) == FAILURE) { return; } @@ -4142,7 +4141,7 @@ PHP_FUNCTION(strip_tags) char *allowed_tags=NULL; size_t allowed_tags_len=0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|z", &str, &allow) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|z", &str, &allow) == FAILURE) { return; } @@ -4180,7 +4179,7 @@ PHP_FUNCTION(setlocale) char *loc, *retval; HashPosition pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z+", &pcategory, &args, &num_args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z+", &pcategory, &args, &num_args) == FAILURE) { return; } @@ -4192,7 +4191,7 @@ PHP_FUNCTION(setlocale) char *category; zval tmp; - php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "Passing locale category name as string is deprecated. Use the LC_* -constants instead"); + php_error_docref(NULL, E_DEPRECATED, "Passing locale category name as string is deprecated. Use the LC_* -constants instead"); ZVAL_DUP(&tmp, pcategory); convert_to_string_ex(&tmp); @@ -4215,7 +4214,7 @@ PHP_FUNCTION(setlocale) } else if (!strcasecmp("LC_TIME", category)) { cat = LC_TIME; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME", category); + php_error_docref(NULL, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME", category); zval_dtor(&tmp); RETURN_FALSE; @@ -4248,7 +4247,7 @@ PHP_FUNCTION(setlocale) } else { loc = Z_STRVAL(tmp); if (Z_STRLEN(tmp) >= 255) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Specified locale name is too long"); + php_error_docref(NULL, E_WARNING, "Specified locale name is too long"); zval_dtor(&tmp); break; } @@ -4292,7 +4291,7 @@ PHP_FUNCTION(parse_str) char *res = NULL; size_t arglen; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &arg, &arglen, &arrayArg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &arg, &arglen, &arrayArg) == FAILURE) { return; } @@ -4300,17 +4299,17 @@ PHP_FUNCTION(parse_str) if (arrayArg == NULL) { zval tmp; - zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C); + zend_array *symbol_table = zend_rebuild_symbol_table(); ZVAL_ARR(&tmp, symbol_table); - sapi_module.treat_data(PARSE_STRING, res, &tmp TSRMLS_CC); + sapi_module.treat_data(PARSE_STRING, res, &tmp); } else { zval ret; /* Clear out the array that was passed in. */ zval_dtor(arrayArg); array_init(&ret); - sapi_module.treat_data(PARSE_STRING, res, &ret TSRMLS_CC); + sapi_module.treat_data(PARSE_STRING, res, &ret); ZVAL_COPY_VALUE(arrayArg, &ret); } } @@ -4692,7 +4691,7 @@ PHP_FUNCTION(str_getcsv) char *delim_str = NULL, *enc_str = NULL, *esc_str = NULL; size_t delim_len = 0, enc_len = 0, esc_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|sss", &str, &delim_str, &delim_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|sss", &str, &delim_str, &delim_len, &enc_str, &enc_len, &esc_str, &esc_len) == FAILURE) { return; } @@ -4701,7 +4700,7 @@ PHP_FUNCTION(str_getcsv) enc = enc_len ? enc_str[0] : enc; esc = esc_len ? esc_str[0] : esc; - php_fgetcsv(NULL, delim, enc, esc, str->len, str->val, return_value TSRMLS_CC); + php_fgetcsv(NULL, delim, enc, esc, str->len, str->val, return_value); } /* }}} */ @@ -4714,12 +4713,12 @@ PHP_FUNCTION(str_repeat) zend_string *result; /* Resulting string */ size_t result_len; /* Length of the resulting string */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl", &input_str, &mult) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl", &input_str, &mult) == FAILURE) { return; } if (mult < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be greater than or equal to 0"); + php_error_docref(NULL, E_WARNING, "Second argument has to be greater than or equal to 0"); return; } @@ -4769,12 +4768,12 @@ PHP_FUNCTION(count_chars) size_t retlen=0; size_t tmp = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &input, &mymode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &input, &mymode) == FAILURE) { return; } if (mymode < 0 || mymode > 4) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown mode"); + php_error_docref(NULL, E_WARNING, "Unknown mode"); RETURN_FALSE; } @@ -4831,7 +4830,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case) { zend_string *s1, *s2; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) { return; } @@ -4841,7 +4840,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case) } /* }}} */ -PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */ +PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive) /* {{{ */ { zend_string *str1 = zval_get_string(op1); zend_string *str2 = zval_get_string(op2); @@ -4854,15 +4853,15 @@ PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2 } /* }}} */ -PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ +PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ { - return string_natural_compare_function_ex(result, op1, op2, 1 TSRMLS_CC); + return string_natural_compare_function_ex(result, op1, op2, 1); } /* }}} */ -PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ +PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ { - return string_natural_compare_function_ex(result, op1, op2, 0 TSRMLS_CC); + return string_natural_compare_function_ex(result, op1, op2, 0); } /* }}} */ @@ -4976,12 +4975,12 @@ PHP_FUNCTION(substr_count) size_t haystack_len, needle_len; char *p, *endp, cmp; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &haystack, &haystack_len, &needle, &needle_len, &offset, &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ll", &haystack, &haystack_len, &needle, &needle_len, &offset, &length) == FAILURE) { return; } if (needle_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty substring"); + php_error_docref(NULL, E_WARNING, "Empty substring"); RETURN_FALSE; } @@ -4989,12 +4988,12 @@ PHP_FUNCTION(substr_count) endp = p + haystack_len; if (offset < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset should be greater than or equal to 0"); + php_error_docref(NULL, E_WARNING, "Offset should be greater than or equal to 0"); RETURN_FALSE; } if ((size_t)offset > haystack_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset); + php_error_docref(NULL, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset); RETURN_FALSE; } p += offset; @@ -5002,11 +5001,11 @@ PHP_FUNCTION(substr_count) if (ac == 4) { if (length <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length should be greater than 0"); + php_error_docref(NULL, E_WARNING, "Length should be greater than 0"); RETURN_FALSE; } if (length > (haystack_len - offset)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value " ZEND_LONG_FMT " exceeds string length", length); + php_error_docref(NULL, E_WARNING, "Length value " ZEND_LONG_FMT " exceeds string length", length); RETURN_FALSE; } endp = p + length; @@ -5046,7 +5045,7 @@ PHP_FUNCTION(str_pad) size_t i, left_pad=0, right_pad=0; zend_string *result = NULL; /* Resulting string */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|sl", &input, &pad_length, &pad_str, &pad_str_len, &pad_type_val) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|sl", &input, &pad_length, &pad_str, &pad_str_len, &pad_type_val) == FAILURE) { return; } @@ -5057,18 +5056,18 @@ PHP_FUNCTION(str_pad) } if (pad_str_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding string cannot be empty"); + php_error_docref(NULL, E_WARNING, "Padding string cannot be empty"); return; } if (pad_type_val < STR_PAD_LEFT || pad_type_val > STR_PAD_BOTH) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH"); + php_error_docref(NULL, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH"); return; } num_pad_chars = pad_length - input->len; if (num_pad_chars >= INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding length is too long"); + php_error_docref(NULL, E_WARNING, "Padding length is too long"); return; } @@ -5120,12 +5119,12 @@ PHP_FUNCTION(sscanf) size_t str_len, format_len; int result, num_args = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss*", &str, &str_len, &format, &format_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss*", &str, &str_len, &format, &format_len, &args, &num_args) == FAILURE) { return; } - result = php_sscanf_internal(str, format, num_args, args, 0, return_value TSRMLS_CC); + result = php_sscanf_internal(str, format, num_args, args, 0, return_value); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { WRONG_PARAM_COUNT; @@ -5142,7 +5141,7 @@ PHP_FUNCTION(str_rot13) { zend_string *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) { return; } @@ -5152,7 +5151,7 @@ PHP_FUNCTION(str_rot13) } /* }}} */ -static void php_string_shuffle(char *str, zend_long len TSRMLS_DC) /* {{{ */ +static void php_string_shuffle(char *str, zend_long len) /* {{{ */ { zend_long n_elems, rnd_idx, n_left; char temp; @@ -5167,7 +5166,7 @@ static void php_string_shuffle(char *str, zend_long len TSRMLS_DC) /* {{{ */ n_left = n_elems; while (--n_left) { - rnd_idx = php_rand(TSRMLS_C); + rnd_idx = php_rand(); RAND_RANGE(rnd_idx, 0, n_left, PHP_RAND_MAX); if (rnd_idx != n_left) { temp = str[n_left]; @@ -5184,13 +5183,13 @@ PHP_FUNCTION(str_shuffle) { zend_string *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) { return; } RETVAL_STRINGL(arg->val, arg->len); if (Z_STRLEN_P(return_value) > 1) { - php_string_shuffle(Z_STRVAL_P(return_value), (zend_long) Z_STRLEN_P(return_value) TSRMLS_CC); + php_string_shuffle(Z_STRVAL_P(return_value), (zend_long) Z_STRLEN_P(return_value)); } } /* }}} */ @@ -5213,7 +5212,7 @@ PHP_FUNCTION(str_word_count) size_t char_list_len = 0, word_count = 0; zend_long type = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls", &str, &type, &char_list, &char_list_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls", &str, &type, &char_list, &char_list_len) == FAILURE) { return; } @@ -5232,12 +5231,12 @@ PHP_FUNCTION(str_word_count) /* nothing to be done */ break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format value " ZEND_LONG_FMT, type); + php_error_docref(NULL, E_WARNING, "Invalid format value " ZEND_LONG_FMT, type); RETURN_FALSE; } if (char_list) { - php_charmask((unsigned char *)char_list, char_list_len, ch TSRMLS_CC); + php_charmask((unsigned char *)char_list, char_list_len, ch); } p = str->val; @@ -5292,7 +5291,7 @@ PHP_FUNCTION(money_format) zend_bool check = 0; zend_string *str; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sd", &format, &format_len, &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sd", &format, &format_len, &value) == FAILURE) { return; } @@ -5305,7 +5304,7 @@ PHP_FUNCTION(money_format) check = 1; p++; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only a single %%i or %%n token can be used"); + php_error_docref(NULL, E_WARNING, "Only a single %%i or %%n token can be used"); RETURN_FALSE; } } @@ -5331,12 +5330,12 @@ PHP_FUNCTION(str_split) char *p; size_t n_reg_segments; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &str, &split_length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &str, &split_length) == FAILURE) { return; } if (split_length <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The length of each segment must be greater than zero"); + php_error_docref(NULL, E_WARNING, "The length of each segment must be greater than zero"); RETURN_FALSE; } @@ -5370,12 +5369,12 @@ PHP_FUNCTION(strpbrk) zend_string *haystack, *char_list; char *haystack_ptr, *cl_ptr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &haystack, &char_list) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &haystack, &char_list) == FAILURE) { RETURN_FALSE; } if (!char_list->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The character list cannot be empty"); + php_error_docref(NULL, E_WARNING, "The character list cannot be empty"); RETURN_FALSE; } @@ -5400,7 +5399,7 @@ PHP_FUNCTION(substr_compare) zend_bool cs=0; size_t cmp_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSl|lb", &s1, &s2, &offset, &len, &cs) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSl|lb", &s1, &s2, &offset, &len, &cs) == FAILURE) { RETURN_FALSE; } @@ -5408,7 +5407,7 @@ PHP_FUNCTION(substr_compare) if (len == 0) { RETURN_LONG(0L); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The length must be greater than or equal to zero"); + php_error_docref(NULL, E_WARNING, "The length must be greater than or equal to zero"); RETURN_FALSE; } } @@ -5419,7 +5418,7 @@ PHP_FUNCTION(substr_compare) } if ((size_t)offset >= s1->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length"); + php_error_docref(NULL, E_WARNING, "The start position cannot exceed initial string length"); RETURN_FALSE; } diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 036c189e75..49bb871ca5 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -138,7 +138,7 @@ PHP_FUNCTION(openlog) zend_long option, facility; size_t ident_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &ident, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll", &ident, &ident_len, &option, &facility) == FAILURE) { return; } @@ -179,7 +179,7 @@ PHP_FUNCTION(syslog) char *message; size_t message_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &priority, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &priority, &message, &message_len) == FAILURE) { return; } diff --git a/ext/standard/type.c b/ext/standard/type.c index a773e6c53c..acd1ac8613 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -27,7 +27,7 @@ PHP_FUNCTION(gettype) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } @@ -74,7 +74,7 @@ PHP_FUNCTION(gettype) case IS_RESOURCE: { - const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg) TSRMLS_CC); + const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg)); if (type_name) { RETVAL_STRING("resource"); @@ -96,7 +96,7 @@ PHP_FUNCTION(settype) char *type; size_t type_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &var, &type, &type_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &var, &type, &type_len) == FAILURE) { return; } @@ -123,10 +123,10 @@ PHP_FUNCTION(settype) } else if (!strcasecmp(type, "null")) { convert_to_null(var); } else if (!strcasecmp(type, "resource")) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert to resource type"); + php_error_docref(NULL, E_WARNING, "Cannot convert to resource type"); RETURN_FALSE; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type"); + php_error_docref(NULL, E_WARNING, "Invalid type"); RETURN_FALSE; } RETVAL_TRUE; @@ -144,7 +144,7 @@ PHP_FUNCTION(intval) WRONG_PARAM_COUNT; } #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &num, &base) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &num, &base) == FAILURE) { return; } #else @@ -166,7 +166,7 @@ PHP_FUNCTION(floatval) { zval *num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &num) == FAILURE) { return; } @@ -181,11 +181,11 @@ PHP_FUNCTION(boolval) { zval *val; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &val) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) == FAILURE) { return; } - RETURN_BOOL(zend_is_true(val TSRMLS_CC)); + RETURN_BOOL(zend_is_true(val)); } /* }}} */ @@ -194,7 +194,7 @@ PHP_FUNCTION(boolval) PHP_FUNCTION(strval) { zval *num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &num) == FAILURE) { return; } @@ -207,7 +207,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) zval *arg; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { RETURN_FALSE; } ZVAL_DEREF(arg); @@ -225,7 +225,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) RETURN_FALSE; } } else if (type == IS_RESOURCE) { - const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg) TSRMLS_CC); + const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg)); if (!type_name) { RETURN_FALSE; } @@ -262,7 +262,7 @@ PHP_FUNCTION(is_bool) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { RETURN_FALSE; } @@ -322,7 +322,7 @@ PHP_FUNCTION(is_numeric) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } @@ -354,7 +354,7 @@ PHP_FUNCTION(is_scalar) zval *arg; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } #else @@ -390,7 +390,7 @@ PHP_FUNCTION(is_callable) zend_bool syntax_only = 0; int check_flags = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|bz/", &var, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|bz/", &var, &syntax_only, &callable_name) == FAILURE) { return; } @@ -399,7 +399,7 @@ PHP_FUNCTION(is_callable) check_flags |= IS_CALLABLE_CHECK_SYNTAX_ONLY; } if (ZEND_NUM_ARGS() > 2) { - retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error TSRMLS_CC); + retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error); zval_dtor(callable_name); //??? is it necessary to be consistent with old PHP ("\0" support) if (UNEXPECTED(name->len) != strlen(name->val)) { @@ -409,7 +409,7 @@ PHP_FUNCTION(is_callable) ZVAL_STR(callable_name, name); } } else { - retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, &error TSRMLS_CC); + retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, &error); } if (error) { /* ignore errors */ diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c index 1014f5d9ba..1030d97410 100644 --- a/ext/standard/uniqid.c +++ b/ext/standard/uniqid.c @@ -54,7 +54,7 @@ PHP_FUNCTION(uniqid) size_t prefix_len = 0; struct timeval tv; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sb", &prefix, &prefix_len, &more_entropy)) { return; } @@ -62,7 +62,7 @@ PHP_FUNCTION(uniqid) #if HAVE_USLEEP && !defined(PHP_WIN32) if (!more_entropy) { #if defined(__CYGWIN__) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN"); + php_error_docref(NULL, E_WARNING, "You must use 'more entropy' under CYGWIN"); RETURN_FALSE; #else usleep(1); @@ -77,7 +77,7 @@ PHP_FUNCTION(uniqid) * digits for usecs. */ if (more_entropy) { - uniqid = strpprintf(0, "%s%08x%05x%.8F", prefix, sec, usec, php_combined_lcg(TSRMLS_C) * 10); + uniqid = strpprintf(0, "%s%08x%05x%.8F", prefix, sec, usec, php_combined_lcg() * 10); } else { uniqid = strpprintf(0, "%s%08x%05x", prefix, sec, usec); } diff --git a/ext/standard/url.c b/ext/standard/url.c index 7d408ef88a..ebd2c4108e 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -375,7 +375,7 @@ PHP_FUNCTION(parse_url) php_url *resource; zend_long key = -1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &key) == FAILURE) { return; } @@ -412,7 +412,7 @@ PHP_FUNCTION(parse_url) if (resource->fragment != NULL) RETVAL_STRING(resource->fragment); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key); + php_error_docref(NULL, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key); RETVAL_FALSE; } goto done; @@ -534,7 +534,7 @@ PHP_FUNCTION(urlencode) zend_string *in_str; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) { return; } #else @@ -554,7 +554,7 @@ PHP_FUNCTION(urldecode) zend_string *in_str, *out_str; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) { return; } #else @@ -641,7 +641,7 @@ PHP_FUNCTION(rawurlencode) zend_string *in_str; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) { return; } #else @@ -661,7 +661,7 @@ PHP_FUNCTION(rawurldecode) zend_string *in_str, *out_str; #ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) { return; } #else @@ -717,10 +717,10 @@ PHP_FUNCTION(get_headers) HashTable *hashT; zend_long format = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &url, &url_len, &format) == FAILURE) { return; } - context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc(TSRMLS_C)); + context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc()); if (!(stream = php_stream_open_wrapper_ex(url, "r", REPORT_ERRORS | STREAM_USE_URL | STREAM_ONLY_GET_HEADERS, NULL, context))) { RETURN_FALSE; diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 6b406e673f..292d0a9315 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -218,7 +218,7 @@ done: #undef YYLIMIT #undef YYMARKER -static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC) +static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type) { char f = 0; @@ -343,10 +343,10 @@ static inline void handle_arg(STD_PARA) static inline void handle_val(STD_PARA, char quotes, char type) { smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); - tag_arg(ctx, quotes, type TSRMLS_CC); + tag_arg(ctx, quotes, type); } -static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC) +static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen) { char *end, *q; char *xp; @@ -918,7 +918,7 @@ stop: ctx->buf.s->len = rest; } -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) +char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen) { char *result; smart_str surl = {0}; @@ -944,14 +944,14 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha } -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) +static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush) { url_adapt_state_ex_t *ctx; char *retval; ctx = &BG(url_adapt_state_ex); - xx_mainloop(ctx, src, srclen TSRMLS_CC); + xx_mainloop(ctx, src, srclen); if (!ctx->result.s) { smart_str_appendl(&ctx->result, "", 0); @@ -971,7 +971,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_ return retval; } -static int php_url_scanner_ex_activate(TSRMLS_D) +static int php_url_scanner_ex_activate(void) { url_adapt_state_ex_t *ctx; @@ -982,7 +982,7 @@ static int php_url_scanner_ex_activate(TSRMLS_D) return SUCCESS; } -static int php_url_scanner_ex_deactivate(TSRMLS_D) +static int php_url_scanner_ex_deactivate(void) { url_adapt_state_ex_t *ctx; @@ -996,12 +996,12 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D) return SUCCESS; } -static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC) +static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode) { size_t len; if (BG(url_adapt_state_ex).url_app.s->len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0) TSRMLS_CC); + *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0)); if (sizeof(uint) < sizeof(size_t)) { if (len > UINT_MAX) len = UINT_MAX; @@ -1026,14 +1026,14 @@ static void php_url_scanner_output_handler(char *output, size_t output_len, char } } -PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC) +PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode) { smart_str val = {0}; zend_string *encoded; if (!BG(url_adapt_state_ex).active) { - php_url_scanner_ex_activate(TSRMLS_C); - php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC); + php_url_scanner_ex_activate(); + php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS); BG(url_adapt_state_ex).active = 1; } @@ -1067,7 +1067,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz return SUCCESS; } -PHPAPI int php_url_scanner_reset_vars(TSRMLS_D) +PHPAPI int php_url_scanner_reset_vars(void) { if (BG(url_adapt_state_ex).form_app.s) { BG(url_adapt_state_ex).form_app.s->len = 0; @@ -1106,7 +1106,7 @@ PHP_RINIT_FUNCTION(url_scanner) PHP_RSHUTDOWN_FUNCTION(url_scanner) { if (BG(url_adapt_state_ex).active) { - php_url_scanner_ex_deactivate(TSRMLS_C); + php_url_scanner_ex_deactivate(); BG(url_adapt_state_ex).active = 0; } diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index 2a9b6921bf..ff0e644d01 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -27,9 +27,9 @@ PHP_MSHUTDOWN_FUNCTION(url_scanner_ex); PHP_RINIT_FUNCTION(url_scanner_ex); PHP_RSHUTDOWN_FUNCTION(url_scanner_ex); -PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC); -PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC); -PHPAPI int php_url_scanner_reset_vars(TSRMLS_D); +PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen); +PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode); +PHPAPI int php_url_scanner_reset_vars(void); #include "zend_smart_str_public.h" diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index fed628f089..97611954f2 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -154,7 +154,7 @@ done: #undef YYLIMIT #undef YYMARKER -static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC) +static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type) { char f = 0; @@ -279,10 +279,10 @@ static inline void handle_arg(STD_PARA) static inline void handle_val(STD_PARA, char quotes, char type) { smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); - tag_arg(ctx, quotes, type TSRMLS_CC); + tag_arg(ctx, quotes, type); } -static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC) +static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen) { char *end, *q; char *xp; @@ -370,7 +370,7 @@ stop: ctx->buf.s->len = rest; } -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) +char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen) { char *result; smart_str surl = {0}; @@ -396,14 +396,14 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha } -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) +static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush) { url_adapt_state_ex_t *ctx; char *retval; ctx = &BG(url_adapt_state_ex); - xx_mainloop(ctx, src, srclen TSRMLS_CC); + xx_mainloop(ctx, src, srclen); if (!ctx->result.s) { smart_str_appendl(&ctx->result, "", 0); @@ -423,7 +423,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_ return retval; } -static int php_url_scanner_ex_activate(TSRMLS_D) +static int php_url_scanner_ex_activate(void) { url_adapt_state_ex_t *ctx; @@ -434,7 +434,7 @@ static int php_url_scanner_ex_activate(TSRMLS_D) return SUCCESS; } -static int php_url_scanner_ex_deactivate(TSRMLS_D) +static int php_url_scanner_ex_deactivate(void) { url_adapt_state_ex_t *ctx; @@ -448,12 +448,12 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D) return SUCCESS; } -static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC) +static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode) { size_t len; if (BG(url_adapt_state_ex).url_app.s->len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0) TSRMLS_CC); + *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0)); if (sizeof(uint) < sizeof(size_t)) { if (len > UINT_MAX) len = UINT_MAX; @@ -478,14 +478,14 @@ static void php_url_scanner_output_handler(char *output, size_t output_len, char } } -PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC) +PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode) { smart_str val = {0}; zend_string *encoded; if (!BG(url_adapt_state_ex).active) { - php_url_scanner_ex_activate(TSRMLS_C); - php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC); + php_url_scanner_ex_activate(); + php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS); BG(url_adapt_state_ex).active = 1; } @@ -519,7 +519,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz return SUCCESS; } -PHPAPI int php_url_scanner_reset_vars(TSRMLS_D) +PHPAPI int php_url_scanner_reset_vars(void) { if (BG(url_adapt_state_ex).form_app.s) { BG(url_adapt_state_ex).form_app.s->len = 0; @@ -558,7 +558,7 @@ PHP_RINIT_FUNCTION(url_scanner) PHP_RSHUTDOWN_FUNCTION(url_scanner) { if (BG(url_adapt_state_ex).active) { - php_url_scanner_ex_deactivate(TSRMLS_C); + php_url_scanner_ex_deactivate(); BG(url_adapt_state_ex).active = 0; } diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index f310e64ae9..9f748623c4 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -43,7 +43,7 @@ static int le_bucket; #define GET_FILTER_FROM_OBJ() { \ zval **tmp; \ if (FAILURE == zend_hash_index_find(Z_OBJPROP_P(this_ptr), 0, (void**)&tmp)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "filter property vanished"); \ + php_error_docref(NULL, E_WARNING, "filter property vanished"); \ RETURN_FALSE; \ } \ ZEND_FETCH_RESOURCE(filter, php_stream_filter*, tmp, -1, "filter", le_userfilters); \ @@ -80,7 +80,7 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor) { php_stream_bucket *bucket = (php_stream_bucket *)res->ptr; if (bucket) { - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); bucket = NULL; } } @@ -90,11 +90,11 @@ PHP_MINIT_FUNCTION(user_filters) zend_class_entry *php_user_filter; /* init the filter class ancestor */ INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", user_filter_class_funcs); - if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) == NULL) { + if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry)) == NULL) { return FAILURE; } - zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC); + zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC); /* init the filter resource; it has no dtor, as streams will always clean it up * at the correct time */ @@ -135,7 +135,7 @@ PHP_RSHUTDOWN_FUNCTION(user_filters) return SUCCESS; } -static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC) +static void userfilter_dtor(php_stream_filter *thisfilter) { zval *obj = &thisfilter->abstract; zval func_name; @@ -153,7 +153,7 @@ static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC) &func_name, &retval, 0, NULL, - 0, NULL TSRMLS_CC); + 0, NULL); zval_ptr_dtor(&retval); zval_ptr_dtor(&func_name); @@ -215,7 +215,7 @@ php_stream_filter_status_t userfilter_filter( &func_name, &retval, 4, args, - 0, NULL TSRMLS_CC); + 0, NULL); zval_ptr_dtor(&func_name); @@ -223,7 +223,7 @@ php_stream_filter_status_t userfilter_filter( convert_to_long(&retval); ret = (int)Z_LVAL(retval); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function"); + php_error_docref(NULL, E_WARNING, "failed to call filter function"); } if (bytes_consumed) { @@ -233,18 +233,18 @@ php_stream_filter_status_t userfilter_filter( if (buckets_in->head) { php_stream_bucket *bucket = buckets_in->head; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unprocessed filter buckets remaining on input brigade"); + php_error_docref(NULL, E_WARNING, "Unprocessed filter buckets remaining on input brigade"); while ((bucket = buckets_in->head)) { /* Remove unconsumed buckets from the brigade */ - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } } if (ret != PSFS_PASS_ON) { php_stream_bucket *bucket = buckets_out->head; while (bucket != NULL) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); bucket = buckets_out->head; } } @@ -253,7 +253,7 @@ php_stream_filter_status_t userfilter_filter( * keeping a reference to the stream resource here would prevent it * from being destroyed properly */ ZVAL_STRINGL(&zpropname, "stream", sizeof("stream")-1); - Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname, NULL TSRMLS_CC); + Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname, NULL); zval_ptr_dtor(&zpropname); zval_ptr_dtor(&args[3]); @@ -271,7 +271,7 @@ static php_stream_filter_ops userfilter_ops = { }; static php_stream_filter *user_filter_factory_create(const char *filtername, - zval *filterparams, int persistent TSRMLS_DC) + zval *filterparams, int persistent) { struct php_user_filter_data *fdat = NULL; php_stream_filter *filter; @@ -282,7 +282,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, /* some sanity checks */ if (persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "cannot use a user-space filter with a persistent stream"); return NULL; } @@ -317,7 +317,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, efree(wildcard); } if (fdat == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "Err, filter \"%s\" is not in the user-filter map, but somehow the user-filter-factory was invoked for it!?", filtername); return NULL; } @@ -325,8 +325,8 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, /* bind the classname to the actual class */ if (fdat->ce == NULL) { - if (NULL == (fdat->ce = zend_lookup_class(fdat->classname TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + if (NULL == (fdat->ce = zend_lookup_class(fdat->classname))) { + php_error_docref(NULL, E_WARNING, "user-filter \"%s\" requires class \"%s\", but that class is not defined", filtername, fdat->classname->val); return NULL; @@ -359,7 +359,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, &func_name, &retval, 0, NULL, - 0, NULL TSRMLS_CC); + 0, NULL); if (Z_TYPE(retval) != IS_UNDEF) { if (Z_TYPE(retval) == IS_FALSE) { @@ -368,7 +368,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, /* Kill the filter (safely) */ ZVAL_UNDEF(&filter->abstract); - php_stream_filter_free(filter TSRMLS_CC); + php_stream_filter_free(filter); /* Kill the object */ zval_ptr_dtor(&obj); @@ -409,7 +409,7 @@ PHP_FUNCTION(stream_bucket_make_writeable) php_stream_bucket_brigade *brigade; php_stream_bucket *bucket; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zbrigade) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zbrigade) == FAILURE) { RETURN_FALSE; } @@ -417,7 +417,7 @@ PHP_FUNCTION(stream_bucket_make_writeable) ZVAL_NULL(return_value); - if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head TSRMLS_CC))) { + if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head))) { ZEND_REGISTER_RESOURCE(&zbucket, bucket, le_bucket); object_init(return_value); add_property_zval(return_value, "bucket", &zbucket); @@ -437,12 +437,12 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS) php_stream_bucket_brigade *brigade; php_stream_bucket *bucket; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zo", &zbrigade, &zobject) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zo", &zbrigade, &zobject) == FAILURE) { RETURN_FALSE; } if (NULL == (pzbucket = zend_hash_str_find(Z_OBJPROP_P(zobject), "bucket", sizeof("bucket")-1))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Object has no bucket property"); + php_error_docref(NULL, E_WARNING, "Object has no bucket property"); RETURN_FALSE; } @@ -451,7 +451,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS) if (NULL != (pzdata = zend_hash_str_find(Z_OBJPROP_P(zobject), "data", sizeof("data")-1)) && Z_TYPE_P(pzdata) == IS_STRING) { if (!bucket->own_buf) { - bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(bucket); } if ((int)bucket->buflen != Z_STRLEN_P(pzdata)) { bucket->buf = perealloc(bucket->buf, Z_STRLEN_P(pzdata), bucket->is_persistent); @@ -461,9 +461,9 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS) } if (append) { - php_stream_bucket_append(brigade, bucket TSRMLS_CC); + php_stream_bucket_append(brigade, bucket); } else { - php_stream_bucket_prepend(brigade, bucket TSRMLS_CC); + php_stream_bucket_prepend(brigade, bucket); } /* This is a hack necessary to accommodate situations where bucket is appended to the stream * multiple times. See bug35916.phpt for reference. @@ -501,7 +501,7 @@ PHP_FUNCTION(stream_bucket_new) size_t buffer_len; php_stream_bucket *bucket; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &zstream, &buffer, &buffer_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &zstream, &buffer, &buffer_len) == FAILURE) { RETURN_FALSE; } @@ -513,7 +513,7 @@ PHP_FUNCTION(stream_bucket_new) memcpy(pbuffer, buffer, buffer_len); - bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream) TSRMLS_CC); + bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream)); if (bucket == NULL) { RETURN_FALSE; @@ -562,19 +562,19 @@ PHP_FUNCTION(stream_filter_register) zend_string *filtername, *classname; struct php_user_filter_data *fdat; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &filtername, &classname) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &filtername, &classname) == FAILURE) { RETURN_FALSE; } RETVAL_FALSE; if (!filtername->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty"); + php_error_docref(NULL, E_WARNING, "Filter name cannot be empty"); return; } if (!classname->len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty"); + php_error_docref(NULL, E_WARNING, "Class name cannot be empty"); return; } @@ -587,7 +587,7 @@ PHP_FUNCTION(stream_filter_register) fdat->classname = zend_string_copy(classname); if (zend_hash_add_ptr(BG(user_filter_map), filtername, fdat) != NULL && - php_stream_filter_register_factory_volatile(filtername->val, &user_filter_factory TSRMLS_CC) == SUCCESS) { + php_stream_filter_register_factory_volatile(filtername->val, &user_filter_factory) == SUCCESS) { RETVAL_TRUE; } else { zend_string_release(classname); diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index ea171a658a..0a25b770f6 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -202,7 +202,7 @@ PHP_FUNCTION(convert_uuencode) { zend_string *src; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &src) == FAILURE || src->len < 1) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &src) == FAILURE || src->len < 1) { RETURN_FALSE; } @@ -217,12 +217,12 @@ PHP_FUNCTION(convert_uudecode) zend_string *src; zend_string *dest; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &src) == FAILURE || src->len < 1) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &src) == FAILURE || src->len < 1) { RETURN_FALSE; } if ((dest = php_uudecode(src->val, src->len)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The given parameter is not a valid uuencoded string"); + php_error_docref(NULL, E_WARNING, "The given parameter is not a valid uuencoded string"); RETURN_FALSE; } diff --git a/ext/standard/var.c b/ext/standard/var.c index 24bdd385a5..94b43ca399 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -54,7 +54,7 @@ static uint zend_obj_num_elements(HashTable *ht) return num; } -static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */ +static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */ { if (key == NULL) { /* numeric key */ php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); @@ -63,11 +63,11 @@ static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, PHPWRITE(key->val, key->len); php_printf("\"]=>\n"); } - php_var_dump(zv, level + 2 TSRMLS_CC); + php_var_dump(zv, level + 2); } /* }}} */ -static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */ +static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */ { const char *prop_name, *class_name; @@ -90,11 +90,11 @@ static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *ke } ZEND_PUTS("]=>\n"); } - php_var_dump(zv, level + 2 TSRMLS_CC); + php_var_dump(zv, level + 2); } /* }}} */ -PHPAPI void php_var_dump(zval *struc, int level TSRMLS_DC) /* {{{ */ +PHPAPI void php_var_dump(zval *struc, int level) /* {{{ */ { HashTable *myht; zend_string *class_name; @@ -141,7 +141,7 @@ again: is_temp = 0; ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) { - php_array_element_dump(val, num, key, level TSRMLS_CC); + php_array_element_dump(val, num, key, level); } ZEND_HASH_FOREACH_END(); if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) { --myht->u.v.nApplyCount; @@ -163,7 +163,7 @@ again: return; } - class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC); + class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc)); php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0); zend_string_release(class_name); @@ -173,7 +173,7 @@ again: zval *val; ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) { - php_object_property_dump(val, num, key, level TSRMLS_CC); + php_object_property_dump(val, num, key, level); } ZEND_HASH_FOREACH_END(); --myht->u.v.nApplyCount; if (is_temp) { @@ -187,7 +187,7 @@ again: PUTS("}\n"); break; case IS_RESOURCE: { - const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC); + const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc)); php_printf("%sresource(%pd) of type (%s)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown"); break; } @@ -214,17 +214,17 @@ PHP_FUNCTION(var_dump) int argc; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } for (i = 0; i < argc; i++) { - php_var_dump(&args[i], 1 TSRMLS_CC); + php_var_dump(&args[i], 1); } } /* }}} */ -static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */ +static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */ { if (key == NULL) { /* numeric key */ php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); @@ -233,11 +233,11 @@ static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key PHPWRITE(key->val, key->len); php_printf("\"]=>\n"); } - php_debug_zval_dump(zv, level + 2 TSRMLS_CC); + php_debug_zval_dump(zv, level + 2); } /* }}} */ -static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */ +static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */ { const char *prop_name, *class_name; @@ -258,11 +258,11 @@ static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *k } ZEND_PUTS("]=>\n"); } - php_debug_zval_dump(zv, level + 2 TSRMLS_CC); + php_debug_zval_dump(zv, level + 2); } /* }}} */ -PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC) /* {{{ */ +PHPAPI void php_debug_zval_dump(zval *struc, int level) /* {{{ */ { HashTable *myht = NULL; zend_string *class_name; @@ -307,7 +307,7 @@ again: } php_printf("%sarray(%d) refcount(%u){\n", COMMON, zend_hash_num_elements(myht), Z_REFCOUNTED_P(struc) ? Z_REFCOUNT_P(struc) : 1); ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) { - zval_array_element_dump(val, index, key, level TSRMLS_CC); + zval_array_element_dump(val, index, key, level); } ZEND_HASH_FOREACH_END(); if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) { myht->u.v.nApplyCount--; @@ -331,12 +331,12 @@ again: myht->u.v.nApplyCount++; } } - class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC); + class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc)); php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0, Z_REFCOUNT_P(struc)); zend_string_release(class_name); if (myht) { ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) { - zval_object_property_dump(val, index, key, level TSRMLS_CC); + zval_object_property_dump(val, index, key, level); } ZEND_HASH_FOREACH_END(); myht->u.v.nApplyCount--; if (is_temp) { @@ -350,7 +350,7 @@ again: PUTS("}\n"); break; case IS_RESOURCE: { - const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC); + const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc)); php_printf("%sresource(" ZEND_LONG_FMT ") of type (%s) refcount(%u)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown", Z_REFCOUNT_P(struc)); break; } @@ -376,12 +376,12 @@ PHP_FUNCTION(debug_zval_dump) int argc; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } for (i = 0; i < argc; i++) { - php_debug_zval_dump(&args[i], 1 TSRMLS_CC); + php_debug_zval_dump(&args[i], 1); } } /* }}} */ @@ -395,7 +395,7 @@ PHP_FUNCTION(debug_zval_dump) efree(tmp_spaces); \ } while(0); -static void php_array_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf TSRMLS_DC) /* {{{ */ +static void php_array_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */ { if (key == NULL) { /* numeric key */ buffer_append_spaces(buf, level+1); @@ -404,7 +404,7 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke } else { /* string key */ zend_string *tmp_str; - zend_string *ckey = php_addcslashes(key->val, key->len, 0, "'\\", 2 TSRMLS_CC); + zend_string *ckey = php_addcslashes(key->val, key->len, 0, "'\\", 2); tmp_str = php_str_to_str_ex(ckey->val, ckey->len, "\0", 1, "' . \"\\0\" . '", 12, 0, NULL); buffer_append_spaces(buf, level + 1); @@ -416,14 +416,14 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke zend_string_free(ckey); zend_string_free(tmp_str); } - php_var_export_ex(zv, level + 2, buf TSRMLS_CC); + php_var_export_ex(zv, level + 2, buf); smart_str_appendc(buf, ','); smart_str_appendc(buf, '\n'); } /* }}} */ -static void php_object_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf TSRMLS_DC) /* {{{ */ +static void php_object_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */ { buffer_append_spaces(buf, level + 2); if (key != NULL) { @@ -432,7 +432,7 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k zend_string *pname_esc; zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len); - pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2 TSRMLS_CC); + pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2); smart_str_appendc(buf, '\''); smart_str_append(buf, pname_esc); @@ -442,13 +442,13 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k smart_str_append_long(buf, (zend_long) index); } smart_str_appendl(buf, " => ", 4); - php_var_export_ex(zv, level + 2, buf TSRMLS_CC); + php_var_export_ex(zv, level + 2, buf); smart_str_appendc(buf, ','); smart_str_appendc(buf, '\n'); } /* }}} */ -PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC) /* {{{ */ +PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf) /* {{{ */ { HashTable *myht; char *tmp_str; @@ -478,7 +478,7 @@ again: efree(tmp_str); break; case IS_STRING: - ztmp = php_addcslashes(Z_STRVAL_P(struc), Z_STRLEN_P(struc), 0, "'\\", 2 TSRMLS_CC); + ztmp = php_addcslashes(Z_STRVAL_P(struc), Z_STRLEN_P(struc), 0, "'\\", 2); ztmp2 = php_str_to_str_ex(ztmp->val, ztmp->len, "\0", 1, "' . \"\\0\" . '", 12, 0, NULL); smart_str_appendc(buf, '\''); @@ -502,7 +502,7 @@ again: } smart_str_appendl(buf, "array (\n", 8); ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) { - php_array_element_export(val, index, key, level, buf TSRMLS_CC); + php_array_element_export(val, index, key, level, buf); } ZEND_HASH_FOREACH_END(); if (ZEND_HASH_APPLY_PROTECTION(myht)) { myht->u.v.nApplyCount--; @@ -535,7 +535,7 @@ again: if (myht) { ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) { - php_object_element_export(val, index, key, level, buf TSRMLS_CC); + php_object_element_export(val, index, key, level, buf); } ZEND_HASH_FOREACH_END(); myht->u.v.nApplyCount--; } @@ -557,10 +557,10 @@ again: /* }}} */ /* FOR BC reasons, this will always perform and then print */ -PHPAPI void php_var_export(zval *struc, int level TSRMLS_DC) /* {{{ */ +PHPAPI void php_var_export(zval *struc, int level) /* {{{ */ { smart_str buf = {0}; - php_var_export_ex(struc, level, &buf TSRMLS_CC); + php_var_export_ex(struc, level, &buf); smart_str_0(&buf); PHPWRITE(buf.s->val, buf.s->len); smart_str_free(&buf); @@ -576,11 +576,11 @@ PHP_FUNCTION(var_export) zend_bool return_output = 0; smart_str buf = {0}; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &var, &return_output) == FAILURE) { return; } - php_var_export_ex(var, 1, &buf TSRMLS_CC); + php_var_export_ex(var, 1, &buf); smart_str_0 (&buf); if (return_output) { @@ -592,9 +592,9 @@ PHP_FUNCTION(var_export) } /* }}} */ -static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC); +static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash); -static inline zend_long php_add_var_hash(php_serialize_data_t data, zval *var TSRMLS_DC) /* {{{ */ +static inline zend_long php_add_var_hash(php_serialize_data_t data, zval *var) /* {{{ */ { zval *zv; zend_ulong key; @@ -658,7 +658,7 @@ static inline void php_var_serialize_string(smart_str *buf, char *str, size_t le } /* }}} */ -static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc TSRMLS_DC) /* {{{ */ +static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* {{{ */ { PHP_CLASS_ATTRIBUTES; @@ -673,12 +673,12 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc } /* }}} */ -static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */ +static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash) /* {{{ */ { uint32_t count; zend_bool incomplete_class; - incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); + incomplete_class = php_var_serialize_class_name(buf, struc); /* count after serializing name, since php_var_serialize_class_name * changes the count if the variable is incomplete class */ count = zend_hash_num_elements(HASH_OF(retval_ptr)); @@ -704,7 +704,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt } if (Z_TYPE_P(name) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize."); + php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize."); /* we should still add element even if it's not OK, * since we already wrote the length of the array before */ smart_str_appendl(buf,"N;", 2); @@ -719,7 +719,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt } } php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name)); - php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); + php_var_serialize_intern(buf, d, var_hash); } else { zend_class_entry *ce = Z_OBJ_P(struc)->ce; if (ce) { @@ -736,7 +736,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt } php_var_serialize_string(buf, priv_name->val, priv_name->len); zend_string_free(priv_name); - php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); + php_var_serialize_intern(buf, d, var_hash); break; } zend_string_free(priv_name); @@ -751,17 +751,17 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt } php_var_serialize_string(buf, prot_name->val, prot_name->len); zend_string_free(prot_name); - php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); + php_var_serialize_intern(buf, d, var_hash); break; } zend_string_free(prot_name); php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name)); - php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_P(name)); + php_var_serialize_intern(buf, nvalp, var_hash); + php_error_docref(NULL, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_P(name)); } while (0); } else { php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name)); - php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC); + php_var_serialize_intern(buf, nvalp, var_hash); } } } ZEND_HASH_FOREACH_END(); @@ -770,7 +770,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt } /* }}} */ -static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */ +static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash) /* {{{ */ { zend_long var_already; HashTable *myht; @@ -779,7 +779,7 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_ return; } - if (var_hash && (var_already = php_add_var_hash(var_hash, struc TSRMLS_CC))) { + if (var_hash && (var_already = php_add_var_hash(var_hash, struc))) { if (Z_ISREF_P(struc)) { smart_str_appendl(buf, "R:", 2); smart_str_append_long(buf, var_already); @@ -838,7 +838,7 @@ again: unsigned char *serialized_data = NULL; size_t serialized_length; - if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) { + if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash) == SUCCESS) { smart_str_appendl(buf, "C:", 2); smart_str_append_unsigned(buf, Z_OBJCE_P(struc)->name->len); smart_str_appendl(buf, ":\"", 2); @@ -861,7 +861,7 @@ again: if (ce && ce != PHP_IC_ENTRY && zend_hash_str_exists(&ce->function_table, "__sleep", sizeof("__sleep")-1)) { ZVAL_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1); BG(serialize_lock)++; - res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC); + res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL); BG(serialize_lock)--; zval_dtor(&fname); @@ -873,9 +873,9 @@ again: if (res == SUCCESS) { if (Z_TYPE(retval) != IS_UNDEF) { if (HASH_OF(&retval)) { - php_var_serialize_class(buf, struc, &retval, var_hash TSRMLS_CC); + php_var_serialize_class(buf, struc, &retval, var_hash); } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize"); + php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize"); /* we should still add element even if it's not OK, * since we already wrote the length of the array before */ smart_str_appendl(buf,"N;", 2); @@ -896,7 +896,7 @@ again: smart_str_appendl(buf, "a:", 2); myht = HASH_OF(struc); } else { - incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); + incomplete_class = php_var_serialize_class_name(buf, struc); myht = Z_OBJPROP_P(struc); } /* count after serializing name, since php_var_serialize_class_name @@ -934,7 +934,7 @@ again: if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) { Z_ARRVAL_P(data)->u.v.nApplyCount++; } - php_var_serialize_intern(buf, data, var_hash TSRMLS_CC); + php_var_serialize_intern(buf, data, var_hash); if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) { Z_ARRVAL_P(data)->u.v.nApplyCount--; } @@ -954,9 +954,9 @@ again: } /* }}} */ -PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC) /* {{{ */ +PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data) /* {{{ */ { - php_var_serialize_intern(buf, struc, *data TSRMLS_CC); + php_var_serialize_intern(buf, struc, *data); smart_str_0(buf); } /* }}} */ @@ -969,12 +969,12 @@ PHP_FUNCTION(serialize) php_serialize_data_t var_hash; smart_str buf = {0}; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &struc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &struc) == FAILURE) { return; } PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&buf, struc, &var_hash TSRMLS_CC); + php_var_serialize(&buf, struc, &var_hash); PHP_VAR_SERIALIZE_DESTROY(var_hash); if (EG(exception)) { @@ -1001,7 +1001,7 @@ PHP_FUNCTION(unserialize) zval *options = NULL, *classes = NULL; HashTable *class_hash = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &buf, &buf_len, &options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &buf, &buf_len, &options) == FAILURE) { RETURN_FALSE; } @@ -1013,7 +1013,7 @@ PHP_FUNCTION(unserialize) PHP_VAR_UNSERIALIZE_INIT(var_hash); if(options != NULL) { classes = zend_hash_str_find(Z_ARRVAL_P(options), "allowed_classes", sizeof("allowed_classes")-1); - if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes TSRMLS_CC))) { + if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes))) { ALLOC_HASHTABLE(class_hash); zend_hash_init(class_hash, (Z_TYPE_P(classes) == IS_ARRAY)?zend_hash_num_elements(Z_ARRVAL_P(classes)):0, NULL, NULL, 0); } @@ -1031,7 +1031,7 @@ PHP_FUNCTION(unserialize) } } - if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash TSRMLS_CC)) { + if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash)) { PHP_VAR_UNSERIALIZE_DESTROY(var_hash); if(class_hash) { zend_hash_destroy(class_hash); @@ -1039,7 +1039,7 @@ PHP_FUNCTION(unserialize) } zval_dtor(return_value); if (!EG(exception)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len); + php_error_docref(NULL, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len); } RETURN_FALSE; } @@ -1056,11 +1056,11 @@ PHP_FUNCTION(unserialize) PHP_FUNCTION(memory_get_usage) { zend_bool real_usage = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &real_usage) == FAILURE) { RETURN_FALSE; } - RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC)); + RETURN_LONG(zend_memory_usage(real_usage)); } /* }}} */ @@ -1069,11 +1069,11 @@ PHP_FUNCTION(memory_get_usage) { PHP_FUNCTION(memory_get_peak_usage) { zend_bool real_usage = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &real_usage) == FAILURE) { RETURN_FALSE; } - RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC)); + RETURN_LONG(zend_memory_peak_usage(real_usage)); } /* }}} */ diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 0217bba5fa..f51a42095e 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -329,7 +329,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend ZVAL_UNDEF(&key); - if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) { + if (!php_var_unserialize_ex(&key, p, max, NULL, classes)) { zval_dtor(&key); return 0; } @@ -381,7 +381,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend zval_dtor(&key); - if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) { + if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) { return 0; } @@ -421,7 +421,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) if (ce->unserialize == NULL) { zend_error(E_WARNING, "Class %s has no unserializer", ce->name->val); object_init_ex(rval, ce); - } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { + } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash) != SUCCESS) { return 0; } @@ -472,7 +472,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements) zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1)) { ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1); BG(serialize_lock)++; - call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC); + call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL); BG(serialize_lock)--; zval_dtor(&fname); zval_dtor(&retval); @@ -489,7 +489,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements) # pragma optimize("", on) #endif -PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC) +PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash) { HashTable *classes = NULL; return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU); @@ -623,7 +623,7 @@ yy14: #line 860 "ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); + php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data"); return 0; /* not sure if it should be 0 or 1 here? */ } #line 630 "ext/standard/var_unserializer.c" @@ -714,7 +714,7 @@ yy20: /* Try to find class directly */ BG(serialize_lock)++; - ce = zend_lookup_class(class_name TSRMLS_CC); + ce = zend_lookup_class(class_name); if (ce) { BG(serialize_lock)--; if (EG(exception)) { @@ -742,7 +742,7 @@ yy20: ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; - if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { + if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) { BG(serialize_lock)--; if (EG(exception)) { zend_string_release(class_name); @@ -750,7 +750,7 @@ yy20: zval_ptr_dtor(&args[0]); return 0; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func)); + php_error_docref(NULL, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func)); incomplete_class = 1; ce = PHP_IC_ENTRY; zval_ptr_dtor(&user_func); @@ -767,8 +767,8 @@ yy20: } /* The callback function may have defined the class */ - if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); + if ((ce = zend_lookup_class(class_name)) == NULL) { + php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); incomplete_class = 1; ce = PHP_IC_ENTRY; } diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index c7871671b6..99600995a5 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -333,7 +333,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend ZVAL_UNDEF(&key); - if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) { + if (!php_var_unserialize_ex(&key, p, max, NULL, classes)) { zval_dtor(&key); return 0; } @@ -385,7 +385,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend zval_dtor(&key); - if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) { + if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) { return 0; } @@ -425,7 +425,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) if (ce->unserialize == NULL) { zend_error(E_WARNING, "Class %s has no unserializer", ce->name->val); object_init_ex(rval, ce); - } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { + } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash) != SUCCESS) { return 0; } @@ -476,7 +476,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements) zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1)) { ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1); BG(serialize_lock)++; - call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC); + call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL); BG(serialize_lock)--; zval_dtor(&fname); zval_dtor(&retval); @@ -493,7 +493,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements) # pragma optimize("", on) #endif -PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC) +PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash) { HashTable *classes = NULL; return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU); @@ -769,7 +769,7 @@ object ":" uiv ":" ["] { /* Try to find class directly */ BG(serialize_lock)++; - ce = zend_lookup_class(class_name TSRMLS_CC); + ce = zend_lookup_class(class_name); if (ce) { BG(serialize_lock)--; if (EG(exception)) { @@ -797,7 +797,7 @@ object ":" uiv ":" ["] { ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; - if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { + if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) { BG(serialize_lock)--; if (EG(exception)) { zend_string_release(class_name); @@ -805,7 +805,7 @@ object ":" uiv ":" ["] { zval_ptr_dtor(&args[0]); return 0; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func)); + php_error_docref(NULL, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func)); incomplete_class = 1; ce = PHP_IC_ENTRY; zval_ptr_dtor(&user_func); @@ -822,8 +822,8 @@ object ":" uiv ":" ["] { } /* The callback function may have defined the class */ - if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); + if ((ce = zend_lookup_class(class_name)) == NULL) { + php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); incomplete_class = 1; ce = PHP_IC_ENTRY; } @@ -859,7 +859,7 @@ object ":" uiv ":" ["] { "}" { /* this is the case where we have less data than planned */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); + php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data"); return 0; /* not sure if it should be 0 or 1 here? */ } diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index ffdd5abf0d..1823e1646e 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -215,7 +215,7 @@ PHP_FUNCTION(version_compare) int compare, argc; argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc TSRMLS_CC, "ss|s", &v1, &v1_len, &v2, + if (zend_parse_parameters(argc, "ss|s", &v1, &v1_len, &v2, &v2_len, &op, &op_len) == FAILURE) { return; } |