cvs: php-src /ext/libxml libxml.c /ext/standard array.c incomplete_class.c streamsfuncs.c var.c /ext/unicode unicode_iterators.c /main main.c
output.c php_variables.c rfc1867.c ZendEngine2 zend.c zend.h zend_API.c zend_API.h zend_builtin_functions.c zend_compile.c zend_compile.h
zend_constants.c zend_execute.c zend_execute.h zend_execute_API.c zend_hash.c zend_interfaces.c zend_language_scanner.l zend_object_handlers.c
zend_objects.c zend_operators.c zend_operators.h zend_vm_def.h zend_vm_execute.h
| From: | Dmitry Stogov | Date: | Sun, 26 Feb 2006 11:57:15 +0000 |
| Subject: | cvs: php-src /ext/libxml libxml.c /ext/standard array.c incomplete_class.c streamsfuncs.c var.c /ext/unicode unicode_iterators.c /main main.c output.c php_variables.c rfc1867.c ZendEngine2 zend.c zend.h zend_API.c zend_API.h zend_builtin_functions.c zend_compile.c zend_compile.h zend_constants.c zend_execute.c zend_execute.h zend_execute_API.c zend_hash.c zend_interfaces.c zend_language_scanner.l zend_object_handlers.c zend_objects.c zend_operators.c zend_operators.h zend_vm_def.h zend_vm_execute.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-37026@lists.php.net to get a copy of this message | ||
dmitry Sun Feb 26 11:57:15 2006 UTC
Modified files:
/ZendEngine2 zend.c zend.h zend_API.c zend_API.h
zend_builtin_functions.c zend_compile.c zend_compile.h
zend_constants.c zend_execute.c zend_execute.h
zend_execute_API.c zend_hash.c zend_interfaces.c
zend_language_scanner.l zend_object_handlers.c
zend_objects.c zend_operators.c zend_operators.h
zend_vm_def.h zend_vm_execute.h
/php-src/ext/libxml libxml.c
/php-src/ext/standard array.c incomplete_class.c streamsfuncs.c
var.c
/php-src/ext/unicode unicode_iterators.c
/php-src/main main.c output.c php_variables.c rfc1867.c
Log:
Unicode support: MS Visual C compatibility
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?r1=1.337&r2=1.338&diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.337 ZendEngine2/zend.c:1.338 --- ZendEngine2/zend.c:1.337 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend.c Sun Feb 26 11:57:13 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.337 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend.c,v 1.338 2006/02/26 11:57:13 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -42,6 +42,11 @@ # define GLOBAL_CONSTANTS_TABLE EG(zend_constants) #endif +#ifndef __GNUC__ +ZEND_API zstr null_zstr; +ZEND_API zstr empty_zstr; +#endif + #if defined(ZEND_WIN32) && ZEND_DEBUG BOOL WINAPI IsDebuggerPresent(VOID); #endif @@ -527,7 +532,7 @@ case IS_OBJECT: { HashTable *properties = NULL; - zstr class_name = (zstr)NULL; + zstr class_name = NULL_ZSTR; zend_uint clen; if (Z_OBJ_HANDLER_P(expr, get_class_name)) { @@ -584,7 +589,7 @@ case IS_OBJECT: { HashTable *properties = NULL; - zstr class_name = (zstr)NULL; + zstr class_name = NULL_ZSTR; zend_uint clen; if (Z_OBJ_HANDLER_P(expr, get_class_name)) { @@ -970,6 +975,11 @@ extern zend_unicode_globals unicode_globals; #endif +#ifndef __GNUC__ + null_zstr.v = NULL; + empty_zstr.u = EMPTY_STR; +#endif + #ifdef ZTS ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor); #else http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.h?r1=1.313&r2=1.314&diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.313 ZendEngine2/zend.h:1.314 --- ZendEngine2/zend.h:1.313 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend.h Sun Feb 26 11:57:13 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.313 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend.h,v 1.314 2006/02/26 11:57:13 dmitry Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -246,6 +246,25 @@ void *v; } zstr; +#ifdef __GNUC__ +# define ZSTR(x) ((zstr)(x)) +# define NULL_ZSTR ZSTR(NULL) +# define EMPTY_ZSTR ZSTR("\0\0") +#else +extern ZEND_API zstr null_zstr; +extern ZEND_API zstr empty_zstr; + +static inline zstr _to_zstr(void *v) { + zstr ret; + ret.v = v; + return ret; +} + +# define ZSTR(x) _to_zstr(x) +# define NULL_ZSTR null_zstr +# define EMPTY_ZSTR empty_zstr +#endif + #define EMPTY_STR ((UChar*)"\0\0") #undef SUCCESS @@ -302,6 +321,10 @@ UChar *val; int len; } ustr; + struct { /* Unicersal string type */ + zstr val; + int len; + } uni; HashTable *ht; /* hash table value */ zend_object_value obj; } zvalue_value; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.348&r2=1.349&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.348 ZendEngine2/zend_API.c:1.349 --- ZendEngine2/zend_API.c:1.348 Fri Feb 24 13:29:54 2006 +++ ZendEngine2/zend_API.c Sun Feb 26 11:57:13 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.348 2006/02/24 13:29:54 helly Exp $ */ +/* $Id: zend_API.c,v 1.349 2006/02/26 11:57:13 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -2889,7 +2889,7 @@ zstr prot_name; int prot_name_length; - zend_u_mangle_property_name(&prot_name, &prot_name_length, type, (zstr)"*", 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); + zend_u_mangle_property_name(&prot_name, &prot_name_length, type, ZSTR("*"), 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); zend_u_hash_update(target_symbol_table, type, prot_name, prot_name_length+1, &property, sizeof(zval *), NULL); property_info.name = prot_name; property_info.name_length = prot_name_length; @@ -2900,7 +2900,7 @@ zstr prot_name; int prot_name_length; - zend_u_mangle_property_name(&prot_name, &prot_name_length, type, (zstr)"*", 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); + zend_u_mangle_property_name(&prot_name, &prot_name_length, type, ZSTR("*"), 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); zend_u_hash_del(target_symbol_table, type, prot_name, prot_name_length+1); pefree(prot_name.v, ce->type & ZEND_INTERNAL_CLASS); } @@ -2924,7 +2924,7 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC) { - return zend_u_declare_property_ex(ce, IS_STRING, (zstr)name, name_length, property, access_type, NULL, 0 TSRMLS_CC); + return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, NULL, 0 TSRMLS_CC); } ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, zstr name, int name_length, zval *property, int access_type TSRMLS_DC) @@ -2934,7 +2934,7 @@ ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC) { - return zend_u_declare_property_ex(ce, IS_STRING, (zstr)name, name_length, property, access_type, NULL, 0 TSRMLS_CC); + return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, NULL, 0 TSRMLS_CC); } ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC) @@ -3251,7 +3251,7 @@ zend_class_entry *old_scope = EG(scope); EG(scope) = scope; - property = zend_std_get_static_property(scope, IS_STRING, (zstr)name, name_length, 0 TSRMLS_CC); + property = zend_std_get_static_property(scope, IS_STRING, ZSTR(name), name_length, 0 TSRMLS_CC); EG(scope) = old_scope; if (!property) { return FAILURE; @@ -3441,7 +3441,7 @@ zend_class_entry *old_scope = EG(scope); EG(scope) = scope; - property = zend_std_get_static_property(scope, IS_STRING, (zstr)name, name_length, silent TSRMLS_CC); + property = zend_std_get_static_property(scope, IS_STRING, ZSTR(name), name_length, silent TSRMLS_CC); EG(scope) = old_scope; return property?*property:NULL; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.h?r1=1.235&r2=1.236&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.235 ZendEngine2/zend_API.h:1.236 --- ZendEngine2/zend_API.h:1.235 Fri Feb 24 13:29:54 2006 +++ ZendEngine2/zend_API.h Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.235 2006/02/24 13:29:54 helly Exp $ */ +/* $Id: zend_API.h,v 1.236 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -927,7 +927,7 @@ } #define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var, _refcount, _is_ref) \ - ZEND_U_SET_SYMBOL_WITH_LENGTH(symtable, IS_STRING, (zstr)name, name_length, var, _refcount, _is_ref) + ZEND_U_SET_SYMBOL_WITH_LENGTH(symtable, IS_STRING, ZSTR(name), name_length, var, _refcount, _is_ref) #define ZEND_SET_GLOBAL_VAR(name, var) \ ZEND_SET_SYMBOL(&EG(symbol_table), name, var) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.305&r2=1.306&diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.305 ZendEngine2/zend_builtin_functions.c:1.306 --- ZendEngine2/zend_builtin_functions.c:1.305 Wed Feb 22 10:02:15 2006 +++ ZendEngine2/zend_builtin_functions.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.305 2006/02/22 10:02:15 dmitry Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.306 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -568,7 +568,7 @@ ZEND_FUNCTION(get_class) { zval **arg; - zstr name = (zstr)EMPTY_STR; + zstr name = EMPTY_ZSTR; zend_uint name_len = 0; int dup; @@ -1776,10 +1776,10 @@ array_init(return_value); while (ptr) { - zstr free_class_name = (zstr)NULL; + zstr free_class_name = NULL_ZSTR; int function_name_string = 1; - class_name = (zstr)NULL; + class_name = NULL_ZSTR; call_type = NULL; arg_array = NULL; @@ -1824,7 +1824,7 @@ class_name = ptr->function_state.function->common.scope->name; call_type = "::"; } else { - class_name = (zstr)NULL; + class_name = NULL_ZSTR; call_type = NULL; } if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.c?r1=1.687&r2=1.688&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.687 ZendEngine2/zend_compile.c:1.688 --- ZendEngine2/zend_compile.c:1.687 Thu Feb 23 18:06:04 2006 +++ ZendEngine2/zend_compile.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.687 2006/02/23 18:06:04 andrei Exp $ */ +/* $Id: zend_compile.c,v 1.688 2006/02/26 11:57:14 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -1109,7 +1109,7 @@ fn_flags = 0; } if ((fn_flags & ZEND_ACC_STATIC) && (fn_flags & ZEND_ACC_ABSTRACT) && !(CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error(E_COMPILE_ERROR, "Static function %v%s%R() cannot be abstract", is_method ? CG(active_class_entry)->name : (zstr)EMPTY_STR, is_method ? "::" : "", Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant)); + zend_error(E_COMPILE_ERROR, "Static function %v%s%R() cannot be abstract", is_method ? CG(active_class_entry)->name : EMPTY_ZSTR, is_method ? "::" : "", Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant)); } function_token->u.op_array = CG(active_op_array); @@ -1361,7 +1361,7 @@ } } else { cur_arg_info->array_type_hint = 1; - cur_arg_info->class_name.v = NULL; + cur_arg_info->class_name = NULL_ZSTR; cur_arg_info->class_name_len = 0; if (op == ZEND_RECV_INIT) { if (Z_TYPE(initialization->u.constant) == IS_NULL || @@ -1375,7 +1375,7 @@ } } } else { - cur_arg_info->class_name.v = NULL; + cur_arg_info->class_name = NULL_ZSTR; cur_arg_info->class_name_len = 0; } opline->result.u.EA.type |= EXT_TYPE_UNUSED; @@ -2209,7 +2209,7 @@ zstr prot_name; int prot_name_length; - zend_u_mangle_property_name(&prot_name, &prot_name_length, utype, (zstr)"*", 1, child_info->name, child_info->name_length, ce->type & ZEND_INTERNAL_CLASS); + zend_u_mangle_property_name(&prot_name, &prot_name_length, utype, ZSTR("*"), 1, child_info->name, child_info->name_length, ce->type & ZEND_INTERNAL_CLASS); if (child_info->flags & ZEND_ACC_STATIC) { zval **prop; HashTable *ht; @@ -4158,7 +4158,7 @@ zend_bool zend_is_auto_global(char *name, uint name_len TSRMLS_DC) { - return zend_u_is_auto_global(IS_STRING, (zstr)name, name_len TSRMLS_CC); + return zend_u_is_auto_global(IS_STRING, ZSTR(name), name_len TSRMLS_CC); } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.h?r1=1.333&r2=1.334&diff_format=u Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.333 ZendEngine2/zend_compile.h:1.334 --- ZendEngine2/zend_compile.h:1.333 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_compile.h Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.333 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_compile.h,v 1.334 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -242,7 +242,7 @@ struct _zend_module_entry *module; } zend_internal_function; -#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : (zstr)EMPTY_STR) +#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : EMPTY_ZSTR) typedef union _zend_function { zend_uchar type; /* MUST be the first element of this struct! */ http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_constants.c?r1=1.80&r2=1.81&diff_format=u Index: ZendEngine2/zend_constants.c diff -u ZendEngine2/zend_constants.c:1.80 ZendEngine2/zend_constants.c:1.81 --- ZendEngine2/zend_constants.c:1.80 Wed Feb 22 10:02:15 2006 +++ ZendEngine2/zend_constants.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_constants.c,v 1.80 2006/02/22 10:02:15 dmitry Exp $ */ +/* $Id: zend_constants.c,v 1.81 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_constants.h" @@ -322,7 +322,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC) { - return zend_u_get_constant(IS_STRING, (zstr)name, name_len, result TSRMLS_CC); + return zend_u_get_constant(IS_STRING, ZSTR(name), name_len, result TSRMLS_CC); } ZEND_API int zend_u_register_constant(zend_uchar type, zend_constant *c TSRMLS_DC) @@ -343,7 +343,7 @@ } else { lookup_name_len = c->name_len; name = c->name; - lookup_name.v = NULL; + lookup_name = NULL_ZSTR; } if (zend_u_hash_add(EG(zend_constants), type, name, lookup_name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.737&r2=1.738&diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.737 ZendEngine2/zend_execute.c:1.738 --- ZendEngine2/zend_execute.c:1.737 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_execute.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.737 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.738 2006/02/26 11:57:14 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -485,7 +485,7 @@ cur_arg_info = &zf->common.arg_info[arg_num-1]; fname = zf->common.function_name; fsep = zf->common.scope ? "::" : ""; - fclass = zf->common.scope ? zf->common.scope->name : (zstr)EMPTY_STR; + fclass = zf->common.scope ? zf->common.scope->name : EMPTY_ZSTR; if (cur_arg_info->class_name.v) { if (!arg) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.h?r1=1.95&r2=1.96&diff_format=u Index: ZendEngine2/zend_execute.h diff -u ZendEngine2/zend_execute.h:1.95 ZendEngine2/zend_execute.h:1.96 --- ZendEngine2/zend_execute.h:1.95 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_execute.h Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.h,v 1.95 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_execute.h,v 1.96 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_EXECUTE_H #define ZEND_EXECUTE_H @@ -203,7 +203,7 @@ /* The following tries to resolve the classname of a zval of type object. * Since it is slow it should be only used in error messages. */ -#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : (zstr)EMPTY_STR) +#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : EMPTY_ZSTR) ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var); http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute_API.c?r1=1.363&r2=1.364&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.363 ZendEngine2/zend_execute_API.c:1.364 --- ZendEngine2/zend_execute_API.c:1.363 Sun Feb 26 07:23:33 2006 +++ ZendEngine2/zend_execute_API.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.363 2006/02/26 07:23:33 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.364 2006/02/26 11:57:14 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -314,7 +314,7 @@ if (space) { *space = ""; } - return (zstr)EMPTY_STR; + return EMPTY_ZSTR; } switch (EG(function_state_ptr)->function->type) { case ZEND_USER_FUNCTION: @@ -325,21 +325,23 @@ if (space) { *space = ce ? "::" : ""; } - return ce ? ce->name : (zstr)EMPTY_STR; + return ce ? ce->name : EMPTY_ZSTR; } default: if (space) { *space = ""; } - return (zstr)EMPTY_STR; + return EMPTY_ZSTR; } } ZEND_API zstr get_active_function_name(TSRMLS_D) { + zstr ret; + if (!zend_is_executing(TSRMLS_C)) { - return (zstr)NULL; + return NULL_ZSTR; } switch (EG(function_state_ptr)->function->type) { case ZEND_USER_FUNCTION: { @@ -347,16 +349,19 @@ if (function_name.v) { return function_name; + } else if (UG(unicode)) { + ret.u = u_main; } else { - return UG(unicode)?(zstr)u_main:(zstr)"main"; + ret.s = "main"; } + return ret; } break; case ZEND_INTERNAL_FUNCTION: return ((zend_internal_function *) EG(function_state_ptr)->function)->function_name; break; default: - return (zstr)NULL; + return NULL_ZSTR; } } @@ -530,13 +535,13 @@ break; case IS_BOOL: case IS_LONG: - zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, (zstr)NULL, 0, Z_LVAL(const_value)); + zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL_ZSTR, 0, Z_LVAL(const_value)); break; case IS_DOUBLE: - zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, (zstr)NULL, 0, (long)Z_DVAL(const_value)); + zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL_ZSTR, 0, (long)Z_DVAL(const_value)); break; case IS_NULL: - zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, (zstr)EMPTY_STR, 1, 0); + zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, EMPTY_ZSTR, 1, 0); break; } zend_hash_move_forward(Z_ARRVAL_P(p)); @@ -865,7 +870,7 @@ } if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { zend_error(E_STRICT, "Function %v%s%v() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : (zstr)EMPTY_STR, + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : EMPTY_ZSTR, EX(function_state).function->common.scope ? "::" : "", EX(function_state).function->common.function_name); } @@ -1134,7 +1139,7 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***ce TSRMLS_DC) { - return zend_u_lookup_class(IS_STRING, (zstr)name, name_length, ce TSRMLS_CC); + return zend_u_lookup_class(IS_STRING, ZSTR(name), name_length, ce TSRMLS_CC); } ZEND_API int zend_u_eval_string(zend_uchar type, zstr string, zval *retval_ptr, char *string_name TSRMLS_DC) @@ -1222,7 +1227,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC) { - return zend_u_eval_string(IS_STRING, (zstr)str, retval_ptr, string_name TSRMLS_CC); + return zend_u_eval_string(IS_STRING, ZSTR(str), retval_ptr, string_name TSRMLS_CC); } ZEND_API int zend_u_eval_string_ex(zend_uchar type, zstr str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) @@ -1239,7 +1244,7 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) { - return zend_u_eval_string_ex(IS_STRING, (zstr)str, retval_ptr, string_name, handle_exceptions TSRMLS_CC); + return zend_u_eval_string_ex(IS_STRING, ZSTR(str), retval_ptr, string_name, handle_exceptions TSRMLS_CC); } @@ -1543,16 +1548,16 @@ zend_class_entry *zend_fetch_class(char *class_name, uint class_name_len, int fetch_type TSRMLS_DC) { - return zend_u_fetch_class(IS_STRING, (zstr)class_name, class_name_len, fetch_type TSRMLS_CC); + return zend_u_fetch_class(IS_STRING, ZSTR(class_name), class_name_len, fetch_type TSRMLS_CC); } #define MAX_ABSTRACT_INFO_CNT 3 #define MAX_ABSTRACT_INFO_FMT "%v%s%v%s" #define DISPLAY_ABSTRACT_FN(idx) \ - ai.afn[idx] ? ZEND_FN_SCOPE_NAME(ai.afn[idx]) : (zstr)EMPTY_STR, \ + ai.afn[idx] ? ZEND_FN_SCOPE_NAME(ai.afn[idx]) : EMPTY_ZSTR, \ ai.afn[idx] ? "::" : "", \ - ai.afn[idx] ? ai.afn[idx]->common.function_name : (zstr)EMPTY_STR, \ + ai.afn[idx] ? ai.afn[idx]->common.function_name : EMPTY_ZSTR, \ ai.afn[idx] && ai.afn[idx+1] ? ", " : (ai.afn[idx] && ai.cnt > MAX_ABSTRACT_INFO_CNT ? ", ..." : "") typedef struct _zend_abstract_info { @@ -1634,7 +1639,7 @@ ZEND_API int zend_delete_global_variable(char *name, int name_len TSRMLS_DC) { - return zend_u_delete_global_variable(IS_STRING, (zstr)name, name_len TSRMLS_CC); + return zend_u_delete_global_variable(IS_STRING, ZSTR(name), name_len TSRMLS_CC); } /* http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_hash.c?r1=1.133&r2=1.134&diff_format=u Index: ZendEngine2/zend_hash.c diff -u ZendEngine2/zend_hash.c:1.133 ZendEngine2/zend_hash.c:1.134 --- ZendEngine2/zend_hash.c:1.133 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_hash.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.c,v 1.133 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_hash.c,v 1.134 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_operators.h" @@ -121,7 +121,7 @@ ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength) { - return zend_u_hash_func(IS_STRING, (zstr)arKey, nKeyLength); + return zend_u_hash_func(IS_STRING, ZSTR(arKey), nKeyLength); } #define UPDATE_DATA(ht, p, pData, nDataSize) \ @@ -312,7 +312,7 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) { - return _zend_u_hash_add_or_update(ht, IS_STRING, (zstr)arKey, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); } ZEND_API int _zend_u_hash_quick_add_or_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) @@ -400,7 +400,7 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) { - return _zend_u_hash_quick_add_or_update(ht, IS_STRING, (zstr)arKey, nKeyLength, h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + return _zend_u_hash_quick_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); } ZEND_API int zend_u_hash_add_empty_element(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength) @@ -414,7 +414,7 @@ { void *dummy = (void *) 1; - return zend_u_hash_add(ht, IS_STRING, (zstr)arKey, nKeyLength, &dummy, sizeof(void *), NULL); + return zend_u_hash_add(ht, IS_STRING, ZSTR(arKey), nKeyLength, &dummy, sizeof(void *), NULL); } @@ -594,7 +594,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) { - return zend_u_hash_del_key_or_index(ht, IS_STRING, (zstr)arKey, nKeyLength, h, flag); + return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, h, flag); } ZEND_API void zend_hash_destroy(HashTable *ht) @@ -830,7 +830,7 @@ if (q->nKeyLength==0) { zend_hash_index_del(ht, q->h); } else { - zend_u_hash_del(ht, q->key.type, (zstr)q->key.arKey.s, q->nKeyLength); + zend_u_hash_del(ht, q->key.type, ZSTR(q->key.arKey.s), q->nKeyLength); } } if (result & ZEND_HASH_APPLY_STOP) { @@ -854,7 +854,7 @@ if (p->nKeyLength == 0) { zend_hash_index_update(target, p->h, p->pData, size, &new_entry); } else { - zend_u_hash_update(target, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, p->pData, size, &new_entry); + zend_u_hash_update(target, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, p->pData, size, &new_entry); } if (pCopyConstructor) { pCopyConstructor(new_entry); @@ -881,7 +881,7 @@ pCopyConstructor(t); } } else { - if (_zend_u_hash_add_or_update(target, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) { + if (_zend_u_hash_add_or_update(target, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) { pCopyConstructor(t); } } @@ -914,7 +914,7 @@ p = source->pListHead; while (p) { if (zend_hash_replace_checker_wrapper(target, p->pData, p, pParam, pMergeSource)) { - if (zend_u_hash_quick_update(target, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { + if (zend_u_hash_quick_update(target, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { pCopyConstructor(t); } } @@ -931,7 +931,7 @@ ZEND_API ulong zend_get_hash_value(char *arKey, uint nKeyLength) { - return zend_u_get_hash_value(IS_STRING, (zstr)arKey, nKeyLength); + return zend_u_get_hash_value(IS_STRING, ZSTR(arKey), nKeyLength); } @@ -973,7 +973,7 @@ ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData) { - return zend_u_hash_find(ht, IS_STRING, (zstr)arKey, nKeyLength, pData); + return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData); } @@ -1016,7 +1016,7 @@ ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData) { - return zend_u_hash_quick_find(ht, IS_STRING, (zstr)arKey, nKeyLength, h, pData); + return zend_u_hash_quick_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, h, pData); } ZEND_API int zend_u_hash_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength) @@ -1052,7 +1052,7 @@ ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength) { - return zend_u_hash_exists(ht, IS_STRING, (zstr)arKey, nKeyLength); + return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength); } ZEND_API int zend_u_hash_quick_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h) @@ -1093,7 +1093,7 @@ ZEND_API int zend_hash_quick_exists(HashTable *ht, char *arKey, uint nKeyLength, ulong h) { - return zend_u_hash_quick_exists(ht, IS_STRING, (zstr)arKey, nKeyLength, h); + return zend_u_hash_quick_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength, h); } ZEND_API int zend_hash_index_find(HashTable *ht, ulong h, void **pData) @@ -1505,7 +1505,7 @@ return 1; } } else { /* string, binary or unicode index */ - if (zend_u_hash_find(ht2, p1->key.type, (zstr)p1->key.arKey.s, p1->nKeyLength, &pData2)==FAILURE) { + if (zend_u_hash_find(ht2, p1->key.type, ZSTR(p1->key.arKey.s), p1->nKeyLength, &pData2)==FAILURE) { HASH_UNPROTECT_RECURSION(ht1); HASH_UNPROTECT_RECURSION(ht2); return 1; @@ -1687,10 +1687,10 @@ if (type == IS_STRING) { key_type = HASH_KEY_IS_STRING; - HANDLE_NUMERIC(arKey.s, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, (zstr)NULL, 0, idx)); + HANDLE_NUMERIC(arKey.s, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx)); } else { key_type = HASH_KEY_IS_UNICODE; - HANDLE_U_NUMERIC(arKey.u, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, (zstr)NULL, 0, idx)); + HANDLE_U_NUMERIC(arKey.u, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx)); } return zend_hash_update_current_key(ht, key_type, arKey, nKeyLength, 0); } @@ -1726,8 +1726,8 @@ ZEND_API int zend_symtable_update_current_key(HashTable *ht, char *arKey, uint nKeyLength) { - HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, (zstr)NULL, 0, idx)); - return zend_hash_update_current_key(ht, HASH_KEY_IS_STRING, (zstr)arKey, nKeyLength, 0); + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx)); + return zend_hash_update_current_key(ht, HASH_KEY_IS_STRING, ZSTR(arKey), nKeyLength, 0); } ZEND_API void zend_hash_to_unicode(HashTable *ht, apply_func_t apply_func TSRMLS_DC) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_interfaces.c?r1=1.49&r2=1.50&diff_format=u Index: ZendEngine2/zend_interfaces.c diff -u ZendEngine2/zend_interfaces.c:1.49 ZendEngine2/zend_interfaces.c:1.50 --- ZendEngine2/zend_interfaces.c:1.49 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_interfaces.c Sun Feb 26 11:57:14 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_interfaces.c,v 1.49 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_interfaces.c,v 1.50 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -76,7 +76,7 @@ if (!fn_proxy || !*fn_proxy) { if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { /* error at c-level */ - zend_error(E_CORE_ERROR, "Couldn't find implementation for method %v%s%s", obj_ce ? obj_ce->name : (zstr)EMPTY_STR, obj_ce ? "::" : "", function_name); + zend_error(E_CORE_ERROR, "Couldn't find implementation for method %v%s%s", obj_ce ? obj_ce->name : EMPTY_ZSTR, obj_ce ? "::" : "", function_name); } if (fn_proxy) { *fn_proxy = fcic.function_handler; @@ -93,7 +93,7 @@ if (!obj_ce) { obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; } - zend_error(E_CORE_ERROR, "Couldn't execute method %v%s%s", obj_ce ? obj_ce->name : (zstr)EMPTY_STR, obj_ce ? "::" : "", function_name); + zend_error(E_CORE_ERROR, "Couldn't execute method %v%s%s", obj_ce ? obj_ce->name : EMPTY_ZSTR, obj_ce ? "::" : "", function_name); } if (!retval_ptr_ptr) { if (retval) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_language_scanner.l?r1=1.147&r2=1.148&diff_format=u Index: ZendEngine2/zend_language_scanner.l diff -u ZendEngine2/zend_language_scanner.l:1.147 ZendEngine2/zend_language_scanner.l:1.148 --- ZendEngine2/zend_language_scanner.l:1.147 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_language_scanner.l Sun Feb 26 11:57:14 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_language_scanner.l,v 1.147 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_language_scanner.l,v 1.148 2006/02/26 11:57:14 dmitry Exp $ */ #define yyleng SCNG(yy_leng) #define yytext SCNG(yy_text) @@ -1891,7 +1891,7 @@ } <ST_IN_SCRIPTING>"__CLASS__" { - zstr class_name = (zstr)NULL; + zstr class_name = NULL_ZSTR; if (CG(active_class_entry)) { class_name = CG(active_class_entry)->name; @@ -1906,7 +1906,7 @@ } <ST_IN_SCRIPTING>"__FUNCTION__" { - zstr func_name = (zstr)NULL; + zstr func_name = NULL_ZSTR; if (CG(active_op_array)) { func_name = CG(active_op_array)->function_name; @@ -1921,8 +1921,8 @@ } <ST_IN_SCRIPTING>"__METHOD__" { - zstr class_name = CG(active_class_entry) ? CG(active_class_entry)->name : (zstr)NULL; - zstr func_name = CG(active_op_array)? CG(active_op_array)->function_name : (zstr)NULL; + zstr class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL_ZSTR; + zstr func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL_ZSTR; size_t len = 0; if (UG(unicode)) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_object_handlers.c?r1=1.160&r2=1.161&diff_format=u Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.160 ZendEngine2/zend_object_handlers.c:1.161 --- ZendEngine2/zend_object_handlers.c:1.160 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_object_handlers.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.c,v 1.160 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_object_handlers.c,v 1.161 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -792,14 +792,14 @@ */ updated_fbc = zend_check_private_int(fbc, Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC); if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } fbc = updated_fbc; } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(fbc->common.scope, EG(scope))) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } @@ -839,14 +839,14 @@ */ updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC); if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } fbc = updated_fbc; } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(EG(scope), fbc->common.scope)) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } @@ -915,13 +915,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC) != EG(scope)) { - zend_error(E_ERROR, "Call to private %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to private %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(constructor->common.scope, EG(scope))) { - zend_error(E_ERROR, "Call to protected %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to protected %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_objects.c?r1=1.63&r2=1.64&diff_format=u Index: ZendEngine2/zend_objects.c diff -u ZendEngine2/zend_objects.c:1.63 ZendEngine2/zend_objects.c:1.64 --- ZendEngine2/zend_objects.c:1.63 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_objects.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_objects.c,v 1.63 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_objects.c,v 1.64 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -44,7 +44,7 @@ zend_error(EG(in_execution) ? E_ERROR : E_WARNING, "Call to private %v::__destruct() from context '%v'%s", ce->name, - EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR, + EG(scope) ? EG(scope)->name : EMPTY_ZSTR, EG(in_execution) ? "" : " during shutdown ignored"); return; } @@ -57,7 +57,7 @@ zend_error(EG(in_execution) ? E_ERROR : E_WARNING, "Call to protected %v::__destruct() from context '%v'%s", ce->name, - EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR, + EG(scope) ? EG(scope)->name : EMPTY_ZSTR, EG(in_execution) ? "" : " during shutdown ignored"); return; } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_operators.c?r1=1.234&r2=1.235&diff_format=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.234 ZendEngine2/zend_operators.c:1.235 --- ZendEngine2/zend_operators.c:1.234 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_operators.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.c,v 1.234 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_operators.c,v 1.235 2006/02/26 11:57:14 dmitry Exp $ */ #include <ctype.h> @@ -2084,17 +2084,24 @@ return dest; } else { - return (zstr)zend_str_tolower_copy(dest.s, source.s, length); + zstr ret; + + ret.s = zend_str_tolower_copy(dest.s, source.s, length); + return ret; } } ZEND_API zstr zend_u_str_tolower_dup(zend_uchar type, zstr source, unsigned int length) { + zstr ret; + if (type == IS_UNICODE) { - return zend_u_str_tolower_copy(IS_UNICODE, (zstr)emalloc(UBYTES(length+1)), source, length); + ret.u = eumalloc(length+1); + ret = zend_u_str_tolower_copy(IS_UNICODE, ret, source, length); } else { - return (zstr)zend_str_tolower_copy((char*)emalloc(length+1), source.s, length); + ret.s = zend_str_tolower_copy((char*)emalloc(length+1), source.s, length); } + return ret; } ZEND_API void zend_str_tolower(char *str, unsigned int length) @@ -2124,24 +2131,25 @@ ZEND_API zstr zend_u_str_case_fold(zend_uchar type, zstr source, unsigned int length, zend_bool normalize, unsigned int *new_len) { + zstr ret; + if (type == IS_UNICODE) { - UChar *ret; int ret_len; if (normalize) { - zend_normalize_identifier(&ret, &ret_len, source.u, length, 1); + zend_normalize_identifier(&ret.u, &ret_len, source.u, length, 1); } else { UErrorCode status = U_ZERO_ERROR; - zend_case_fold_string(&ret, &ret_len, source.u, length, U_FOLD_CASE_DEFAULT, &status); + zend_case_fold_string(&ret.u, &ret_len, source.u, length, U_FOLD_CASE_DEFAULT, &status); } *new_len = ret_len; - return (zstr)ret; - } else { + } else { *new_len = length; - return (zstr)zend_str_tolower_dup(source.s, length); + ret.s = zend_str_tolower_dup(source.s, length); } + return ret; } ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_operators.h?r1=1.109&r2=1.110&diff_format=u Index: ZendEngine2/zend_operators.h diff -u ZendEngine2/zend_operators.h:1.109 ZendEngine2/zend_operators.h:1.110 --- ZendEngine2/zend_operators.h:1.109 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_operators.h Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.h,v 1.109 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_operators.h,v 1.110 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_OPERATORS_H #define ZEND_OPERATORS_H @@ -388,8 +388,8 @@ #define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC) #define Z_OBJ_HANDLER(zval, hf) Z_OBJ_HT((zval))->hf #define Z_RESVAL(zval) (zval).value.lval -#define Z_UNIVAL(zval) ((zstr)(Z_STRVAL(zval))) -#define Z_UNILEN(zval) Z_STRLEN(zval) +#define Z_UNIVAL(zval) (zval).value.uni.val +#define Z_UNILEN(zval) (zval).value.uni.len #define Z_LVAL_P(zval_p) Z_LVAL(*zval_p) #define Z_BVAL_P(zval_p) Z_BVAL(*zval_p) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_def.h?r1=1.99&r2=1.100&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.99 ZendEngine2/zend_vm_def.h:1.100 --- ZendEngine2/zend_vm_def.h:1.99 Sat Feb 25 17:43:12 2006 +++ ZendEngine2/zend_vm_def.h Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.99 2006/02/25 17:43:12 helly Exp $ */ +/* $Id: zend_vm_def.h,v 1.100 2006/02/26 11:57:14 dmitry Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -1821,7 +1821,7 @@ } if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { zend_error(E_STRICT, "Function %v%s%v() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : (zstr)EMPTY_STR, + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : EMPTY_ZSTR, EX(function_state).function->common.scope ? "::" : "", EX(function_state).function->common.function_name); } @@ -2509,13 +2509,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_execute.h?r1=1.103&r2=1.104&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.103 ZendEngine2/zend_vm_execute.h:1.104 --- ZendEngine2/zend_vm_execute.h:1.103 Sat Feb 25 17:43:12 2006 +++ ZendEngine2/zend_vm_execute.h Sun Feb 26 11:57:14 2006 @@ -147,7 +147,7 @@ } if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { zend_error(E_STRICT, "Function %v%s%v() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : (zstr)EMPTY_STR, + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : EMPTY_ZSTR, EX(function_state).function->common.scope ? "::" : "", EX(function_state).function->common.function_name); } @@ -1720,13 +1720,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -4220,13 +4220,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -7317,13 +7317,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -14423,13 +14423,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -19951,13 +19951,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } http://cvs.php.net/viewcvs.cgi/php-src/ext/libxml/libxml.c?r1=1.44&r2=1.45&diff_format=u Index: php-src/ext/libxml/libxml.c diff -u php-src/ext/libxml/libxml.c:1.44 php-src/ext/libxml/libxml.c:1.45 --- php-src/ext/libxml/libxml.c:1.44 Tue Feb 21 20:12:42 2006 +++ php-src/ext/libxml/libxml.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: libxml.c,v 1.44 2006/02/21 20:12:42 dmitry Exp $ */ +/* $Id: libxml.c,v 1.45 2006/02/26 11:57:14 dmitry Exp $ */ #define IS_EXT_MODULE @@ -843,12 +843,12 @@ if (zend_hash_add(&php_libxml_exports, ce->name.s, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL) == SUCCESS) { int ret; - UChar *uname; + zstr name; - uname = malloc(UBYTES(ce->name_length+1)); - u_charsToUChars(ce->name.s, uname, ce->name_length+1); - ret = zend_u_hash_add(&php_libxml_exports, IS_UNICODE, (zstr)uname, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL); - free(uname); + name.u = malloc(UBYTES(ce->name_length+1)); + u_charsToUChars(ce->name.s, name.u, ce->name_length+1); + ret = zend_u_hash_add(&php_libxml_exports, IS_UNICODE, name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL); + free(name.u); return ret; } return FAILURE; http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/array.c?r1=1.342&r2=1.343&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.342 php-src/ext/standard/array.c:1.343 --- php-src/ext/standard/array.c:1.342 Wed Feb 22 13:10:32 2006 +++ php-src/ext/standard/array.c Sun Feb 26 11:57:14 2006 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.342 2006/02/22 13:10:32 dmitry Exp $ */ +/* $Id: array.c,v 1.343 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "php_ini.h" @@ -1988,7 +1988,7 @@ if (p->nKeyLength == 0) { zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, &entry, sizeof(zval *), NULL); + zend_u_hash_update(out_hash, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, &entry, sizeof(zval *), NULL); } } @@ -2000,7 +2000,7 @@ if (p->nKeyLength == 0) { zend_hash_next_index_insert(*removed, &entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(*removed, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, &entry, sizeof(zval *), NULL); + zend_u_hash_update(*removed, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, &entry, sizeof(zval *), NULL); } } } else /* otherwise just skip those entries */ @@ -2033,7 +2033,7 @@ if (p->nKeyLength == 0) { zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, &entry, sizeof(zval *), NULL); + zend_u_hash_update(out_hash, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, &entry, sizeof(zval *), NULL); } } @@ -2094,7 +2094,7 @@ { zval **stack, /* Input stack */ **val; /* Value to be popped */ - zstr key = (zstr)NULL; + zstr key = NULL_ZSTR; int key_len = 0; ulong index; zend_uchar key_type; @@ -3043,9 +3043,9 @@ zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { if (Z_ARRVAL_P(return_value) == &EG(symbol_table)) { - zend_u_delete_global_variable(p->key.type, (zstr)p->key.arKey.s, p->nKeyLength-1 TSRMLS_CC); + zend_u_delete_global_variable(p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength-1 TSRMLS_CC); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } } } @@ -3303,7 +3303,7 @@ if (p->nKeyLength == 0) { zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } } } @@ -3319,7 +3319,7 @@ if (p->nKeyLength == 0) { zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } if (!*++ptrs[0]) { goto out; @@ -3702,7 +3702,7 @@ if (p->nKeyLength == 0) { zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } if (!*++ptrs[0]) { goto out; http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/incomplete_class.c?r1=1.31&r2=1.32&diff_format=u Index: php-src/ext/standard/incomplete_class.c diff -u php-src/ext/standard/incomplete_class.c:1.31 php-src/ext/standard/incomplete_class.c:1.32 --- php-src/ext/standard/incomplete_class.c:1.31 Tue Feb 21 20:12:42 2006 +++ php-src/ext/standard/incomplete_class.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ */ -/* $Id: incomplete_class.c,v 1.31 2006/02/21 20:12:42 dmitry Exp $ */ +/* $Id: incomplete_class.c,v 1.32 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "basic_functions.h" @@ -126,7 +126,7 @@ PHPAPI zstr php_lookup_class_name(zval *object, zend_uint *nlen) { zval **val; - zstr retval = (zstr)NULL; + zstr retval = NULL_ZSTR; HashTable *object_properties; TSRMLS_FETCH(); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.64&r2=1.65&diff_format=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.64 php-src/ext/standard/streamsfuncs.c:1.65 --- php-src/ext/standard/streamsfuncs.c:1.64 Thu Feb 23 18:28:37 2006 +++ php-src/ext/standard/streamsfuncs.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.c,v 1.64 2006/02/23 18:28:37 iliaa Exp $ */ +/* $Id: streamsfuncs.c,v 1.65 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -907,20 +907,8 @@ { int ret = SUCCESS; zval **tmp; - U_STRING_DECL(u_notification, "notification", 12); - U_STRING_DECL(u_options, "options", 7); - U_STRING_DECL(u_input_encoding, "input_encoding", 14); - U_STRING_DECL(u_output_encoding, "output_encoding", 15); - U_STRING_DECL(u_default_mode, "default_mode", 12); - - U_STRING_INIT(u_notification, "notification", 12); - U_STRING_INIT(u_options, "options", 7); - U_STRING_INIT(u_input_encoding, "input_encoding", 14); - U_STRING_INIT(u_output_encoding, "output_encoding", 15); - U_STRING_INIT(u_default_mode, "default_mode", 12); - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_notification, sizeof("notification"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp)) { if (context->notifier) { php_stream_notification_free(context->notifier); @@ -933,12 +921,10 @@ ZVAL_ADDREF(*tmp); context->notifier->dtor = user_space_stream_notifier_dtor; } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_options, sizeof("options"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp)) { parse_context_options(context, *tmp TSRMLS_CC); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_input_encoding, sizeof("input_encoding"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp)) { zval strval = **tmp; if (context->input_encoding) { @@ -949,8 +935,7 @@ convert_to_string(&strval); context->input_encoding = Z_STRVAL(strval); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_output_encoding, sizeof("output_encoding"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp)) { zval strval = **tmp; if (context->output_encoding) { @@ -961,8 +946,7 @@ convert_to_string(&strval); context->output_encoding = Z_STRVAL(strval); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_default_mode, sizeof("default_mode"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp)) { zval longval = **tmp; zval_copy_ctor(&longval); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/var.c?r1=1.221&r2=1.222&diff_format=u Index: php-src/ext/standard/var.c diff -u php-src/ext/standard/var.c:1.221 php-src/ext/standard/var.c:1.222 --- php-src/ext/standard/var.c:1.221 Wed Feb 22 14:20:54 2006 +++ php-src/ext/standard/var.c Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c,v 1.221 2006/02/22 14:20:54 dmitry Exp $ */ +/* $Id: var.c,v 1.222 2006/02/26 11:57:14 dmitry Exp $ */ @@ -684,6 +684,9 @@ { int count; zend_bool incomplete_class; + zstr star; + + star.s = "*"; incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); /* count after serializing name, since php_var_serialize_class_name @@ -762,7 +765,7 @@ break; } efree(priv_name.v); - zend_u_mangle_property_name(&prot_name, &prop_name_length, Z_TYPE_PP(name), (zstr)"*", 1, + zend_u_mangle_property_name(&prot_name, &prop_name_length, Z_TYPE_PP(name), star, 1, Z_UNIVAL_PP(name), Z_UNILEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); if (zend_u_hash_find(Z_OBJPROP_PP(struc), Z_TYPE_PP(name), prot_name, prop_name_length+1, (void *) &d) == SUCCESS) { if (Z_TYPE_PP(name) == IS_UNICODE) { http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode_iterators.c?r1=1.22&r2=1.23&diff_format=u Index: php-src/ext/unicode/unicode_iterators.c diff -u php-src/ext/unicode/unicode_iterators.c:1.22 php-src/ext/unicode/unicode_iterators.c:1.23 --- php-src/ext/unicode/unicode_iterators.c:1.22 Fri Feb 17 08:24:56 2006 +++ php-src/ext/unicode/unicode_iterators.c Sun Feb 26 11:57:14 2006 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: unicode_iterators.c,v 1.22 2006/02/17 08:24:56 helly Exp $ */ +/* $Id: unicode_iterators.c,v 1.23 2006/02/26 11:57:14 dmitry Exp $ */ /* * TODO @@ -415,7 +415,7 @@ *data = &obj->current; } -static int text_iter_get_current_key(zend_object_iterator* iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) +static int text_iter_get_current_key(zend_object_iterator* iter, zstr *str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) { text_iter_obj* obj = text_iter_to_obj(iter); http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.665&r2=1.666&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.665 php-src/main/main.c:1.666 --- php-src/main/main.c:1.665 Tue Feb 21 20:12:42 2006 +++ php-src/main/main.c Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.665 2006/02/21 20:12:42 dmitry Exp $ */ +/* $Id: main.c,v 1.666 2006/02/26 11:57:14 dmitry Exp $ */ /* {{{ includes */ @@ -550,7 +550,7 @@ char *space; zstr class_name = get_active_class_name(&space TSRMLS_CC); int origin_len; - zstr function = (zstr)NULL; + zstr function = NULL_ZSTR; char *origin; char *message; char *stage; http://cvs.php.net/viewcvs.cgi/php-src/main/output.c?r1=1.174&r2=1.175&diff_format=u Index: php-src/main/output.c diff -u php-src/main/output.c:1.174 php-src/main/output.c:1.175 --- php-src/main/output.c:1.174 Tue Feb 21 20:12:43 2006 +++ php-src/main/output.c Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.174 2006/02/21 20:12:43 dmitry Exp $ */ +/* $Id: output.c,v 1.175 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -500,58 +500,58 @@ zval *handler_zval; if (output_handler && output_handler->type == IS_STRING) { - char* next_handler_name; - char* handler_name = Z_STRVAL_P(output_handler); - handler_len = Z_STRLEN_P(output_handler); + zstr next_handler_name; + zstr handler_name = Z_UNIVAL_P(output_handler); + handler_len = Z_UNILEN_P(output_handler); result = SUCCESS; - if (handler_len && handler_name[0] != '\0') { - while ((next_handler_name=strchr(handler_name, ',')) != NULL) { - len = next_handler_name-handler_name; - next_handler_name = estrndup(handler_name, len); - handler_zval = php_ob_handler_from_string(next_handler_name, len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_STRING, (zstr)next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + if (handler_len && handler_name.s[0] != '\0') { + while ((next_handler_name.s=strchr(handler_name.s, ',')) != NULL) { + len = next_handler_name.s-handler_name.s; + next_handler_name.s = estrndup(handler_name.s, len); + handler_zval = php_ob_handler_from_string(next_handler_name.s, len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_STRING, next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); } - handler_name += len+1; + handler_name.s += len+1; handler_len -= len+1; - efree(next_handler_name); + efree(next_handler_name.s); } } if (result == SUCCESS) { - handler_zval = php_ob_handler_from_string(handler_name, handler_len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_STRING, (zstr)handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + handler_zval = php_ob_handler_from_string(handler_name.s, handler_len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_STRING, handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); } } } else if (output_handler && output_handler->type == IS_UNICODE) { - UChar* next_handler_name; - UChar* handler_name = Z_USTRVAL_P(output_handler); - handler_len = Z_USTRLEN_P(output_handler); + zstr next_handler_name; + zstr handler_name = Z_UNIVAL_P(output_handler); + handler_len = Z_UNILEN_P(output_handler); result = SUCCESS; - if (handler_len && handler_name[0] != 0) { - while ((next_handler_name=u_strchr(handler_name, ',')) != NULL) { - len = next_handler_name-handler_name; - next_handler_name = eustrndup(handler_name, len); - handler_zval = php_ob_handler_from_unicode(next_handler_name, len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_UNICODE, (zstr)next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + if (handler_len && handler_name.u[0] != 0) { + while ((next_handler_name.u=u_strchr(handler_name.u, ',')) != NULL) { + len = next_handler_name.u-handler_name.u; + next_handler_name.u = eustrndup(handler_name.u, len); + handler_zval = php_ob_handler_from_unicode(next_handler_name.u, len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_UNICODE, next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); } - handler_name += len+1; + handler_name.u += len+1; handler_len -= len+1; - efree(next_handler_name); + efree(next_handler_name.u); } } if (result == SUCCESS) { - handler_zval = php_ob_handler_from_unicode(handler_name, handler_len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_UNICODE, (zstr)handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + handler_zval = php_ob_handler_from_unicode(handler_name.u, handler_len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_UNICODE, handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); @@ -582,7 +582,10 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, "No method name given: use ob_start(array($object,'method')) to specify instance $object and the name of a method of class %v to use as output handler", Z_OBJCE_P(output_handler)->name); result = FAILURE; } else { - result = php_ob_init_named(initial_size, block_size, IS_STRING, (zstr)OB_DEFAULT_HANDLER_NAME, NULL, chunk_size, erase TSRMLS_CC); + zstr z_name; + + z_name.s = OB_DEFAULT_HANDLER_NAME; + result = php_ob_init_named(initial_size, block_size, IS_STRING, z_name, NULL, chunk_size, erase TSRMLS_CC); } return result; } http://cvs.php.net/viewcvs.cgi/php-src/main/php_variables.c?r1=1.115&r2=1.116&diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.115 php-src/main/php_variables.c:1.116 --- php-src/main/php_variables.c:1.115 Tue Feb 21 20:12:43 2006 +++ php-src/main/php_variables.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.115 2006/02/21 20:12:43 dmitry Exp $ */ +/* $Id: php_variables.c,v 1.116 2006/02/26 11:57:14 dmitry Exp $ */ #include <stdio.h> #include "php.h" @@ -296,7 +296,8 @@ while (1) { if (is_array) { - UChar *escaped_index = NULL, *index_s; + zstr escaped_index = NULL_ZSTR; + UChar *index_s; int32_t new_idx_len = 0; ip++; @@ -332,18 +333,18 @@ /* UTODO fix for magic_quotes_gpc case */ /* no need to addslashes() the index if it's the main variable name */ //escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - escaped_index = index; + escaped_index.u = index; } else { - escaped_index = index; + escaped_index.u = index; } - if (zend_u_symtable_find(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE + if (zend_u_symtable_find(symtable1, IS_UNICODE, escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) { MAKE_STD_ZVAL(gpc_element); array_init(gpc_element); - zend_u_symtable_update(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); + zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); } - if (index!=escaped_index) { - efree(escaped_index); + if (index!=escaped_index.u) { + efree(escaped_index.u); } } symtable1 = Z_ARRVAL_PP(gpc_element_p); @@ -368,8 +369,10 @@ } else { /* UTODO fix for php_addslashes case */ //char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - UChar *escaped_index = index; - zend_u_symtable_update(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); + zstr escaped_index; + + escaped_index.u = index; + zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); //efree(escaped_index); } break; http://cvs.php.net/viewcvs.cgi/php-src/main/rfc1867.c?r1=1.181&r2=1.182&diff_format=u Index: php-src/main/rfc1867.c diff -u php-src/main/rfc1867.c:1.181 php-src/main/rfc1867.c:1.182 --- php-src/main/rfc1867.c:1.181 Tue Feb 21 20:12:43 2006 +++ php-src/main/rfc1867.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: rfc1867.c,v 1.181 2006/02/21 20:12:43 dmitry Exp $ */ +/* $Id: rfc1867.c,v 1.182 2006/02/26 11:57:14 dmitry Exp $ */ /* * This product includes software developed by the Apache Group @@ -264,7 +264,7 @@ int dummy=1; normalize_u_protected_variable(varname TSRMLS_CC); - zend_u_hash_add(&PG(rfc1867_protected_variables), IS_UNICODE, (zstr)varname, u_strlen(varname)+1, &dummy, sizeof(int), NULL); + zend_u_hash_add(&PG(rfc1867_protected_variables), IS_UNICODE, ZSTR(varname), u_strlen(varname)+1, &dummy, sizeof(int), NULL); } @@ -278,7 +278,7 @@ static zend_bool is_u_protected_variable(UChar *varname TSRMLS_DC) { normalize_u_protected_variable(varname TSRMLS_CC); - return zend_u_hash_exists(&PG(rfc1867_protected_variables), IS_UNICODE, (zstr)varname, u_strlen(varname)+1); + return zend_u_hash_exists(&PG(rfc1867_protected_variables), IS_UNICODE, ZSTR(varname), u_strlen(varname)+1); } @@ -1316,7 +1316,7 @@ } temp_filename = EMPTY_STR; } else { - zend_u_hash_add(SG(rfc1867_uploaded_files), IS_UNICODE, (zstr)temp_filename, u_strlen(temp_filename) + 1, &temp_filename, sizeof(UChar *), NULL); + zend_u_hash_add(SG(rfc1867_uploaded_files), IS_UNICODE, ZSTR(temp_filename), u_strlen(temp_filename) + 1, &temp_filename, sizeof(UChar *), NULL); } /* is_arr_upload is true when name of file upload field
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?r1=1.337&r2=1.338&diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.337 ZendEngine2/zend.c:1.338 --- ZendEngine2/zend.c:1.337 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend.c Sun Feb 26 11:57:13 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.337 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend.c,v 1.338 2006/02/26 11:57:13 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -42,6 +42,11 @@ # define GLOBAL_CONSTANTS_TABLE EG(zend_constants) #endif +#ifndef __GNUC__ +ZEND_API zstr null_zstr; +ZEND_API zstr empty_zstr; +#endif + #if defined(ZEND_WIN32) && ZEND_DEBUG BOOL WINAPI IsDebuggerPresent(VOID); #endif @@ -527,7 +532,7 @@ case IS_OBJECT: { HashTable *properties = NULL; - zstr class_name = (zstr)NULL; + zstr class_name = NULL_ZSTR; zend_uint clen; if (Z_OBJ_HANDLER_P(expr, get_class_name)) { @@ -584,7 +589,7 @@ case IS_OBJECT: { HashTable *properties = NULL; - zstr class_name = (zstr)NULL; + zstr class_name = NULL_ZSTR; zend_uint clen; if (Z_OBJ_HANDLER_P(expr, get_class_name)) { @@ -970,6 +975,11 @@ extern zend_unicode_globals unicode_globals; #endif +#ifndef __GNUC__ + null_zstr.v = NULL; + empty_zstr.u = EMPTY_STR; +#endif + #ifdef ZTS ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor); #else http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.h?r1=1.313&r2=1.314&diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.313 ZendEngine2/zend.h:1.314 --- ZendEngine2/zend.h:1.313 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend.h Sun Feb 26 11:57:13 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.313 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend.h,v 1.314 2006/02/26 11:57:13 dmitry Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -246,6 +246,25 @@ void *v; } zstr; +#ifdef __GNUC__ +# define ZSTR(x) ((zstr)(x)) +# define NULL_ZSTR ZSTR(NULL) +# define EMPTY_ZSTR ZSTR("\0\0") +#else +extern ZEND_API zstr null_zstr; +extern ZEND_API zstr empty_zstr; + +static inline zstr _to_zstr(void *v) { + zstr ret; + ret.v = v; + return ret; +} + +# define ZSTR(x) _to_zstr(x) +# define NULL_ZSTR null_zstr +# define EMPTY_ZSTR empty_zstr +#endif + #define EMPTY_STR ((UChar*)"\0\0") #undef SUCCESS @@ -302,6 +321,10 @@ UChar *val; int len; } ustr; + struct { /* Unicersal string type */ + zstr val; + int len; + } uni; HashTable *ht; /* hash table value */ zend_object_value obj; } zvalue_value; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.348&r2=1.349&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.348 ZendEngine2/zend_API.c:1.349 --- ZendEngine2/zend_API.c:1.348 Fri Feb 24 13:29:54 2006 +++ ZendEngine2/zend_API.c Sun Feb 26 11:57:13 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.348 2006/02/24 13:29:54 helly Exp $ */ +/* $Id: zend_API.c,v 1.349 2006/02/26 11:57:13 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -2889,7 +2889,7 @@ zstr prot_name; int prot_name_length; - zend_u_mangle_property_name(&prot_name, &prot_name_length, type, (zstr)"*", 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); + zend_u_mangle_property_name(&prot_name, &prot_name_length, type, ZSTR("*"), 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); zend_u_hash_update(target_symbol_table, type, prot_name, prot_name_length+1, &property, sizeof(zval *), NULL); property_info.name = prot_name; property_info.name_length = prot_name_length; @@ -2900,7 +2900,7 @@ zstr prot_name; int prot_name_length; - zend_u_mangle_property_name(&prot_name, &prot_name_length, type, (zstr)"*", 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); + zend_u_mangle_property_name(&prot_name, &prot_name_length, type, ZSTR("*"), 1, name, name_length, ce->type & ZEND_INTERNAL_CLASS); zend_u_hash_del(target_symbol_table, type, prot_name, prot_name_length+1); pefree(prot_name.v, ce->type & ZEND_INTERNAL_CLASS); } @@ -2924,7 +2924,7 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC) { - return zend_u_declare_property_ex(ce, IS_STRING, (zstr)name, name_length, property, access_type, NULL, 0 TSRMLS_CC); + return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, NULL, 0 TSRMLS_CC); } ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, zstr name, int name_length, zval *property, int access_type TSRMLS_DC) @@ -2934,7 +2934,7 @@ ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC) { - return zend_u_declare_property_ex(ce, IS_STRING, (zstr)name, name_length, property, access_type, NULL, 0 TSRMLS_CC); + return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, NULL, 0 TSRMLS_CC); } ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC) @@ -3251,7 +3251,7 @@ zend_class_entry *old_scope = EG(scope); EG(scope) = scope; - property = zend_std_get_static_property(scope, IS_STRING, (zstr)name, name_length, 0 TSRMLS_CC); + property = zend_std_get_static_property(scope, IS_STRING, ZSTR(name), name_length, 0 TSRMLS_CC); EG(scope) = old_scope; if (!property) { return FAILURE; @@ -3441,7 +3441,7 @@ zend_class_entry *old_scope = EG(scope); EG(scope) = scope; - property = zend_std_get_static_property(scope, IS_STRING, (zstr)name, name_length, silent TSRMLS_CC); + property = zend_std_get_static_property(scope, IS_STRING, ZSTR(name), name_length, silent TSRMLS_CC); EG(scope) = old_scope; return property?*property:NULL; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.h?r1=1.235&r2=1.236&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.235 ZendEngine2/zend_API.h:1.236 --- ZendEngine2/zend_API.h:1.235 Fri Feb 24 13:29:54 2006 +++ ZendEngine2/zend_API.h Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.235 2006/02/24 13:29:54 helly Exp $ */ +/* $Id: zend_API.h,v 1.236 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -927,7 +927,7 @@ } #define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var, _refcount, _is_ref) \ - ZEND_U_SET_SYMBOL_WITH_LENGTH(symtable, IS_STRING, (zstr)name, name_length, var, _refcount, _is_ref) + ZEND_U_SET_SYMBOL_WITH_LENGTH(symtable, IS_STRING, ZSTR(name), name_length, var, _refcount, _is_ref) #define ZEND_SET_GLOBAL_VAR(name, var) \ ZEND_SET_SYMBOL(&EG(symbol_table), name, var) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.305&r2=1.306&diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.305 ZendEngine2/zend_builtin_functions.c:1.306 --- ZendEngine2/zend_builtin_functions.c:1.305 Wed Feb 22 10:02:15 2006 +++ ZendEngine2/zend_builtin_functions.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.305 2006/02/22 10:02:15 dmitry Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.306 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -568,7 +568,7 @@ ZEND_FUNCTION(get_class) { zval **arg; - zstr name = (zstr)EMPTY_STR; + zstr name = EMPTY_ZSTR; zend_uint name_len = 0; int dup; @@ -1776,10 +1776,10 @@ array_init(return_value); while (ptr) { - zstr free_class_name = (zstr)NULL; + zstr free_class_name = NULL_ZSTR; int function_name_string = 1; - class_name = (zstr)NULL; + class_name = NULL_ZSTR; call_type = NULL; arg_array = NULL; @@ -1824,7 +1824,7 @@ class_name = ptr->function_state.function->common.scope->name; call_type = "::"; } else { - class_name = (zstr)NULL; + class_name = NULL_ZSTR; call_type = NULL; } if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.c?r1=1.687&r2=1.688&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.687 ZendEngine2/zend_compile.c:1.688 --- ZendEngine2/zend_compile.c:1.687 Thu Feb 23 18:06:04 2006 +++ ZendEngine2/zend_compile.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.687 2006/02/23 18:06:04 andrei Exp $ */ +/* $Id: zend_compile.c,v 1.688 2006/02/26 11:57:14 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -1109,7 +1109,7 @@ fn_flags = 0; } if ((fn_flags & ZEND_ACC_STATIC) && (fn_flags & ZEND_ACC_ABSTRACT) && !(CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error(E_COMPILE_ERROR, "Static function %v%s%R() cannot be abstract", is_method ? CG(active_class_entry)->name : (zstr)EMPTY_STR, is_method ? "::" : "", Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant)); + zend_error(E_COMPILE_ERROR, "Static function %v%s%R() cannot be abstract", is_method ? CG(active_class_entry)->name : EMPTY_ZSTR, is_method ? "::" : "", Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant)); } function_token->u.op_array = CG(active_op_array); @@ -1361,7 +1361,7 @@ } } else { cur_arg_info->array_type_hint = 1; - cur_arg_info->class_name.v = NULL; + cur_arg_info->class_name = NULL_ZSTR; cur_arg_info->class_name_len = 0; if (op == ZEND_RECV_INIT) { if (Z_TYPE(initialization->u.constant) == IS_NULL || @@ -1375,7 +1375,7 @@ } } } else { - cur_arg_info->class_name.v = NULL; + cur_arg_info->class_name = NULL_ZSTR; cur_arg_info->class_name_len = 0; } opline->result.u.EA.type |= EXT_TYPE_UNUSED; @@ -2209,7 +2209,7 @@ zstr prot_name; int prot_name_length; - zend_u_mangle_property_name(&prot_name, &prot_name_length, utype, (zstr)"*", 1, child_info->name, child_info->name_length, ce->type & ZEND_INTERNAL_CLASS); + zend_u_mangle_property_name(&prot_name, &prot_name_length, utype, ZSTR("*"), 1, child_info->name, child_info->name_length, ce->type & ZEND_INTERNAL_CLASS); if (child_info->flags & ZEND_ACC_STATIC) { zval **prop; HashTable *ht; @@ -4158,7 +4158,7 @@ zend_bool zend_is_auto_global(char *name, uint name_len TSRMLS_DC) { - return zend_u_is_auto_global(IS_STRING, (zstr)name, name_len TSRMLS_CC); + return zend_u_is_auto_global(IS_STRING, ZSTR(name), name_len TSRMLS_CC); } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.h?r1=1.333&r2=1.334&diff_format=u Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.333 ZendEngine2/zend_compile.h:1.334 --- ZendEngine2/zend_compile.h:1.333 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_compile.h Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.333 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_compile.h,v 1.334 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -242,7 +242,7 @@ struct _zend_module_entry *module; } zend_internal_function; -#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : (zstr)EMPTY_STR) +#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : EMPTY_ZSTR) typedef union _zend_function { zend_uchar type; /* MUST be the first element of this struct! */ http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_constants.c?r1=1.80&r2=1.81&diff_format=u Index: ZendEngine2/zend_constants.c diff -u ZendEngine2/zend_constants.c:1.80 ZendEngine2/zend_constants.c:1.81 --- ZendEngine2/zend_constants.c:1.80 Wed Feb 22 10:02:15 2006 +++ ZendEngine2/zend_constants.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_constants.c,v 1.80 2006/02/22 10:02:15 dmitry Exp $ */ +/* $Id: zend_constants.c,v 1.81 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_constants.h" @@ -322,7 +322,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC) { - return zend_u_get_constant(IS_STRING, (zstr)name, name_len, result TSRMLS_CC); + return zend_u_get_constant(IS_STRING, ZSTR(name), name_len, result TSRMLS_CC); } ZEND_API int zend_u_register_constant(zend_uchar type, zend_constant *c TSRMLS_DC) @@ -343,7 +343,7 @@ } else { lookup_name_len = c->name_len; name = c->name; - lookup_name.v = NULL; + lookup_name = NULL_ZSTR; } if (zend_u_hash_add(EG(zend_constants), type, name, lookup_name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.737&r2=1.738&diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.737 ZendEngine2/zend_execute.c:1.738 --- ZendEngine2/zend_execute.c:1.737 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_execute.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.737 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.738 2006/02/26 11:57:14 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -485,7 +485,7 @@ cur_arg_info = &zf->common.arg_info[arg_num-1]; fname = zf->common.function_name; fsep = zf->common.scope ? "::" : ""; - fclass = zf->common.scope ? zf->common.scope->name : (zstr)EMPTY_STR; + fclass = zf->common.scope ? zf->common.scope->name : EMPTY_ZSTR; if (cur_arg_info->class_name.v) { if (!arg) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.h?r1=1.95&r2=1.96&diff_format=u Index: ZendEngine2/zend_execute.h diff -u ZendEngine2/zend_execute.h:1.95 ZendEngine2/zend_execute.h:1.96 --- ZendEngine2/zend_execute.h:1.95 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_execute.h Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.h,v 1.95 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_execute.h,v 1.96 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_EXECUTE_H #define ZEND_EXECUTE_H @@ -203,7 +203,7 @@ /* The following tries to resolve the classname of a zval of type object. * Since it is slow it should be only used in error messages. */ -#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : (zstr)EMPTY_STR) +#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : EMPTY_ZSTR) ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var); http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute_API.c?r1=1.363&r2=1.364&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.363 ZendEngine2/zend_execute_API.c:1.364 --- ZendEngine2/zend_execute_API.c:1.363 Sun Feb 26 07:23:33 2006 +++ ZendEngine2/zend_execute_API.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.363 2006/02/26 07:23:33 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.364 2006/02/26 11:57:14 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -314,7 +314,7 @@ if (space) { *space = ""; } - return (zstr)EMPTY_STR; + return EMPTY_ZSTR; } switch (EG(function_state_ptr)->function->type) { case ZEND_USER_FUNCTION: @@ -325,21 +325,23 @@ if (space) { *space = ce ? "::" : ""; } - return ce ? ce->name : (zstr)EMPTY_STR; + return ce ? ce->name : EMPTY_ZSTR; } default: if (space) { *space = ""; } - return (zstr)EMPTY_STR; + return EMPTY_ZSTR; } } ZEND_API zstr get_active_function_name(TSRMLS_D) { + zstr ret; + if (!zend_is_executing(TSRMLS_C)) { - return (zstr)NULL; + return NULL_ZSTR; } switch (EG(function_state_ptr)->function->type) { case ZEND_USER_FUNCTION: { @@ -347,16 +349,19 @@ if (function_name.v) { return function_name; + } else if (UG(unicode)) { + ret.u = u_main; } else { - return UG(unicode)?(zstr)u_main:(zstr)"main"; + ret.s = "main"; } + return ret; } break; case ZEND_INTERNAL_FUNCTION: return ((zend_internal_function *) EG(function_state_ptr)->function)->function_name; break; default: - return (zstr)NULL; + return NULL_ZSTR; } } @@ -530,13 +535,13 @@ break; case IS_BOOL: case IS_LONG: - zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, (zstr)NULL, 0, Z_LVAL(const_value)); + zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL_ZSTR, 0, Z_LVAL(const_value)); break; case IS_DOUBLE: - zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, (zstr)NULL, 0, (long)Z_DVAL(const_value)); + zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL_ZSTR, 0, (long)Z_DVAL(const_value)); break; case IS_NULL: - zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, (zstr)EMPTY_STR, 1, 0); + zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, EMPTY_ZSTR, 1, 0); break; } zend_hash_move_forward(Z_ARRVAL_P(p)); @@ -865,7 +870,7 @@ } if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { zend_error(E_STRICT, "Function %v%s%v() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : (zstr)EMPTY_STR, + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : EMPTY_ZSTR, EX(function_state).function->common.scope ? "::" : "", EX(function_state).function->common.function_name); } @@ -1134,7 +1139,7 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***ce TSRMLS_DC) { - return zend_u_lookup_class(IS_STRING, (zstr)name, name_length, ce TSRMLS_CC); + return zend_u_lookup_class(IS_STRING, ZSTR(name), name_length, ce TSRMLS_CC); } ZEND_API int zend_u_eval_string(zend_uchar type, zstr string, zval *retval_ptr, char *string_name TSRMLS_DC) @@ -1222,7 +1227,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC) { - return zend_u_eval_string(IS_STRING, (zstr)str, retval_ptr, string_name TSRMLS_CC); + return zend_u_eval_string(IS_STRING, ZSTR(str), retval_ptr, string_name TSRMLS_CC); } ZEND_API int zend_u_eval_string_ex(zend_uchar type, zstr str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) @@ -1239,7 +1244,7 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) { - return zend_u_eval_string_ex(IS_STRING, (zstr)str, retval_ptr, string_name, handle_exceptions TSRMLS_CC); + return zend_u_eval_string_ex(IS_STRING, ZSTR(str), retval_ptr, string_name, handle_exceptions TSRMLS_CC); } @@ -1543,16 +1548,16 @@ zend_class_entry *zend_fetch_class(char *class_name, uint class_name_len, int fetch_type TSRMLS_DC) { - return zend_u_fetch_class(IS_STRING, (zstr)class_name, class_name_len, fetch_type TSRMLS_CC); + return zend_u_fetch_class(IS_STRING, ZSTR(class_name), class_name_len, fetch_type TSRMLS_CC); } #define MAX_ABSTRACT_INFO_CNT 3 #define MAX_ABSTRACT_INFO_FMT "%v%s%v%s" #define DISPLAY_ABSTRACT_FN(idx) \ - ai.afn[idx] ? ZEND_FN_SCOPE_NAME(ai.afn[idx]) : (zstr)EMPTY_STR, \ + ai.afn[idx] ? ZEND_FN_SCOPE_NAME(ai.afn[idx]) : EMPTY_ZSTR, \ ai.afn[idx] ? "::" : "", \ - ai.afn[idx] ? ai.afn[idx]->common.function_name : (zstr)EMPTY_STR, \ + ai.afn[idx] ? ai.afn[idx]->common.function_name : EMPTY_ZSTR, \ ai.afn[idx] && ai.afn[idx+1] ? ", " : (ai.afn[idx] && ai.cnt > MAX_ABSTRACT_INFO_CNT ? ", ..." : "") typedef struct _zend_abstract_info { @@ -1634,7 +1639,7 @@ ZEND_API int zend_delete_global_variable(char *name, int name_len TSRMLS_DC) { - return zend_u_delete_global_variable(IS_STRING, (zstr)name, name_len TSRMLS_CC); + return zend_u_delete_global_variable(IS_STRING, ZSTR(name), name_len TSRMLS_CC); } /* http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_hash.c?r1=1.133&r2=1.134&diff_format=u Index: ZendEngine2/zend_hash.c diff -u ZendEngine2/zend_hash.c:1.133 ZendEngine2/zend_hash.c:1.134 --- ZendEngine2/zend_hash.c:1.133 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_hash.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.c,v 1.133 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_hash.c,v 1.134 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_operators.h" @@ -121,7 +121,7 @@ ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength) { - return zend_u_hash_func(IS_STRING, (zstr)arKey, nKeyLength); + return zend_u_hash_func(IS_STRING, ZSTR(arKey), nKeyLength); } #define UPDATE_DATA(ht, p, pData, nDataSize) \ @@ -312,7 +312,7 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) { - return _zend_u_hash_add_or_update(ht, IS_STRING, (zstr)arKey, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); } ZEND_API int _zend_u_hash_quick_add_or_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) @@ -400,7 +400,7 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) { - return _zend_u_hash_quick_add_or_update(ht, IS_STRING, (zstr)arKey, nKeyLength, h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + return _zend_u_hash_quick_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); } ZEND_API int zend_u_hash_add_empty_element(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength) @@ -414,7 +414,7 @@ { void *dummy = (void *) 1; - return zend_u_hash_add(ht, IS_STRING, (zstr)arKey, nKeyLength, &dummy, sizeof(void *), NULL); + return zend_u_hash_add(ht, IS_STRING, ZSTR(arKey), nKeyLength, &dummy, sizeof(void *), NULL); } @@ -594,7 +594,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) { - return zend_u_hash_del_key_or_index(ht, IS_STRING, (zstr)arKey, nKeyLength, h, flag); + return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, h, flag); } ZEND_API void zend_hash_destroy(HashTable *ht) @@ -830,7 +830,7 @@ if (q->nKeyLength==0) { zend_hash_index_del(ht, q->h); } else { - zend_u_hash_del(ht, q->key.type, (zstr)q->key.arKey.s, q->nKeyLength); + zend_u_hash_del(ht, q->key.type, ZSTR(q->key.arKey.s), q->nKeyLength); } } if (result & ZEND_HASH_APPLY_STOP) { @@ -854,7 +854,7 @@ if (p->nKeyLength == 0) { zend_hash_index_update(target, p->h, p->pData, size, &new_entry); } else { - zend_u_hash_update(target, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, p->pData, size, &new_entry); + zend_u_hash_update(target, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, p->pData, size, &new_entry); } if (pCopyConstructor) { pCopyConstructor(new_entry); @@ -881,7 +881,7 @@ pCopyConstructor(t); } } else { - if (_zend_u_hash_add_or_update(target, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) { + if (_zend_u_hash_add_or_update(target, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) { pCopyConstructor(t); } } @@ -914,7 +914,7 @@ p = source->pListHead; while (p) { if (zend_hash_replace_checker_wrapper(target, p->pData, p, pParam, pMergeSource)) { - if (zend_u_hash_quick_update(target, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { + if (zend_u_hash_quick_update(target, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { pCopyConstructor(t); } } @@ -931,7 +931,7 @@ ZEND_API ulong zend_get_hash_value(char *arKey, uint nKeyLength) { - return zend_u_get_hash_value(IS_STRING, (zstr)arKey, nKeyLength); + return zend_u_get_hash_value(IS_STRING, ZSTR(arKey), nKeyLength); } @@ -973,7 +973,7 @@ ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData) { - return zend_u_hash_find(ht, IS_STRING, (zstr)arKey, nKeyLength, pData); + return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData); } @@ -1016,7 +1016,7 @@ ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData) { - return zend_u_hash_quick_find(ht, IS_STRING, (zstr)arKey, nKeyLength, h, pData); + return zend_u_hash_quick_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, h, pData); } ZEND_API int zend_u_hash_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength) @@ -1052,7 +1052,7 @@ ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength) { - return zend_u_hash_exists(ht, IS_STRING, (zstr)arKey, nKeyLength); + return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength); } ZEND_API int zend_u_hash_quick_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h) @@ -1093,7 +1093,7 @@ ZEND_API int zend_hash_quick_exists(HashTable *ht, char *arKey, uint nKeyLength, ulong h) { - return zend_u_hash_quick_exists(ht, IS_STRING, (zstr)arKey, nKeyLength, h); + return zend_u_hash_quick_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength, h); } ZEND_API int zend_hash_index_find(HashTable *ht, ulong h, void **pData) @@ -1505,7 +1505,7 @@ return 1; } } else { /* string, binary or unicode index */ - if (zend_u_hash_find(ht2, p1->key.type, (zstr)p1->key.arKey.s, p1->nKeyLength, &pData2)==FAILURE) { + if (zend_u_hash_find(ht2, p1->key.type, ZSTR(p1->key.arKey.s), p1->nKeyLength, &pData2)==FAILURE) { HASH_UNPROTECT_RECURSION(ht1); HASH_UNPROTECT_RECURSION(ht2); return 1; @@ -1687,10 +1687,10 @@ if (type == IS_STRING) { key_type = HASH_KEY_IS_STRING; - HANDLE_NUMERIC(arKey.s, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, (zstr)NULL, 0, idx)); + HANDLE_NUMERIC(arKey.s, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx)); } else { key_type = HASH_KEY_IS_UNICODE; - HANDLE_U_NUMERIC(arKey.u, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, (zstr)NULL, 0, idx)); + HANDLE_U_NUMERIC(arKey.u, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx)); } return zend_hash_update_current_key(ht, key_type, arKey, nKeyLength, 0); } @@ -1726,8 +1726,8 @@ ZEND_API int zend_symtable_update_current_key(HashTable *ht, char *arKey, uint nKeyLength) { - HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, (zstr)NULL, 0, idx)); - return zend_hash_update_current_key(ht, HASH_KEY_IS_STRING, (zstr)arKey, nKeyLength, 0); + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx)); + return zend_hash_update_current_key(ht, HASH_KEY_IS_STRING, ZSTR(arKey), nKeyLength, 0); } ZEND_API void zend_hash_to_unicode(HashTable *ht, apply_func_t apply_func TSRMLS_DC) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_interfaces.c?r1=1.49&r2=1.50&diff_format=u Index: ZendEngine2/zend_interfaces.c diff -u ZendEngine2/zend_interfaces.c:1.49 ZendEngine2/zend_interfaces.c:1.50 --- ZendEngine2/zend_interfaces.c:1.49 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_interfaces.c Sun Feb 26 11:57:14 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_interfaces.c,v 1.49 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_interfaces.c,v 1.50 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -76,7 +76,7 @@ if (!fn_proxy || !*fn_proxy) { if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { /* error at c-level */ - zend_error(E_CORE_ERROR, "Couldn't find implementation for method %v%s%s", obj_ce ? obj_ce->name : (zstr)EMPTY_STR, obj_ce ? "::" : "", function_name); + zend_error(E_CORE_ERROR, "Couldn't find implementation for method %v%s%s", obj_ce ? obj_ce->name : EMPTY_ZSTR, obj_ce ? "::" : "", function_name); } if (fn_proxy) { *fn_proxy = fcic.function_handler; @@ -93,7 +93,7 @@ if (!obj_ce) { obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; } - zend_error(E_CORE_ERROR, "Couldn't execute method %v%s%s", obj_ce ? obj_ce->name : (zstr)EMPTY_STR, obj_ce ? "::" : "", function_name); + zend_error(E_CORE_ERROR, "Couldn't execute method %v%s%s", obj_ce ? obj_ce->name : EMPTY_ZSTR, obj_ce ? "::" : "", function_name); } if (!retval_ptr_ptr) { if (retval) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_language_scanner.l?r1=1.147&r2=1.148&diff_format=u Index: ZendEngine2/zend_language_scanner.l diff -u ZendEngine2/zend_language_scanner.l:1.147 ZendEngine2/zend_language_scanner.l:1.148 --- ZendEngine2/zend_language_scanner.l:1.147 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_language_scanner.l Sun Feb 26 11:57:14 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_language_scanner.l,v 1.147 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_language_scanner.l,v 1.148 2006/02/26 11:57:14 dmitry Exp $ */ #define yyleng SCNG(yy_leng) #define yytext SCNG(yy_text) @@ -1891,7 +1891,7 @@ } <ST_IN_SCRIPTING>"__CLASS__" { - zstr class_name = (zstr)NULL; + zstr class_name = NULL_ZSTR; if (CG(active_class_entry)) { class_name = CG(active_class_entry)->name; @@ -1906,7 +1906,7 @@ } <ST_IN_SCRIPTING>"__FUNCTION__" { - zstr func_name = (zstr)NULL; + zstr func_name = NULL_ZSTR; if (CG(active_op_array)) { func_name = CG(active_op_array)->function_name; @@ -1921,8 +1921,8 @@ } <ST_IN_SCRIPTING>"__METHOD__" { - zstr class_name = CG(active_class_entry) ? CG(active_class_entry)->name : (zstr)NULL; - zstr func_name = CG(active_op_array)? CG(active_op_array)->function_name : (zstr)NULL; + zstr class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL_ZSTR; + zstr func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL_ZSTR; size_t len = 0; if (UG(unicode)) { http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_object_handlers.c?r1=1.160&r2=1.161&diff_format=u Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.160 ZendEngine2/zend_object_handlers.c:1.161 --- ZendEngine2/zend_object_handlers.c:1.160 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_object_handlers.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.c,v 1.160 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_object_handlers.c,v 1.161 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -792,14 +792,14 @@ */ updated_fbc = zend_check_private_int(fbc, Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC); if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } fbc = updated_fbc; } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(fbc->common.scope, EG(scope))) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } @@ -839,14 +839,14 @@ */ updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC); if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } fbc = updated_fbc; } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(EG(scope), fbc->common.scope)) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } @@ -915,13 +915,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC) != EG(scope)) { - zend_error(E_ERROR, "Call to private %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to private %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(constructor->common.scope, EG(scope))) { - zend_error(E_ERROR, "Call to protected %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error(E_ERROR, "Call to protected %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_objects.c?r1=1.63&r2=1.64&diff_format=u Index: ZendEngine2/zend_objects.c diff -u ZendEngine2/zend_objects.c:1.63 ZendEngine2/zend_objects.c:1.64 --- ZendEngine2/zend_objects.c:1.63 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_objects.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_objects.c,v 1.63 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_objects.c,v 1.64 2006/02/26 11:57:14 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -44,7 +44,7 @@ zend_error(EG(in_execution) ? E_ERROR : E_WARNING, "Call to private %v::__destruct() from context '%v'%s", ce->name, - EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR, + EG(scope) ? EG(scope)->name : EMPTY_ZSTR, EG(in_execution) ? "" : " during shutdown ignored"); return; } @@ -57,7 +57,7 @@ zend_error(EG(in_execution) ? E_ERROR : E_WARNING, "Call to protected %v::__destruct() from context '%v'%s", ce->name, - EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR, + EG(scope) ? EG(scope)->name : EMPTY_ZSTR, EG(in_execution) ? "" : " during shutdown ignored"); return; } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_operators.c?r1=1.234&r2=1.235&diff_format=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.234 ZendEngine2/zend_operators.c:1.235 --- ZendEngine2/zend_operators.c:1.234 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_operators.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.c,v 1.234 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_operators.c,v 1.235 2006/02/26 11:57:14 dmitry Exp $ */ #include <ctype.h> @@ -2084,17 +2084,24 @@ return dest; } else { - return (zstr)zend_str_tolower_copy(dest.s, source.s, length); + zstr ret; + + ret.s = zend_str_tolower_copy(dest.s, source.s, length); + return ret; } } ZEND_API zstr zend_u_str_tolower_dup(zend_uchar type, zstr source, unsigned int length) { + zstr ret; + if (type == IS_UNICODE) { - return zend_u_str_tolower_copy(IS_UNICODE, (zstr)emalloc(UBYTES(length+1)), source, length); + ret.u = eumalloc(length+1); + ret = zend_u_str_tolower_copy(IS_UNICODE, ret, source, length); } else { - return (zstr)zend_str_tolower_copy((char*)emalloc(length+1), source.s, length); + ret.s = zend_str_tolower_copy((char*)emalloc(length+1), source.s, length); } + return ret; } ZEND_API void zend_str_tolower(char *str, unsigned int length) @@ -2124,24 +2131,25 @@ ZEND_API zstr zend_u_str_case_fold(zend_uchar type, zstr source, unsigned int length, zend_bool normalize, unsigned int *new_len) { + zstr ret; + if (type == IS_UNICODE) { - UChar *ret; int ret_len; if (normalize) { - zend_normalize_identifier(&ret, &ret_len, source.u, length, 1); + zend_normalize_identifier(&ret.u, &ret_len, source.u, length, 1); } else { UErrorCode status = U_ZERO_ERROR; - zend_case_fold_string(&ret, &ret_len, source.u, length, U_FOLD_CASE_DEFAULT, &status); + zend_case_fold_string(&ret.u, &ret_len, source.u, length, U_FOLD_CASE_DEFAULT, &status); } *new_len = ret_len; - return (zstr)ret; - } else { + } else { *new_len = length; - return (zstr)zend_str_tolower_dup(source.s, length); + ret.s = zend_str_tolower_dup(source.s, length); } + return ret; } ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_operators.h?r1=1.109&r2=1.110&diff_format=u Index: ZendEngine2/zend_operators.h diff -u ZendEngine2/zend_operators.h:1.109 ZendEngine2/zend_operators.h:1.110 --- ZendEngine2/zend_operators.h:1.109 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_operators.h Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.h,v 1.109 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_operators.h,v 1.110 2006/02/26 11:57:14 dmitry Exp $ */ #ifndef ZEND_OPERATORS_H #define ZEND_OPERATORS_H @@ -388,8 +388,8 @@ #define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC) #define Z_OBJ_HANDLER(zval, hf) Z_OBJ_HT((zval))->hf #define Z_RESVAL(zval) (zval).value.lval -#define Z_UNIVAL(zval) ((zstr)(Z_STRVAL(zval))) -#define Z_UNILEN(zval) Z_STRLEN(zval) +#define Z_UNIVAL(zval) (zval).value.uni.val +#define Z_UNILEN(zval) (zval).value.uni.len #define Z_LVAL_P(zval_p) Z_LVAL(*zval_p) #define Z_BVAL_P(zval_p) Z_BVAL(*zval_p) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_def.h?r1=1.99&r2=1.100&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.99 ZendEngine2/zend_vm_def.h:1.100 --- ZendEngine2/zend_vm_def.h:1.99 Sat Feb 25 17:43:12 2006 +++ ZendEngine2/zend_vm_def.h Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.99 2006/02/25 17:43:12 helly Exp $ */ +/* $Id: zend_vm_def.h,v 1.100 2006/02/26 11:57:14 dmitry Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -1821,7 +1821,7 @@ } if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { zend_error(E_STRICT, "Function %v%s%v() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : (zstr)EMPTY_STR, + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : EMPTY_ZSTR, EX(function_state).function->common.scope ? "::" : "", EX(function_state).function->common.function_name); } @@ -2509,13 +2509,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_execute.h?r1=1.103&r2=1.104&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.103 ZendEngine2/zend_vm_execute.h:1.104 --- ZendEngine2/zend_vm_execute.h:1.103 Sat Feb 25 17:43:12 2006 +++ ZendEngine2/zend_vm_execute.h Sun Feb 26 11:57:14 2006 @@ -147,7 +147,7 @@ } if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { zend_error(E_STRICT, "Function %v%s%v() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : (zstr)EMPTY_STR, + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : EMPTY_ZSTR, EX(function_state).function->common.scope ? "::" : "", EX(function_state).function->common.function_name); } @@ -1720,13 +1720,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -4220,13 +4220,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -7317,13 +7317,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -14423,13 +14423,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } @@ -19951,13 +19951,13 @@ /* Ensure that if we're calling a private function, we're allowed to do so. */ if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { /* Ensure that if we're calling a protected function, we're allowed to do so. */ if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : (zstr)EMPTY_STR); + zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_ZSTR); } } } http://cvs.php.net/viewcvs.cgi/php-src/ext/libxml/libxml.c?r1=1.44&r2=1.45&diff_format=u Index: php-src/ext/libxml/libxml.c diff -u php-src/ext/libxml/libxml.c:1.44 php-src/ext/libxml/libxml.c:1.45 --- php-src/ext/libxml/libxml.c:1.44 Tue Feb 21 20:12:42 2006 +++ php-src/ext/libxml/libxml.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: libxml.c,v 1.44 2006/02/21 20:12:42 dmitry Exp $ */ +/* $Id: libxml.c,v 1.45 2006/02/26 11:57:14 dmitry Exp $ */ #define IS_EXT_MODULE @@ -843,12 +843,12 @@ if (zend_hash_add(&php_libxml_exports, ce->name.s, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL) == SUCCESS) { int ret; - UChar *uname; + zstr name; - uname = malloc(UBYTES(ce->name_length+1)); - u_charsToUChars(ce->name.s, uname, ce->name_length+1); - ret = zend_u_hash_add(&php_libxml_exports, IS_UNICODE, (zstr)uname, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL); - free(uname); + name.u = malloc(UBYTES(ce->name_length+1)); + u_charsToUChars(ce->name.s, name.u, ce->name_length+1); + ret = zend_u_hash_add(&php_libxml_exports, IS_UNICODE, name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL); + free(name.u); return ret; } return FAILURE; http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/array.c?r1=1.342&r2=1.343&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.342 php-src/ext/standard/array.c:1.343 --- php-src/ext/standard/array.c:1.342 Wed Feb 22 13:10:32 2006 +++ php-src/ext/standard/array.c Sun Feb 26 11:57:14 2006 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.342 2006/02/22 13:10:32 dmitry Exp $ */ +/* $Id: array.c,v 1.343 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "php_ini.h" @@ -1988,7 +1988,7 @@ if (p->nKeyLength == 0) { zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, &entry, sizeof(zval *), NULL); + zend_u_hash_update(out_hash, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, &entry, sizeof(zval *), NULL); } } @@ -2000,7 +2000,7 @@ if (p->nKeyLength == 0) { zend_hash_next_index_insert(*removed, &entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(*removed, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, &entry, sizeof(zval *), NULL); + zend_u_hash_update(*removed, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, &entry, sizeof(zval *), NULL); } } } else /* otherwise just skip those entries */ @@ -2033,7 +2033,7 @@ if (p->nKeyLength == 0) { zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p->key.type, (zstr)p->key.arKey.s, p->nKeyLength, &entry, sizeof(zval *), NULL); + zend_u_hash_update(out_hash, p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength, &entry, sizeof(zval *), NULL); } } @@ -2094,7 +2094,7 @@ { zval **stack, /* Input stack */ **val; /* Value to be popped */ - zstr key = (zstr)NULL; + zstr key = NULL_ZSTR; int key_len = 0; ulong index; zend_uchar key_type; @@ -3043,9 +3043,9 @@ zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { if (Z_ARRVAL_P(return_value) == &EG(symbol_table)) { - zend_u_delete_global_variable(p->key.type, (zstr)p->key.arKey.s, p->nKeyLength-1 TSRMLS_CC); + zend_u_delete_global_variable(p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength-1 TSRMLS_CC); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } } } @@ -3303,7 +3303,7 @@ if (p->nKeyLength == 0) { zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } } } @@ -3319,7 +3319,7 @@ if (p->nKeyLength == 0) { zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } if (!*++ptrs[0]) { goto out; @@ -3702,7 +3702,7 @@ if (p->nKeyLength == 0) { zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } else { - zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, (zstr)p->key.arKey.s, p->nKeyLength); + zend_u_hash_del(Z_ARRVAL_P(return_value), p->key.type, ZSTR(p->key.arKey.s), p->nKeyLength); } if (!*++ptrs[0]) { goto out; http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/incomplete_class.c?r1=1.31&r2=1.32&diff_format=u Index: php-src/ext/standard/incomplete_class.c diff -u php-src/ext/standard/incomplete_class.c:1.31 php-src/ext/standard/incomplete_class.c:1.32 --- php-src/ext/standard/incomplete_class.c:1.31 Tue Feb 21 20:12:42 2006 +++ php-src/ext/standard/incomplete_class.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ */ -/* $Id: incomplete_class.c,v 1.31 2006/02/21 20:12:42 dmitry Exp $ */ +/* $Id: incomplete_class.c,v 1.32 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "basic_functions.h" @@ -126,7 +126,7 @@ PHPAPI zstr php_lookup_class_name(zval *object, zend_uint *nlen) { zval **val; - zstr retval = (zstr)NULL; + zstr retval = NULL_ZSTR; HashTable *object_properties; TSRMLS_FETCH(); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.64&r2=1.65&diff_format=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.64 php-src/ext/standard/streamsfuncs.c:1.65 --- php-src/ext/standard/streamsfuncs.c:1.64 Thu Feb 23 18:28:37 2006 +++ php-src/ext/standard/streamsfuncs.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.c,v 1.64 2006/02/23 18:28:37 iliaa Exp $ */ +/* $Id: streamsfuncs.c,v 1.65 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -907,20 +907,8 @@ { int ret = SUCCESS; zval **tmp; - U_STRING_DECL(u_notification, "notification", 12); - U_STRING_DECL(u_options, "options", 7); - U_STRING_DECL(u_input_encoding, "input_encoding", 14); - U_STRING_DECL(u_output_encoding, "output_encoding", 15); - U_STRING_DECL(u_default_mode, "default_mode", 12); - - U_STRING_INIT(u_notification, "notification", 12); - U_STRING_INIT(u_options, "options", 7); - U_STRING_INIT(u_input_encoding, "input_encoding", 14); - U_STRING_INIT(u_output_encoding, "output_encoding", 15); - U_STRING_INIT(u_default_mode, "default_mode", 12); - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_notification, sizeof("notification"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp)) { if (context->notifier) { php_stream_notification_free(context->notifier); @@ -933,12 +921,10 @@ ZVAL_ADDREF(*tmp); context->notifier->dtor = user_space_stream_notifier_dtor; } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_options, sizeof("options"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp)) { parse_context_options(context, *tmp TSRMLS_CC); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_input_encoding, sizeof("input_encoding"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp)) { zval strval = **tmp; if (context->input_encoding) { @@ -949,8 +935,7 @@ convert_to_string(&strval); context->input_encoding = Z_STRVAL(strval); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_output_encoding, sizeof("output_encoding"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp)) { zval strval = **tmp; if (context->output_encoding) { @@ -961,8 +946,7 @@ convert_to_string(&strval); context->output_encoding = Z_STRVAL(strval); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, (zstr)u_default_mode, sizeof("default_mode"), (void**)&tmp)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp)) { zval longval = **tmp; zval_copy_ctor(&longval); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/var.c?r1=1.221&r2=1.222&diff_format=u Index: php-src/ext/standard/var.c diff -u php-src/ext/standard/var.c:1.221 php-src/ext/standard/var.c:1.222 --- php-src/ext/standard/var.c:1.221 Wed Feb 22 14:20:54 2006 +++ php-src/ext/standard/var.c Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c,v 1.221 2006/02/22 14:20:54 dmitry Exp $ */ +/* $Id: var.c,v 1.222 2006/02/26 11:57:14 dmitry Exp $ */ @@ -684,6 +684,9 @@ { int count; zend_bool incomplete_class; + zstr star; + + star.s = "*"; incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); /* count after serializing name, since php_var_serialize_class_name @@ -762,7 +765,7 @@ break; } efree(priv_name.v); - zend_u_mangle_property_name(&prot_name, &prop_name_length, Z_TYPE_PP(name), (zstr)"*", 1, + zend_u_mangle_property_name(&prot_name, &prop_name_length, Z_TYPE_PP(name), star, 1, Z_UNIVAL_PP(name), Z_UNILEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); if (zend_u_hash_find(Z_OBJPROP_PP(struc), Z_TYPE_PP(name), prot_name, prop_name_length+1, (void *) &d) == SUCCESS) { if (Z_TYPE_PP(name) == IS_UNICODE) { http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode_iterators.c?r1=1.22&r2=1.23&diff_format=u Index: php-src/ext/unicode/unicode_iterators.c diff -u php-src/ext/unicode/unicode_iterators.c:1.22 php-src/ext/unicode/unicode_iterators.c:1.23 --- php-src/ext/unicode/unicode_iterators.c:1.22 Fri Feb 17 08:24:56 2006 +++ php-src/ext/unicode/unicode_iterators.c Sun Feb 26 11:57:14 2006 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: unicode_iterators.c,v 1.22 2006/02/17 08:24:56 helly Exp $ */ +/* $Id: unicode_iterators.c,v 1.23 2006/02/26 11:57:14 dmitry Exp $ */ /* * TODO @@ -415,7 +415,7 @@ *data = &obj->current; } -static int text_iter_get_current_key(zend_object_iterator* iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) +static int text_iter_get_current_key(zend_object_iterator* iter, zstr *str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) { text_iter_obj* obj = text_iter_to_obj(iter); http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.665&r2=1.666&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.665 php-src/main/main.c:1.666 --- php-src/main/main.c:1.665 Tue Feb 21 20:12:42 2006 +++ php-src/main/main.c Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.665 2006/02/21 20:12:42 dmitry Exp $ */ +/* $Id: main.c,v 1.666 2006/02/26 11:57:14 dmitry Exp $ */ /* {{{ includes */ @@ -550,7 +550,7 @@ char *space; zstr class_name = get_active_class_name(&space TSRMLS_CC); int origin_len; - zstr function = (zstr)NULL; + zstr function = NULL_ZSTR; char *origin; char *message; char *stage; http://cvs.php.net/viewcvs.cgi/php-src/main/output.c?r1=1.174&r2=1.175&diff_format=u Index: php-src/main/output.c diff -u php-src/main/output.c:1.174 php-src/main/output.c:1.175 --- php-src/main/output.c:1.174 Tue Feb 21 20:12:43 2006 +++ php-src/main/output.c Sun Feb 26 11:57:14 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.174 2006/02/21 20:12:43 dmitry Exp $ */ +/* $Id: output.c,v 1.175 2006/02/26 11:57:14 dmitry Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -500,58 +500,58 @@ zval *handler_zval; if (output_handler && output_handler->type == IS_STRING) { - char* next_handler_name; - char* handler_name = Z_STRVAL_P(output_handler); - handler_len = Z_STRLEN_P(output_handler); + zstr next_handler_name; + zstr handler_name = Z_UNIVAL_P(output_handler); + handler_len = Z_UNILEN_P(output_handler); result = SUCCESS; - if (handler_len && handler_name[0] != '\0') { - while ((next_handler_name=strchr(handler_name, ',')) != NULL) { - len = next_handler_name-handler_name; - next_handler_name = estrndup(handler_name, len); - handler_zval = php_ob_handler_from_string(next_handler_name, len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_STRING, (zstr)next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + if (handler_len && handler_name.s[0] != '\0') { + while ((next_handler_name.s=strchr(handler_name.s, ',')) != NULL) { + len = next_handler_name.s-handler_name.s; + next_handler_name.s = estrndup(handler_name.s, len); + handler_zval = php_ob_handler_from_string(next_handler_name.s, len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_STRING, next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); } - handler_name += len+1; + handler_name.s += len+1; handler_len -= len+1; - efree(next_handler_name); + efree(next_handler_name.s); } } if (result == SUCCESS) { - handler_zval = php_ob_handler_from_string(handler_name, handler_len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_STRING, (zstr)handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + handler_zval = php_ob_handler_from_string(handler_name.s, handler_len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_STRING, handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); } } } else if (output_handler && output_handler->type == IS_UNICODE) { - UChar* next_handler_name; - UChar* handler_name = Z_USTRVAL_P(output_handler); - handler_len = Z_USTRLEN_P(output_handler); + zstr next_handler_name; + zstr handler_name = Z_UNIVAL_P(output_handler); + handler_len = Z_UNILEN_P(output_handler); result = SUCCESS; - if (handler_len && handler_name[0] != 0) { - while ((next_handler_name=u_strchr(handler_name, ',')) != NULL) { - len = next_handler_name-handler_name; - next_handler_name = eustrndup(handler_name, len); - handler_zval = php_ob_handler_from_unicode(next_handler_name, len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_UNICODE, (zstr)next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + if (handler_len && handler_name.u[0] != 0) { + while ((next_handler_name.u=u_strchr(handler_name.u, ',')) != NULL) { + len = next_handler_name.u-handler_name.u; + next_handler_name.u = eustrndup(handler_name.u, len); + handler_zval = php_ob_handler_from_unicode(next_handler_name.u, len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_UNICODE, next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); } - handler_name += len+1; + handler_name.u += len+1; handler_len -= len+1; - efree(next_handler_name); + efree(next_handler_name.u); } } if (result == SUCCESS) { - handler_zval = php_ob_handler_from_unicode(handler_name, handler_len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_UNICODE, (zstr)handler_name, handler_zval, chunk_size, erase TSRMLS_CC); + handler_zval = php_ob_handler_from_unicode(handler_name.u, handler_len TSRMLS_CC); + result = php_ob_init_named(initial_size, block_size, IS_UNICODE, handler_name, handler_zval, chunk_size, erase TSRMLS_CC); if (result != SUCCESS) { zval_dtor(handler_zval); FREE_ZVAL(handler_zval); @@ -582,7 +582,10 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, "No method name given: use ob_start(array($object,'method')) to specify instance $object and the name of a method of class %v to use as output handler", Z_OBJCE_P(output_handler)->name); result = FAILURE; } else { - result = php_ob_init_named(initial_size, block_size, IS_STRING, (zstr)OB_DEFAULT_HANDLER_NAME, NULL, chunk_size, erase TSRMLS_CC); + zstr z_name; + + z_name.s = OB_DEFAULT_HANDLER_NAME; + result = php_ob_init_named(initial_size, block_size, IS_STRING, z_name, NULL, chunk_size, erase TSRMLS_CC); } return result; } http://cvs.php.net/viewcvs.cgi/php-src/main/php_variables.c?r1=1.115&r2=1.116&diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.115 php-src/main/php_variables.c:1.116 --- php-src/main/php_variables.c:1.115 Tue Feb 21 20:12:43 2006 +++ php-src/main/php_variables.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.115 2006/02/21 20:12:43 dmitry Exp $ */ +/* $Id: php_variables.c,v 1.116 2006/02/26 11:57:14 dmitry Exp $ */ #include <stdio.h> #include "php.h" @@ -296,7 +296,8 @@ while (1) { if (is_array) { - UChar *escaped_index = NULL, *index_s; + zstr escaped_index = NULL_ZSTR; + UChar *index_s; int32_t new_idx_len = 0; ip++; @@ -332,18 +333,18 @@ /* UTODO fix for magic_quotes_gpc case */ /* no need to addslashes() the index if it's the main variable name */ //escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - escaped_index = index; + escaped_index.u = index; } else { - escaped_index = index; + escaped_index.u = index; } - if (zend_u_symtable_find(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE + if (zend_u_symtable_find(symtable1, IS_UNICODE, escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) { MAKE_STD_ZVAL(gpc_element); array_init(gpc_element); - zend_u_symtable_update(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); + zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); } - if (index!=escaped_index) { - efree(escaped_index); + if (index!=escaped_index.u) { + efree(escaped_index.u); } } symtable1 = Z_ARRVAL_PP(gpc_element_p); @@ -368,8 +369,10 @@ } else { /* UTODO fix for php_addslashes case */ //char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - UChar *escaped_index = index; - zend_u_symtable_update(symtable1, IS_UNICODE, (zstr)escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); + zstr escaped_index; + + escaped_index.u = index; + zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); //efree(escaped_index); } break; http://cvs.php.net/viewcvs.cgi/php-src/main/rfc1867.c?r1=1.181&r2=1.182&diff_format=u Index: php-src/main/rfc1867.c diff -u php-src/main/rfc1867.c:1.181 php-src/main/rfc1867.c:1.182 --- php-src/main/rfc1867.c:1.181 Tue Feb 21 20:12:43 2006 +++ php-src/main/rfc1867.c Sun Feb 26 11:57:14 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: rfc1867.c,v 1.181 2006/02/21 20:12:43 dmitry Exp $ */ +/* $Id: rfc1867.c,v 1.182 2006/02/26 11:57:14 dmitry Exp $ */ /* * This product includes software developed by the Apache Group @@ -264,7 +264,7 @@ int dummy=1; normalize_u_protected_variable(varname TSRMLS_CC); - zend_u_hash_add(&PG(rfc1867_protected_variables), IS_UNICODE, (zstr)varname, u_strlen(varname)+1, &dummy, sizeof(int), NULL); + zend_u_hash_add(&PG(rfc1867_protected_variables), IS_UNICODE, ZSTR(varname), u_strlen(varname)+1, &dummy, sizeof(int), NULL); } @@ -278,7 +278,7 @@ static zend_bool is_u_protected_variable(UChar *varname TSRMLS_DC) { normalize_u_protected_variable(varname TSRMLS_CC); - return zend_u_hash_exists(&PG(rfc1867_protected_variables), IS_UNICODE, (zstr)varname, u_strlen(varname)+1); + return zend_u_hash_exists(&PG(rfc1867_protected_variables), IS_UNICODE, ZSTR(varname), u_strlen(varname)+1); } @@ -1316,7 +1316,7 @@ } temp_filename = EMPTY_STR; } else { - zend_u_hash_add(SG(rfc1867_uploaded_files), IS_UNICODE, (zstr)temp_filename, u_strlen(temp_filename) + 1, &temp_filename, sizeof(UChar *), NULL); + zend_u_hash_add(SG(rfc1867_uploaded_files), IS_UNICODE, ZSTR(temp_filename), u_strlen(temp_filename) + 1, &temp_filename, sizeof(UChar *), NULL); } /* is_arr_upload is true when name of file upload field