andrei Tue Dec 19 21:39:00 2006 UTC Modified files: /ZendEngine2 zend_API.h zend_execute_API.c /php-src/ext/reflection php_reflection.c /php-src/ext/standard array.c basic_functions.c string.c Log: - Marcus was too quick. Let's put type before zstr in the macros. - Also mark get_include_path() and restore_include_path() with U.
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.274&r2=1.275&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.274 ZendEngine2/zend_API.h:1.275 --- ZendEngine2/zend_API.h:1.274 Tue Dec 19 21:12:16 2006 +++ ZendEngine2/zend_API.h Tue Dec 19 21:38:59 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.274 2006/12/19 21:12:16 helly Exp $ */ +/* $Id: zend_API.h,v 1.275 2006/12/19 21:38:59 andrei Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -389,13 +389,13 @@ #define add_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_assoc_text_ex(arg, key, key_len, str, duplicate) do { \ @@ -532,13 +532,13 @@ #define add_ascii_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_ascii_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_ascii_assoc_text_ex(arg, key, key_len, str, duplicate) do { \ @@ -676,13 +676,13 @@ #define add_rt_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_rt_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_rt_assoc_text_ex(arg, key, key_len, str, duplicate) do { \ @@ -820,13 +820,13 @@ #define add_utf8_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_utf8_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \ } while (0) #define add_utf8_assoc_text_ex(arg, key, key_len, str, duplicate) do { \ @@ -972,14 +972,14 @@ #define add_utf8_property_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \ zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \ } while (0) #define add_utf8_property_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \ zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \ } while (0) @@ -1092,13 +1092,13 @@ #define add_u_assoc_zstr_ex(arg, key_type, key, key_len, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_u_assoc_zval_ex(arg, key_type, key, key_len, ___tmp); \ } while (0) #define add_u_assoc_zstrl_ex(arg, key_type, key, key_len, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_u_assoc_zval_ex(arg, key_type, key, key_len, ___tmp); \ } while (0) #define add_u_assoc_text_ex(arg, type, key, key_len, str, duplicate) do { \ @@ -1236,13 +1236,13 @@ #define add_index_zstr(arg, idx, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_index_zval(arg, idx, ___tmp); \ } while (0) #define add_index_zstrl(arg, idx, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_index_zval(arg, idx, ___tmp); \ } while (0) #define add_index_text(arg, idx, str, duplicate) do { \ @@ -1359,13 +1359,13 @@ #define add_next_index_zstr(arg, type, str, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTR(___tmp, str, type, duplicate); \ + ZVAL_ZSTR(___tmp, type, str, duplicate); \ add_next_index_zval(arg, ___tmp); \ } while (0) #define add_next_index_zstrl(arg, type, str, length, duplicate) do { \ zval *___tmp; \ MAKE_STD_ZVAL(___tmp); \ - ZVAL_ZSTRL(___tmp, str, type, length, duplicate); \ + ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \ add_next_index_zval(arg, ___tmp); \ } while (0) #define add_next_index_text(arg, str, duplicate) do { \ @@ -1707,7 +1707,7 @@ Z_TYPE_P(z) = IS_UNICODE; \ } -#define ZVAL_ZSTR(z, zs, type, duplicate) { \ +#define ZVAL_ZSTR(z, type, zs, duplicate) { \ zstr __s=(zs); \ Z_UNILEN_P(z) = (type==IS_UNICODE)?u_strlen(__s.u):strlen(__s.s); \ Z_UNIVAL_P(z) = ZSTR(duplicate? \ @@ -1718,7 +1718,7 @@ Z_TYPE_P(z) = type; \ } -#define ZVAL_ZSTRL(z, zs, type, l, duplicate) { \ +#define ZVAL_ZSTRL(z, type, zs, l, duplicate) { \ zstr __s=(zs); int __l=l; \ Z_UNILEN_P(z) = __l; \ Z_UNIVAL_P(z) = ZSTR(duplicate? \ @@ -1819,8 +1819,8 @@ #define RETVAL_TEXT(t, duplicate) ZVAL_TEXT(return_value, t, duplicate) #define RETVAL_TEXTL(t, l, duplicate) ZVAL_TEXTL(return_value, t, l, duplicate) #define RETVAL_EMPTY_TEXT() ZVAL_EMPTY_TEXT(return_value) -#define RETVAL_ZSTR(s, type, duplicate) ZVAL_ZSTR(return_value, s, type, duplicate) -#define RETVAL_ZSTRL(s, l, type, duplicate) ZVAL_ZSTRL(return_value, s, type, l, duplicate) +#define RETVAL_ZSTR(type, s, duplicate) ZVAL_ZSTR(return_value, type, s, duplicate) +#define RETVAL_ZSTRL(type, s, l, duplicate) ZVAL_ZSTRL(return_value, type, s, l, duplicate) #define RETURN_RESOURCE(l) { RETVAL_RESOURCE(l); return; } #define RETURN_BOOL(b) { RETVAL_BOOL(b); return; } @@ -1848,8 +1848,8 @@ #define RETURN_RT_STRINGL(t, l, flags) { RETVAL_RT_STRINGL(t, l, flags); return; } #define RETURN_UTF8_STRING(t, flags) { RETVAL_UTF8_STRING(t, flags); return; } #define RETURN_UTF8_STRINGL(t, l, flags) { RETVAL_UTF8_STRINGL(t, l, flags); return; } -#define RETURN_ZSTR(s, type, duplicate) { RETVAL_ZSTR(s, type, duplicate); return; } -#define RETURN_ZSTRL(s, l, type, duplicate) { RETVAL_ZSTRL(s, l, type, duplicate); return; } +#define RETURN_ZSTR(type, s, duplicate) { RETVAL_ZSTR(type, s, duplicate); return; } +#define RETURN_ZSTRL(type, s, l, duplicate) { RETVAL_ZSTRL(type, s, l, duplicate); return; } #define SET_VAR_STRING(n, v) { \ { \ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.389&r2=1.390&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.389 ZendEngine2/zend_execute_API.c:1.390 --- ZendEngine2/zend_execute_API.c:1.389 Tue Dec 19 21:12:16 2006 +++ ZendEngine2/zend_execute_API.c Tue Dec 19 21:38:59 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.389 2006/12/19 21:12:16 helly Exp $ */ +/* $Id: zend_execute_API.c,v 1.390 2006/12/19 21:38:59 andrei Exp $ */ #include <stdio.h> #include <signal.h> @@ -1134,7 +1134,7 @@ ALLOC_ZVAL(class_name_ptr); INIT_PZVAL(class_name_ptr); - ZVAL_ZSTRL(class_name_ptr, name, type, name_length, 1); + ZVAL_ZSTRL(class_name_ptr, type, name, name_length, 1); args[0] = &class_name_ptr; http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.267&r2=1.268&diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.267 php-src/ext/reflection/php_reflection.c:1.268 --- php-src/ext/reflection/php_reflection.c:1.267 Tue Dec 19 21:13:21 2006 +++ php-src/ext/reflection/php_reflection.c Tue Dec 19 21:38:59 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c,v 1.267 2006/12/19 21:13:21 helly Exp $ */ +/* $Id: php_reflection.c,v 1.268 2006/12/19 21:38:59 andrei Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1538,7 +1538,7 @@ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); GET_REFLECTION_OBJECT_PTR(fptr); if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment.v) { - RETURN_ZSTRL(fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, ZEND_STR_TYPE, 1); + RETURN_ZSTRL(ZEND_STR_TYPE, fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1); } RETURN_FALSE; } @@ -2190,7 +2190,7 @@ } else { tmp_len = tmp.s - name_str.s; } - ZVAL_ZSTRL(classname, name_str, type, tmp_len, 1); + ZVAL_ZSTRL(classname, type, name_str, tmp_len, 1); name_len = name_len - (tmp_len + 2); if (type == IS_UNICODE) { name_str.u = tmp.u + 2; @@ -2954,7 +2954,7 @@ METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); GET_REFLECTION_OBJECT_PTR(ce); if (ce->type == ZEND_USER_CLASS && ce->doc_comment.v) { - RETURN_ZSTRL(ce->doc_comment, ce->doc_comment_len, ZEND_STR_TYPE, 1); + RETURN_ZSTRL(ZEND_STR_TYPE, ce->doc_comment, ce->doc_comment_len, 1); } RETURN_FALSE; } @@ -4154,7 +4154,7 @@ METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); GET_REFLECTION_OBJECT_PTR(ref); if (ref->prop->doc_comment.v) { - RETURN_ZSTRL(ref->prop->doc_comment, ref->prop->doc_comment_len, ZEND_STR_TYPE, 1); + RETURN_ZSTRL(ZEND_STR_TYPE, ref->prop->doc_comment, ref->prop->doc_comment_len, 1); } RETURN_FALSE; } @@ -4948,7 +4948,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.267 2006/12/19 21:13:21 helly Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.268 2006/12/19 21:38:59 andrei Exp $"); php_info_print_table_end(); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.399&r2=1.400&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.399 php-src/ext/standard/array.c:1.400 --- php-src/ext/standard/array.c:1.399 Tue Dec 19 21:13:21 2006 +++ php-src/ext/standard/array.c Tue Dec 19 21:38:59 2006 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.399 2006/12/19 21:13:21 helly Exp $ */ +/* $Id: array.c,v 1.400 2006/12/19 21:38:59 andrei Exp $ */ #include "php.h" #include "php_ini.h" @@ -1436,7 +1436,7 @@ break; } - ZVAL_ZSTRL(&final_name, var_name, key_type, var_name_len, 1); + ZVAL_ZSTRL(&final_name, key_type, var_name, var_name_len, 1); break; case EXTR_PREFIX_IF_EXISTS: @@ -1447,7 +1447,7 @@ case EXTR_PREFIX_SAME: if (!var_exists && var_name_len != 0) { - ZVAL_ZSTRL(&final_name, var_name, key_type, var_name_len, 1); + ZVAL_ZSTRL(&final_name, key_type, var_name, var_name_len, 1); } /* break omitted intentionally */ @@ -1462,14 +1462,14 @@ if (!php_valid_var_name(var_name, var_name_len, key_type)) { php_prefix_varname(&final_name, prefix, var_name, var_name_len, key_type, 1 TSRMLS_CC); } else { - ZVAL_ZSTRL(&final_name, var_name, key_type, var_name_len, 1); + ZVAL_ZSTRL(&final_name, key_type, var_name, var_name_len, 1); } } break; default: if (!var_exists) { - ZVAL_ZSTRL(&final_name, var_name, key_type, var_name_len, 1); + ZVAL_ZSTRL(&final_name, key_type, var_name, var_name_len, 1); } break; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.839&r2=1.840&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.839 php-src/ext/standard/basic_functions.c:1.840 --- php-src/ext/standard/basic_functions.c:1.839 Tue Dec 19 08:59:26 2006 +++ php-src/ext/standard/basic_functions.c Tue Dec 19 21:38:59 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.839 2006/12/19 08:59:26 dmitry Exp $ */ +/* $Id: basic_functions.c,v 1.840 2006/12/19 21:38:59 andrei Exp $ */ #include "php.h" #include "php_streams.h" @@ -5779,33 +5779,33 @@ /* }}} */ -/* {{{ proto string get_include_path() +/* {{{ proto string get_include_path() U Get the current include_path configuration option */ PHP_FUNCTION(get_include_path) { char *str; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + return; } str = zend_ini_string("include_path", sizeof("include_path"), 0); if (str == NULL) { RETURN_FALSE; } - RETURN_STRING(str, 1); + RETURN_UTF8_STRING(str, ZSTR_DUPLICATE); } /* }}} */ -/* {{{ proto void restore_include_path() +/* {{{ proto void restore_include_path() U Restore the value of the include_path configuration option */ PHP_FUNCTION(restore_include_path) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + return; } - zend_restore_ini_entry("include_path", sizeof("include_path"), PHP_INI_STAGE_RUNTIME); } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.623&r2=1.624&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.623 php-src/ext/standard/string.c:1.624 --- php-src/ext/standard/string.c:1.623 Mon Dec 18 15:04:36 2006 +++ php-src/ext/standard/string.c Tue Dec 19 21:38:59 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.623 2006/12/18 15:04:36 iliaa Exp $ */ +/* $Id: string.c,v 1.624 2006/12/19 21:38:59 andrei Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2033,7 +2033,7 @@ ret_len = php_dirname(ret.s, str_len); } - RETURN_ZSTRL(ret, ret_len, str_type, 0); + RETURN_ZSTRL(str_type, ret, ret_len, 0); } /* }}} */ @@ -3162,7 +3162,7 @@ memcpy(result.s + str_len, ending.s, ending_len); result.s[result_len] = '\0'; } - RETURN_ZSTRL(result, result_len, str_type, 0); + RETURN_ZSTRL(str_type, result, result_len, 0); } if (!str_len) { @@ -3172,7 +3172,7 @@ result.v = php_chunk_split(str.v, str_len, ending.v, ending_len, chunklen, &result_len, str_type); if (result.v) { - RETURN_ZSTRL(result, result_len, str_type, 0); + RETURN_ZSTRL(str_type, result, result_len, 0); } else { RETURN_FALSE; } @@ -5900,7 +5900,7 @@ } if (repl_cnt == 0) { - RETURN_ZSTRL(str, str_len, str_type, 1); + RETURN_ZSTRL(str_type, str, str_len, 1); } new_length = str_len + repl_cnt * (sizeof("<br />") - 1); @@ -5963,7 +5963,7 @@ } - RETURN_ZSTRL(tmp, new_length, str_type, 0); + RETURN_ZSTRL(str_type, tmp, new_length, 0); } /* }}} */ @@ -7441,7 +7441,7 @@ return; } - RETVAL_ZSTRL(str, str_len, str_type, 1); + RETVAL_ZSTRL(str_type, str, str_len, 1); if (Z_UNILEN_P(return_value) > 1) { php_string_shuffle(Z_UNIVAL_P(return_value), Z_UNILEN_P(return_value), Z_TYPE_P(return_value) TSRMLS_CC); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php