]> granicus.if.org Git - php/commitdiff
Fixed ZE specific compile warnings (Bug #55629)
authorDmitry Stogov <dmitry@php.net>
Tue, 13 Sep 2011 13:29:35 +0000 (13:29 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 13 Sep 2011 13:29:35 +0000 (13:29 +0000)
64 files changed:
Zend/zend.c
Zend/zend.h
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_alloc.c
Zend/zend_alloc.h
Zend/zend_builtin_functions.c
Zend/zend_closures.c
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_constants.c
Zend/zend_exceptions.c
Zend/zend_execute.c
Zend/zend_execute.h
Zend/zend_execute_API.c
Zend/zend_gc.h
Zend/zend_hash.c
Zend/zend_hash.h
Zend/zend_highlight.c
Zend/zend_indent.c
Zend/zend_interfaces.c
Zend/zend_interfaces.h
Zend/zend_iterators.c
Zend/zend_language_scanner.h
Zend/zend_language_scanner.l
Zend/zend_list.c
Zend/zend_object_handlers.c
Zend/zend_object_handlers.h
Zend/zend_opcode.c
Zend/zend_stream.c
Zend/zend_stream.h
Zend/zend_string.c
Zend/zend_string.h
Zend/zend_types.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/dom/node.c
ext/pdo/pdo_dbh.c
ext/pdo/pdo_stmt.c
ext/phar/func_interceptors.c
ext/phar/phar.c
ext/phar/phar_object.c
ext/phar/util.c
ext/reflection/php_reflection.c
ext/session/session.c
ext/soap/php_encoding.c
ext/standard/array.c
ext/standard/assert.c
ext/standard/head.c
ext/standard/http.c
ext/standard/mail.c
ext/standard/php_string.h
ext/standard/string.c
ext/standard/user_filters.c
ext/standard/var.c
ext/wddx/wddx.c
main/SAPI.c
main/fopen_wrappers.c
main/main.c
main/output.c
main/php_output.h
main/php_variables.c
main/streams/plain_wrapper.c
sapi/cli/php_cli.c

index 333ff693b41e97fb02ce173a3d521965ea970565..d222e262894fc85a53fb26fe33c8edd7837639d1 100644 (file)
@@ -63,7 +63,7 @@ ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRML
 
 void (*zend_on_timeout)(int seconds TSRMLS_DC);
 
-static void (*zend_message_dispatcher_p)(long message, void *data TSRMLS_DC);
+static void (*zend_message_dispatcher_p)(long message, const void *data TSRMLS_DC);
 static int (*zend_get_configuration_directive_p)(const char *name, uint name_length, zval *contents);
 
 static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
@@ -157,7 +157,7 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
                switch (zend_hash_get_current_key_ex(ht, &string_key, &str_len, &num_key, 0, &iterator)) {
                        case HASH_KEY_IS_STRING:
                                if (is_object) {
-                                       char *prop_name, *class_name;
+                                       const char *prop_name, *class_name;
                                        int mangled = zend_unmangle_property_name(string_key, str_len - 1, &class_name, &prop_name);
 
                                        ZEND_PUTS_EX(prop_name);
@@ -349,7 +349,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
                case IS_OBJECT:
                {
                        HashTable *properties = NULL;
-                       char *class_name = NULL;
+                       const char *class_name = NULL;
                        zend_uint clen;
 
                        if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
@@ -361,7 +361,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
                                zend_printf("%s Object (", "Unknown Class");
                        }
                        if (class_name) {
-                               efree(class_name);
+                               efree((char*)class_name);
                        }
                        if (Z_OBJ_HANDLER_P(expr, get_properties)) {
                                properties = Z_OBJPROP_P(expr);
@@ -407,7 +407,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
                case IS_OBJECT:
                        {
                                HashTable *properties;
-                               char *class_name = NULL;
+                               const char *class_name = NULL;
                                zend_uint clen;
                                int is_temp;
 
@@ -421,7 +421,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
                                }
                                ZEND_PUTS_EX(" Object\n");
                                if (class_name) {
-                                       efree(class_name);
+                                       efree((char*)class_name);
                                }
                                if ((properties = Z_OBJDEBUG_P(expr, is_temp)) == NULL) {
                                        break;
@@ -616,7 +616,7 @@ static void php_scanner_globals_ctor(zend_php_scanner_globals *scanner_globals_p
 
 void zend_init_opcodes_handlers(void);
 
-static zend_bool php_auto_globals_create_globals(char *name, uint name_len TSRMLS_DC) /* {{{ */
+static zend_bool php_auto_globals_create_globals(const char *name, uint name_len TSRMLS_DC) /* {{{ */
 {
        zval *globals;
 
@@ -956,7 +956,7 @@ void zend_deactivate(TSRMLS_D) /* {{{ */
 /* }}} */
 
 BEGIN_EXTERN_C()
-ZEND_API void zend_message_dispatcher(long message, void *data TSRMLS_DC) /* {{{ */
+ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC) /* {{{ */
 {
        if (zend_message_dispatcher_p) {
                zend_message_dispatcher_p(message, data TSRMLS_CC);
@@ -999,7 +999,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
        zval ***params;
        zval *retval;
        zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context;
-       char *error_filename;
+       const char *error_filename;
        uint error_lineno;
        zval *orig_user_error_handler;
        zend_bool in_compilation;
@@ -1307,7 +1307,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
 
 ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC) /* {{{ */
 {
-       char *cur_filename;
+       const char *cur_filename;
        int cur_lineno;
        char *compiled_string_description;
 
index 4e1290a5c0c866dfa45385b4307e652f70b4588d..5c092dbc6dc7fc523fa7e771f1534de77f740c45 100644 (file)
@@ -422,12 +422,12 @@ typedef struct _zend_serialize_data zend_serialize_data;
 typedef struct _zend_unserialize_data zend_unserialize_data;
 
 struct _zend_trait_method_reference {
-       char* method_name;
+       const char* method_name;
        unsigned int mname_len;
        
        zend_class_entry *ce;
        
-       char* class_name;
+       const char* class_name;
        unsigned int cname_len;
 };
 typedef struct _zend_trait_method_reference    zend_trait_method_reference;
@@ -447,7 +447,7 @@ struct _zend_trait_alias {
        /**
        * name for method to be added
        */
-       char* alias;
+       const char* alias;
        unsigned int alias_len;
        
        /**
@@ -511,10 +511,10 @@ struct _zend_class_entry {
 
        union {
                struct {
-                       char *filename;
+                       const char *filename;
                        zend_uint line_start;
                        zend_uint line_end;
-                       char *doc_comment;
+                       const char *doc_comment;
                        zend_uint doc_comment_len;
                } user;
                struct {
@@ -530,7 +530,7 @@ typedef struct _zend_utility_functions {
        int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
        int (*write_function)(const char *str, uint str_length);
        FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
-       void (*message_handler)(long message, void *data TSRMLS_DC);
+       void (*message_handler)(long message, const void *data TSRMLS_DC);
 #ifndef ZEND_SIGNALS
        void (*block_interruptions)(void);
        void (*unblock_interruptions)(void);
@@ -714,7 +714,7 @@ END_EXTERN_C()
 #endif
 
 BEGIN_EXTERN_C()
-ZEND_API void zend_message_dispatcher(long message, void *data TSRMLS_DC);
+ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC);
 
 ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
 END_EXTERN_C()
index 5401483db758433e2730f3aefcbb4e77ef3fd8ed..ed2f6d6e38562f95b43b5a3b65fac0890e76421c 100644 (file)
@@ -192,8 +192,8 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
 
 ZEND_API void zend_wrong_param_count(TSRMLS_D) /* {{{ */
 {
-       char *space;
-       char *class_name = get_active_class_name(&space TSRMLS_CC);
+       const char *space;
+       const char *class_name = get_active_class_name(&space TSRMLS_CC);
 
        zend_error(E_WARNING, "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name(TSRMLS_C));
 }
@@ -299,7 +299,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TS
 }
 /* }}} */
 
-static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const char **spec, char **error, int *severity TSRMLS_DC) /* {{{ */
+static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const char **spec, char **error, int *severity TSRMLS_DC) /* {{{ */
 {
        const char *spec_walk = *spec;
        char c = *spec_walk++;
@@ -665,14 +665,15 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
 
 static int zend_parse_arg(int arg_num, zval **arg, va_list *va, const char **spec, int quiet TSRMLS_DC) /* {{{ */
 {
-       char *expected_type = NULL, *error = NULL;
+       const char *expected_type = NULL;
+       char *error = NULL;
        int severity = E_WARNING;
 
        expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error, &severity TSRMLS_CC);
        if (expected_type) {
                if (!quiet && (*expected_type || error)) {
-                       char *space;
-                       char *class_name = get_active_class_name(&space TSRMLS_CC);
+                       const char *space;
+                       const char *class_name = get_active_class_name(&space TSRMLS_CC);
 
                        if (error) {
                                zend_error(severity, "%s%s%s() expects parameter %d %s",
@@ -735,7 +736,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
                                if (have_varargs) {
                                        if (!quiet) {
                                                zend_function *active_function = EG(current_execute_data)->function_state.function;
-                                               char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
+                                               const char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
                                                zend_error(E_WARNING, "%s%s%s(): only one varargs specifier (* or +) is permitted",
                                                                class_name,
                                                                class_name[0] ? "::" : "",
@@ -755,7 +756,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
                        default:
                                if (!quiet) {
                                        zend_function *active_function = EG(current_execute_data)->function_state.function;
-                                       char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
+                                       const char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
                                        zend_error(E_WARNING, "%s%s%s(): bad type specifier while parsing parameters",
                                                        class_name,
                                                        class_name[0] ? "::" : "",
@@ -778,7 +779,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
        if (num_args < min_num_args || (num_args > max_num_args && max_num_args > 0)) {
                if (!quiet) {
                        zend_function *active_function = EG(current_execute_data)->function_state.function;
-                       char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
+                       const char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
                        zend_error(E_WARNING, "%s%s%s() expects %s %d parameter%s, %d given",
                                        class_name,
                                        class_name[0] ? "::" : "",
@@ -856,8 +857,8 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
        int __num_args = (num_args); \
        \
        if (0 == (type_spec)[0] && 0 != __num_args && !(quiet)) { \
-               char *__space; \
-               char * __class_name = get_active_class_name(&__space TSRMLS_CC); \
+               const char *__space; \
+               const char * __class_name = get_active_class_name(&__space TSRMLS_CC); \
                zend_error(E_WARNING, "%s%s%s() expects exactly 0 parameters, %d given", \
                        __class_name, __space, \
                        get_active_function_name(TSRMLS_C), __num_args); \
@@ -1004,7 +1005,7 @@ static int zend_merge_property(zval **value TSRMLS_DC, int num_args, va_list arg
  * because it may call __set from the uninitialized object otherwise. */
 ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC) /* {{{ */
 {
-       zend_object_handlers *obj_ht = Z_OBJ_HT_P(obj);
+       const zend_object_handlers *obj_ht = Z_OBJ_HT_P(obj);
        zend_class_entry *old_scope = EG(scope);
 
        EG(scope) = Z_OBJCE_P(obj);
@@ -1924,7 +1925,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
        HashTable *target_function_table = function_table;
        int error_type;
        zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL;
-       char *lowercase_name;
+       const char *lowercase_name;
        int fname_len;
        const char *lc_class_name = NULL;
        int class_name_len = 0;
@@ -2011,13 +2012,13 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
                        }
                } else {
                        if (scope && (scope->ce_flags & ZEND_ACC_INTERFACE)) {
-                               efree(lc_class_name);
+                               efree((char*)lc_class_name);
                                zend_error(error_type, "Interface %s cannot contain non abstract method %s()", scope->name, ptr->fname);
                                return FAILURE;
                        }
                        if (!internal_function->handler) {
                                if (scope) {
-                                       efree(lc_class_name);
+                                       efree((char*)lc_class_name);
                                }
                                zend_error(error_type, "Method %s%s%s() cannot be a NULL function", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
                                zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
@@ -2079,7 +2080,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
        }
        if (unload) { /* before unloading, display all remaining bad function in the module */
                if (scope) {
-                       efree(lc_class_name);
+                       efree((char*)lc_class_name);
                }
                while (ptr->fname) {
                        fname_len = strlen(ptr->fname);
@@ -2087,7 +2088,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
                        if (zend_hash_exists(target_function_table, lowercase_name, fname_len+1)) {
                                zend_error(error_type, "Function registration failed - duplicate name - %s%s%s", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
                        }
-                       efree(lowercase_name);
+                       efree((char*)lowercase_name);
                        ptr++;
                }
                zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
@@ -2167,7 +2168,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
                        }
                        __isset->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
                }
-               efree(lc_class_name);
+               efree((char*)lc_class_name);
        }
        return SUCCESS;
 }
@@ -2394,7 +2395,7 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
        }
 
        zend_str_tolower_copy(lowercase_name, orig_class_entry->name, class_entry->name_length);
-       lowercase_name = zend_new_interned_string(lowercase_name, class_entry->name_length + 1, 1 TSRMLS_CC);
+       lowercase_name = (char*)zend_new_interned_string(lowercase_name, class_entry->name_length + 1, 1 TSRMLS_CC);
        if (IS_INTERNED(lowercase_name)) {
                zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, INTERNED_HASH(lowercase_name), &class_entry, sizeof(zend_class_entry *), NULL);
        } else {
@@ -2768,7 +2769,7 @@ get_function_via_handler:
                                             !instanceof_function(ce_org, fcc->function_handler->common.scope TSRMLS_CC))) {
                                                if ((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) {
                                                        if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
-                                                               efree(fcc->function_handler->common.function_name);
+                                                               efree((char*)fcc->function_handler->common.function_name);
                                                        }
                                                        efree(fcc->function_handler);
                                                }
@@ -2944,7 +2945,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
                             fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
                             fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
                                if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
-                                       efree(fcc->function_handler->common.function_name);
+                                       efree((char*)fcc->function_handler->common.function_name);
                                }
                                efree(fcc->function_handler);
                        }
@@ -3022,7 +3023,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
                                             fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
                                             fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
                                                if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
-                                                       efree(fcc->function_handler->common.function_name);
+                                                       efree((char*)fcc->function_handler->common.function_name);
                                                }
                                                efree(fcc->function_handler);
                                        }
@@ -3100,7 +3101,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRML
                     fcc.function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
                     fcc.function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
                        if (fcc.function_handler->type != ZEND_OVERLOADED_FUNCTION) {
-                               efree(fcc.function_handler->common.function_name);
+                               efree((char*)fcc.function_handler->common.function_name);
                        }
                        efree(fcc.function_handler);
                }
@@ -3286,10 +3287,10 @@ ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
 }
 /* }}} */
 
-ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, const char *doc_comment, int doc_comment_len TSRMLS_DC) /* {{{ */
 {
        zend_property_info property_info, *property_info_ptr;
-       char *interned_name;
+       const char *interned_name;
        ulong h = zend_get_hash_value(name, name_length+1);
 
        if (!(access_type & ZEND_ACC_PPP_MASK)) {
@@ -3365,9 +3366,9 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, in
        interned_name = zend_new_interned_string(property_info.name, property_info.name_length+1, 0 TSRMLS_CC);
        if (interned_name != property_info.name) {
                if (ce->type == ZEND_USER_CLASS) {
-                       efree(property_info.name);
+                       efree((char*)property_info.name);
                } else {
-                       free(property_info.name);
+                       free((char*)property_info.name);
                }
                property_info.name = interned_name;
        }
@@ -3386,13 +3387,13 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, in
 }
 /* }}} */
 
-ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type TSRMLS_DC) /* {{{ */
 {
        return zend_declare_property_ex(ce, 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) /* {{{ */
+ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, int name_length, int access_type TSRMLS_DC) /* {{{ */
 {
        zval *property;
 
@@ -3406,7 +3407,7 @@ ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int na
 }
 /* }}} */
 
-ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */
 {
        zval *property;
 
@@ -3421,7 +3422,7 @@ ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int na
 }
 /* }}} */
 
-ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */
 {
        zval *property;
 
@@ -3436,7 +3437,7 @@ ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int na
 }
 /* }}} */
 
-ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, int name_length, double value, int access_type TSRMLS_DC) /* {{{ */
 {
        zval *property;
 
@@ -3451,7 +3452,7 @@ ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int
 }
 /* }}} */
 
-ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, const char *value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, int name_length, const char *value, int access_type TSRMLS_DC) /* {{{ */
 {
        zval *property;
        int len = strlen(value);
@@ -3468,7 +3469,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
 }
 /* }}} */
 
-ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, const char *value, int value_len, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, int name_length, const char *value, int value_len, int access_type TSRMLS_DC) /* {{{ */
 {
        zval *property;
 
@@ -3572,7 +3573,7 @@ ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char
 }
 /* }}} */
 
-ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, int name_length, zval *value TSRMLS_DC) /* {{{ */
 {
        zval *property;
        zend_class_entry *old_scope = EG(scope);
@@ -3580,7 +3581,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
        EG(scope) = scope;
 
        if (!Z_OBJ_HT_P(object)->write_property) {
-               char *class_name;
+               const char *class_name;
                zend_uint class_name_len;
 
                zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
@@ -3596,7 +3597,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
 }
 /* }}} */
 
-ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, int name_length TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3608,7 +3609,7 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
 }
 /* }}} */
 
-ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3620,7 +3621,7 @@ ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, c
 }
 /* }}} */
 
-ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3632,7 +3633,7 @@ ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, c
 }
 /* }}} */
 
-ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, int name_length, double value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3644,7 +3645,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
 }
 /* }}} */
 
-ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3656,7 +3657,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
 }
 /* }}} */
 
-ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value, int value_len TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value, int value_len TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3668,7 +3669,7 @@ ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object
 }
 /* }}} */
 
-ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, int name_length, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, int name_length, zval *value TSRMLS_DC) /* {{{ */
 {
        zval **property;
        zend_class_entry *old_scope = EG(scope);
@@ -3703,7 +3704,7 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in
 }
 /* }}} */
 
-ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *name, int name_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, int name_length TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3715,7 +3716,7 @@ ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *nam
 }
 /* }}} */
 
-ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3727,7 +3728,7 @@ ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *nam
 }
 /* }}} */
 
-ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3739,7 +3740,7 @@ ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *nam
 }
 /* }}} */
 
-ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, int name_length, double value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3751,7 +3752,7 @@ ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *n
 }
 /* }}} */
 
-ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, const char *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, int name_length, const char *value TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3763,7 +3764,7 @@ ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *n
 }
 /* }}} */
 
-ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, const char *value, int value_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, int name_length, const char *value, int value_len TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
 
@@ -3775,7 +3776,7 @@ ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *
 }
 /* }}} */
 
-ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC) /* {{{ */
+ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, int name_length, zend_bool silent TSRMLS_DC) /* {{{ */
 {
        zval *property, *value;
        zend_class_entry *old_scope = EG(scope);
@@ -3783,7 +3784,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
        EG(scope) = scope;
 
        if (!Z_OBJ_HT_P(object)->read_property) {
-               char *class_name;
+               const char *class_name;
                zend_uint class_name_len;
 
                zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
@@ -3800,7 +3801,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
 }
 /* }}} */
 
-ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, int name_length, zend_bool silent TSRMLS_DC) /* {{{ */
+ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, int name_length, zend_bool silent TSRMLS_DC) /* {{{ */
 {
        zval **property;
        zend_class_entry *old_scope = EG(scope);
index 487356e575efbe48c6c308e1e8db661321f25ee6..a4477ffab2c7f71784acd613c27c5bb8f253ccd5 100644 (file)
@@ -295,14 +295,14 @@ ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **cal
 ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
 ZEND_API const char *zend_get_module_version(const char *module_name);
 ZEND_API int zend_get_module_started(const char *module_name);
-ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC);
-ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, const char *value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, const char *value, int value_len, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, const char *doc_comment, int doc_comment_len TSRMLS_DC);
+ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, int name_length, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, int name_length, double value, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, int name_length, const char *value, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, int name_length, const char *value, int value_len, int access_type TSRMLS_DC);
 
 ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC);
 ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC);
@@ -313,25 +313,25 @@ ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const cha
 ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value TSRMLS_DC);
 
 ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
-ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC);
-ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC);
-ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
-ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
-ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC);
-ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value TSRMLS_DC);
-ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
-
-ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, int name_length, zval *value TSRMLS_DC);
-ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *name, int name_length TSRMLS_DC);
-ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC);
-ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC);
-ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC);
-ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, const char *value TSRMLS_DC);
-ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
-
-ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC);
-
-ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, int name_length, zend_bool silent TSRMLS_DC);
+ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, int name_length, zval *value TSRMLS_DC);
+ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, int name_length TSRMLS_DC);
+ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC);
+ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC);
+ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, int name_length, double value TSRMLS_DC);
+ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value TSRMLS_DC);
+ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value, int value_length TSRMLS_DC);
+
+ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, int name_length, zval *value TSRMLS_DC);
+ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, int name_length TSRMLS_DC);
+ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC);
+ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC);
+ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, int name_length, double value TSRMLS_DC);
+ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, int name_length, const char *value TSRMLS_DC);
+ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, int name_length, const char *value, int value_length TSRMLS_DC);
+
+ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, int name_length, zend_bool silent TSRMLS_DC);
+
+ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, int name_length, zend_bool silent TSRMLS_DC);
 
 ZEND_API zend_class_entry *zend_get_class_entry(const zval *zobject TSRMLS_DC);
 ZEND_API int zend_get_object_classname(const zval *object, const char **class_name, zend_uint *class_name_len TSRMLS_DC);
@@ -502,11 +502,11 @@ ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci
 
 ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...);
 
-ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, char *name, int name_len, ulong hash_value TSRMLS_DC);
+ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC);
 
-ZEND_API int zend_delete_global_variable(char *name, int name_len TSRMLS_DC);
+ZEND_API int zend_delete_global_variable(const char *name, int name_len TSRMLS_DC);
 
-ZEND_API int zend_delete_global_variable_ex(char *name, int name_len, ulong hash_value TSRMLS_DC);
+ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulong hash_value TSRMLS_DC);
 
 ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC);
 
index 3c3b579e7bf0f0994f783bc7172354ba485969fc..963529d998aeebbb7872cb6d497df2de52510c82 100644 (file)
@@ -344,9 +344,9 @@ typedef struct _zend_mm_block_info {
 #if ZEND_DEBUG
 
 typedef struct _zend_mm_debug_info {
-       char *filename;
+       const char *filename;
        uint lineno;
-       char *orig_filename;
+       const char *orig_filename;
        uint orig_lineno;
        size_t size;
 #if ZEND_MM_HEAP_PROTECTION
@@ -460,7 +460,7 @@ struct _zend_mm_heap {
                sizeof(zend_mm_free_block*) * 2 - \
                sizeof(zend_mm_small_free_block))
 
-#define ZEND_MM_REST_BLOCK ((zend_mm_free_block*)(zend_uintptr_t)(1))
+#define ZEND_MM_REST_BLOCK ((zend_mm_free_block**)(zend_uintptr_t)(1))
 
 #define ZEND_MM_MAX_REST_BLOCKS 16
 
@@ -1750,7 +1750,7 @@ static void zend_mm_safe_error(zend_mm_heap *heap,
                heap->reserve = NULL;
        }
        if (heap->overflow == 0) {
-               char *error_filename;
+               const char *error_filename;
                uint error_lineno;
                TSRMLS_FETCH();
                if (zend_is_compiling(TSRMLS_C)) {
index 8cbfefb58565761e1aa1d28e10ae59406d20e2f2..9a09f4cda6b256ba569840400111834a8ad4589f 100644 (file)
@@ -44,9 +44,9 @@
 typedef struct _zend_leak_info {
        void *addr;
        size_t size;
-       char *filename;
+       const char *filename;
        uint lineno;
-       char *orig_filename;
+       const char *orig_filename;
        uint orig_lineno;
 } zend_leak_info;
 
index 3232bfa0d4a17128ed4f541310167aa39f6b7224..6e069b6f74499a01c02ade85ca8067be3adae6a2 100644 (file)
@@ -744,7 +744,7 @@ ZEND_FUNCTION(defined)
 ZEND_FUNCTION(get_class)
 {
        zval *obj = NULL;
-       char *name = "";
+       const char *name = "";
        zend_uint name_len = 0;
        int dup;
 
@@ -792,7 +792,7 @@ ZEND_FUNCTION(get_parent_class)
 {
        zval *arg;
        zend_class_entry *ce = NULL;
-       char *name;
+       const char *name;
        zend_uint name_length;
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) {
@@ -974,7 +974,8 @@ ZEND_FUNCTION(get_object_vars)
        zval **value;
        HashTable *properties;
        HashPosition pos;
-       char *key, *prop_name, *class_name;
+       char *key;
+       const char *prop_name, *class_name;
        uint key_len;
        ulong num_index;
        zend_object *zobj;
@@ -1120,7 +1121,7 @@ ZEND_FUNCTION(method_exists)
                                        && memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0) ? 1 : 0);
                                        
                                efree(lcname);
-                               efree(((zend_internal_function*)func)->function_name);
+                               efree((char*)((zend_internal_function*)func)->function_name);
                                efree(func);
                                return;
                        }
@@ -1450,6 +1451,7 @@ ZEND_FUNCTION(crash)
 ZEND_FUNCTION(get_included_files)
 {
        char *entry;
+
        if (zend_parse_parameters_none() == FAILURE) {
                return;
        }
@@ -1854,7 +1856,7 @@ ZEND_FUNCTION(zend_thread_id)
    Get the resource type name for a given resource */
 ZEND_FUNCTION(get_resource_type)
 {
-       char *resource_type;
+       const char *resource_type;
        zval *z_resource_type;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_resource_type) == FAILURE) {
@@ -2037,11 +2039,11 @@ ZEND_FUNCTION(debug_print_backtrace)
 {
        zend_execute_data *ptr, *skip;
        int lineno, frameno = 0;
-       char *function_name;
-       char *filename;
+       const char *function_name;
+       const char *filename;
        const char *class_name = NULL;
        char *call_type;
-       char *include_filename = NULL;
+       const char *include_filename = NULL;
        zval *arg_array = NULL;
        int indent = 0;
        long options = 0;
@@ -2148,7 +2150,7 @@ ZEND_FUNCTION(debug_print_backtrace)
                        if (build_filename_arg && include_filename) {
                                MAKE_STD_ZVAL(arg_array);
                                array_init(arg_array);
-                               add_next_index_string(arg_array, include_filename, 1);
+                               add_next_index_string(arg_array, (char*)include_filename, 1);
                        }
                        call_type = NULL;
                }
@@ -2187,7 +2189,7 @@ ZEND_FUNCTION(debug_print_backtrace)
                ptr = skip->prev_execute_data;
                ++indent;
                if (free_class_name) {
-                       efree(free_class_name);
+                       efree((char*)free_class_name);
                }
        }
 }
@@ -2198,10 +2200,10 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
 {
        zend_execute_data *ptr, *skip;
        int lineno, frameno = 0;
-       char *function_name;
-       char *filename;
-       char *class_name;
-       char *include_filename = NULL;
+       const char *function_name;
+       const char *filename;
+       const char *class_name;
+       const char *include_filename = NULL;
        zval *stack_frame;
 
        ptr = EG(current_execute_data);
@@ -2237,7 +2239,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
                if (skip->op_array) {
                        filename = skip->op_array->filename;
                        lineno = skip->opline->lineno;
-                       add_assoc_string_ex(stack_frame, "file", sizeof("file"), filename, 1);
+                       add_assoc_string_ex(stack_frame, "file", sizeof("file"), (char*)filename, 1);
                        add_assoc_long_ex(stack_frame, "line", sizeof("line"), lineno);
 
                        /* try to fetch args only if an FCALL was just made - elsewise we're in the middle of a function
@@ -2254,7 +2256,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
                                        break;
                                }                                   
                                if (prev->op_array) {
-                                       add_assoc_string_ex(stack_frame, "file", sizeof("file"), prev->op_array->filename, 1);
+                                       add_assoc_string_ex(stack_frame, "file", sizeof("file"), (char*)prev->op_array->filename, 1);
                                        add_assoc_long_ex(stack_frame, "line", sizeof("line"), prev->opline->lineno);
                                        break;
                                }
@@ -2266,17 +2268,17 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
                function_name = ptr->function_state.function->common.function_name;
 
                if (function_name) {
-                       add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
+                       add_assoc_string_ex(stack_frame, "function", sizeof("function"), (char*)function_name, 1);
 
                        if (ptr->object && Z_TYPE_P(ptr->object) == IS_OBJECT) {
                                if (ptr->function_state.function->common.scope) {
-                                       add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
+                                       add_assoc_string_ex(stack_frame, "class", sizeof("class"), (char*)ptr->function_state.function->common.scope->name, 1);
                                } else {
                                        zend_uint class_name_len;
                                        int dup;
 
                                        dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
-                                       add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, dup);
+                                       add_assoc_string_ex(stack_frame, "class", sizeof("class"), (char*)class_name, dup);
                                        
                                }
                                if ((options & DEBUG_BACKTRACE_PROVIDE_OBJECT) != 0) {
@@ -2286,7 +2288,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
 
                                add_assoc_string_ex(stack_frame, "type", sizeof("type"), "->", 1);
                        } else if (ptr->function_state.function->common.scope) {
-                               add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
+                               add_assoc_string_ex(stack_frame, "class", sizeof("class"), (char*)ptr->function_state.function->common.scope->name, 1);
                                add_assoc_string_ex(stack_frame, "type", sizeof("type"), "::", 1);
                        }
 
@@ -2340,11 +2342,11 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
                                   if we have called include in the frame above - this is the file we have included.
                                 */
 
-                               add_next_index_string(arg_array, include_filename, 1);
+                               add_next_index_string(arg_array, (char*)include_filename, 1);
                                add_assoc_zval_ex(stack_frame, "args", sizeof("args"), arg_array);
                        }
 
-                       add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
+                       add_assoc_string_ex(stack_frame, "function", sizeof("function"), (char*)function_name, 1);
                }
 
                add_next_index_zval(return_value, stack_frame);
index 46f9c670369268193b898e9a157371cc67ff2a84..344e6002d50e8cceaad18a93af83edf11506de74 100644 (file)
@@ -71,7 +71,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
        efree(arguments);
 
        /* destruct the function also, then - we have allocated it in get_method */
-       efree(func->internal_function.function_name);
+       efree((char*)func->internal_function.function_name);
        efree(func);
 }
 /* }}} */
index 16520336d48e06f320941194b48bdfc790c17edd..da49a99f234896dcb1604e0119412c1989320c03 100644 (file)
@@ -129,7 +129,7 @@ static void zend_destroy_property_info(zend_property_info *property_info) /* {{{
 {
        str_efree(property_info->name);
        if (property_info->doc_comment) {
-               efree(property_info->doc_comment);
+               efree((char*)property_info->doc_comment);
        }
 }
 /* }}} */
@@ -137,7 +137,7 @@ static void zend_destroy_property_info(zend_property_info *property_info) /* {{{
 
 static void zend_destroy_property_info_internal(zend_property_info *property_info) /* {{{ */
 {
-       str_free(property_info->name);
+       str_free((char*)property_info->name);
 }
 /* }}} */
 
@@ -145,7 +145,7 @@ static void build_runtime_defined_function_key(zval *result, const char *name, i
 {
        char char_pos_buf[32];
        uint char_pos_len;
-       char *filename;
+       const char *filename;
 
        char_pos_len = zend_sprintf(char_pos_buf, "%p", LANG_SCNG(yy_text));
        if (CG(active_op_array)->filename) {
@@ -344,7 +344,7 @@ static inline void zend_insert_literal(zend_op_array *op_array, const zval *zv,
 {
        if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_CONSTANT) {
                zval *z = (zval*)zv;
-               Z_STRVAL_P(z) = zend_new_interned_string(Z_STRVAL_P(zv), Z_STRLEN_P(zv) + 1, 1 TSRMLS_CC);
+               Z_STRVAL_P(z) = (char*)zend_new_interned_string(Z_STRVAL_P(zv), Z_STRLEN_P(zv) + 1, 1 TSRMLS_CC);
        }
        CONSTANT_EX(op_array, literal_position) = *zv;
        Z_SET_REFCOUNT(CONSTANT_EX(op_array, literal_position), 2);
@@ -412,7 +412,8 @@ int zend_add_func_name_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC
 int zend_add_ns_func_name_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC) /* {{{ */
 {
        int ret;
-       char *lc_name, *ns_separator;
+       char *lc_name;
+       const char *ns_separator;
        int lc_len;
        zval c;
        int lc_literal;
@@ -431,7 +432,7 @@ int zend_add_ns_func_name_literal(zend_op_array *op_array, const zval *zv TSRMLS
        lc_literal = zend_add_literal(CG(active_op_array), &c TSRMLS_CC);
        CALCULATE_LITERAL_HASH(lc_literal);
 
-       ns_separator = (char *) zend_memrchr(Z_STRVAL_P(zv), '\\', Z_STRLEN_P(zv)) + 1;
+       ns_separator = zend_memrchr(Z_STRVAL_P(zv), '\\', Z_STRLEN_P(zv)) + 1;
        lc_len = Z_STRLEN_P(zv) - (ns_separator - Z_STRVAL_P(zv));
        lc_name = zend_str_tolower_dup(ns_separator, lc_len);
        ZVAL_STRINGL(&c, lc_name, lc_len, 0);
@@ -479,7 +480,8 @@ int zend_add_class_name_literal(zend_op_array *op_array, const zval *zv TSRMLS_D
 int zend_add_const_name_literal(zend_op_array *op_array, const zval *zv, int unqualified TSRMLS_DC) /* {{{ */
 {
        int ret, tmp_literal;
-       char *name, *tmp_name, *ns_separator;
+       char *name, *tmp_name;
+       const char *ns_separator;
        int name_len, ns_len;
        zval c;
 
@@ -678,7 +680,7 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
                     CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE)) {
                        result->op_type = IS_CV;
                        result->u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC);
-                       varname->u.constant.value.str.val = CG(active_op_array)->vars[result->u.op.var].name;
+                       varname->u.constant.value.str.val = (char*)CG(active_op_array)->vars[result->u.op.var].name;
                        result->EA = 0;
                        return;
                }
@@ -1536,7 +1538,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
        int name_len = function_name->u.constant.value.str.len;
        int function_begin_line = function_token->u.op.opline_num;
        zend_uint fn_flags;
-       char *lcname;
+       const char *lcname;
        zend_bool orig_interactive;
        ALLOCA_FLAG(use_heap)
 
@@ -1852,7 +1854,7 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
        } else {
                var.op_type = IS_CV;
                var.u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, 0 TSRMLS_CC);
-               varname->u.constant.value.str.val = CG(active_op_array)->vars[var.u.op.var].name;
+               Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[var.u.op.var].name;
                var.EA = 0;
                if (CG(active_op_array)->vars[var.u.op.var].hash_value == THIS_HASHVAL &&
                        Z_STRLEN(varname->u.constant) == sizeof("this")-1 &&
@@ -1913,7 +1915,7 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
                                if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant))) {
                                        zend_resolve_class_name(class_type, opline->extended_value, 1 TSRMLS_CC);
                                }
-                               class_type->u.constant.value.str.val = zend_new_interned_string(class_type->u.constant.value.str.val, class_type->u.constant.value.str.len + 1, 1 TSRMLS_CC);
+                               Z_STRVAL(class_type->u.constant) = (char*)zend_new_interned_string(class_type->u.constant.value.str.val, class_type->u.constant.value.str.len + 1, 1 TSRMLS_CC);
                                cur_arg_info->class_name = class_type->u.constant.value.str.val;
                                cur_arg_info->class_name_len = class_type->u.constant.value.str.len;
                                if (op == ZEND_RECV_INIT) {
@@ -2749,7 +2751,7 @@ void zend_do_begin_catch(znode *try_token, znode *class_name, znode *catch_var,
        opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), &catch_class.u.constant TSRMLS_CC);
        opline->op2_type = IS_CV;
        opline->op2.var = lookup_cv(CG(active_op_array), catch_var->u.constant.value.str.val, catch_var->u.constant.value.str.len, 0 TSRMLS_CC);
-       catch_var->u.constant.value.str.val = CG(active_op_array)->vars[opline->op2.var].name;
+       Z_STRVAL(catch_var->u.constant) = (char*)CG(active_op_array)->vars[opline->op2.var].name;
        opline->result.num = 0; /* 1 means it's the last catch in the block */
 
        try_token->u.op.opline_num = catch_op_number;
@@ -2964,7 +2966,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
                }
                if (fe->common.arg_info[i].class_name
                        && strcasecmp(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)!=0) {
-                       char *colon;
+                       const char *colon;
 
                        if (fe->common.type != ZEND_USER_FUNCTION) {
                                return 0;
@@ -3935,7 +3937,7 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
        free(resulting_table);
 }
 
-static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, char* prop_name, int prop_name_length, ulong prop_hash, zend_class_entry *coliding_ce) /* {{{ */
+static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, const char* prop_name, int prop_name_length, ulong prop_hash, zend_class_entry *coliding_ce) /* {{{ */
 {
        size_t i;
        zend_property_info *coliding_prop;
@@ -3955,10 +3957,10 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
        zend_property_info *property_info;
        zend_property_info *coliding_prop;
        zval compare_result;
-       char* prop_name;
+       const char* prop_name;
        int   prop_name_length;
        ulong prop_hash;
-       char* class_name_unused;
+       const char* class_name_unused;
        zend_bool prop_found;
        zend_bool not_compatible;
        zval* prop_value;
@@ -4890,7 +4892,7 @@ static int zend_strnlen(const char* s, int maxlen) /* {{{ */
 }
 /* }}} */
 
-ZEND_API int zend_unmangle_property_name(char *mangled_property, int len, char **class_name, char **prop_name) /* {{{ */
+ZEND_API int zend_unmangle_property_name(const char *mangled_property, int len, const char **class_name, const char **prop_name) /* {{{ */
 {
        int class_name_len;
 
@@ -4965,7 +4967,7 @@ void zend_do_declare_property(const znode *var_name, const znode *value, zend_ui
 void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_DC) /* {{{ */
 {
        zval *property;
-       char *cname = NULL;
+       const char *cname = NULL;
        int result;
 
        if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
@@ -6047,7 +6049,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */
                }
 
                if (CG(multibyte)) {
-                       zend_encoding *new_encoding, *old_encoding;
+                       const zend_encoding *new_encoding, *old_encoding;
                        zend_encoding_filter old_input_filter;
 
                        CG(encoding_declared) = 1;
@@ -6464,7 +6466,7 @@ int zend_get_class_fetch_type(const char *class_name, uint class_name_len) /* {{
 }
 /* }}} */
 
-ZEND_API char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len) /* {{{ */
+ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len) /* {{{ */
 {
        if (name_len) {
                *name_len = op_array->vars[var].name_len;
@@ -6595,7 +6597,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
        if (new_name) {
                name = &new_name->u.constant;
        } else {
-               char *p;
+               const char *p;
 
                /* The form "use A\B" is eqivalent to "use A\B as B".
                   So we extract the last part of compound name to use as a new_name */
index a3802e469d197365dfbaccc1f1a7cd7a2944d69e..1266a1c47706731e5053f281450d330f38e2182b 100644 (file)
@@ -209,11 +209,11 @@ char *zend_visibility_string(zend_uint fn_flags);
 
 typedef struct _zend_property_info {
        zend_uint flags;
-       char *name;
+       const char *name;
        int name_length;
        ulong h;
        int offset;
-       char *doc_comment;
+       const char *doc_comment;
        int doc_comment_len;
        zend_class_entry *ce;
 } zend_property_info;
@@ -244,7 +244,7 @@ typedef struct _zend_internal_function_info {
 } zend_internal_function_info;
 
 typedef struct _zend_compiled_variable {
-       char *name;
+       const char *name;
        int name_len;
        ulong hash_value;
 } zend_compiled_variable;
@@ -252,7 +252,7 @@ typedef struct _zend_compiled_variable {
 struct _zend_op_array {
        /* Common elements */
        zend_uchar type;
-       char *function_name;            
+       const char *function_name;              
        zend_class_entry *scope;
        zend_uint fn_flags;
        union _zend_function *prototype;
@@ -282,10 +282,10 @@ struct _zend_op_array {
 
        zend_uint this_var;
 
-       char *filename;
+       const char *filename;
        zend_uint line_start;
        zend_uint line_end;
-       char *doc_comment;
+       const char *doc_comment;
        zend_uint doc_comment_len;
        zend_uint early_binding; /* the linked list of delayed declarations */
 
@@ -305,7 +305,7 @@ struct _zend_op_array {
 typedef struct _zend_internal_function {
        /* Common elements */
        zend_uchar type;
-       char * function_name;
+       const char * function_name;
        zend_class_entry *scope;
        zend_uint fn_flags;
        union _zend_function *prototype;
@@ -325,7 +325,7 @@ typedef union _zend_function {
 
        struct {
                zend_uchar type;  /* never used */
-               char *function_name;
+               const char *function_name;
                zend_class_entry *scope;
                zend_uint fn_flags;
                union _zend_function *prototype;
@@ -415,7 +415,7 @@ ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D);
 
 void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace TSRMLS_DC);
 void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_name TSRMLS_DC);
-ZEND_API char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len);
+ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len);
 
 #ifdef ZTS
 const char *zend_get_zendtext(TSRMLS_D);
@@ -650,7 +650,7 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce);
 void zend_class_add_ref(zend_class_entry **ce);
 
 ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, const char *src1, int src1_length, const char *src2, int src2_length, int internal);
-ZEND_API int zend_unmangle_property_name(char *mangled_property, int mangled_property_len, char **class_name, char **prop_name);
+ZEND_API int zend_unmangle_property_name(const char *mangled_property, int mangled_property_len, const char **class_name, const char **prop_name);
 
 #define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
 #define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
@@ -670,9 +670,9 @@ ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC)
 ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC);
 int zend_get_class_fetch_type(const char *class_name, uint class_name_len);
 
-typedef zend_bool (*zend_auto_global_callback)(char *name, uint name_len TSRMLS_DC);
+typedef zend_bool (*zend_auto_global_callback)(const char *name, uint name_len TSRMLS_DC);
 typedef struct _zend_auto_global {
-       char *name;
+       const char *name;
        uint name_len;
        zend_auto_global_callback auto_global_callback;
        zend_bool jit;
index 58cc495ebbf8b48bcd3ebf96e47a903395f6ca2f..2e8b1c729f9dab85e42754ca6418b935b7678861 100644 (file)
@@ -233,7 +233,8 @@ static int zend_get_halt_offset_constant(const char *name, uint name_len, zend_c
                return 0;
        } else if (name_len == sizeof("__COMPILER_HALT_OFFSET__")-1 &&
                  !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) {
-               char *cfilename, *haltname;
+               const char *cfilename;
+               char *haltname;
                int len, clen;
 
                cfilename = zend_get_executed_filename(TSRMLS_C);
@@ -462,7 +463,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
                /* keep in mind that c->name_len already contains the '\0' */
                lowercase_name = estrndup(c->name, c->name_len-1);
                zend_str_tolower(lowercase_name, c->name_len-1);
-               lowercase_name = zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
+               lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
                name = lowercase_name;
                chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0;
        } else {
@@ -470,7 +471,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
                if(slash) {
                        lowercase_name = estrndup(c->name, c->name_len-1);
                        zend_str_tolower(lowercase_name, slash-c->name);
-                       lowercase_name = zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
+                       lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
                        name = lowercase_name;
                        
                        chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0;
index 2259a9cd990a238c7467878babb9dc97e69a3381..9545570b75422dac76f72d5257c298aad6f02adb 100644 (file)
@@ -430,7 +430,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
                        TRACE_APPEND_STR("Array, ");
                        break;
                case IS_OBJECT: {
-                       char *class_name;
+                       const char *class_name;
                        zend_uint class_name_len;
                        int dup;
 
@@ -440,7 +440,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
 
                        TRACE_APPEND_STRL(class_name, class_name_len);
                        if(!dup) {
-                               efree(class_name);
+                               efree((char*)class_name);
                        }
 
                        TRACE_APPEND_STR("), ");
index 2fc9f119fe69c6113cf5619895fa05d34490f8ea..20d21402edde09037630e9416666168d20d63d16 100644 (file)
@@ -574,10 +574,10 @@ ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ul
        }
 }
 
-ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, char *given_kind TSRMLS_DC)
+ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC)
 {
        zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
-       char *fname = zf->common.function_name;
+       const char *fname = zf->common.function_name;
        char *fsep;
        const char *fclass;
 
index 95c239ae0479f6a6bc167d627f6e273c21940a9d..a050d0237710bec74c4904e58d48a9de6a822088 100644 (file)
@@ -75,7 +75,7 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name,
 ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
 
 ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC);
-ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, char *given_kind TSRMLS_DC);
+ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC);
 
 static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC)
 {
@@ -377,9 +377,9 @@ void execute_new_code(TSRMLS_D);
 
 
 /* services */
-ZEND_API char *get_active_class_name(char **space TSRMLS_DC);
-ZEND_API char *get_active_function_name(TSRMLS_D);
-ZEND_API char *zend_get_executed_filename(TSRMLS_D);
+ZEND_API const char *get_active_class_name(const char **space TSRMLS_DC);
+ZEND_API const char *get_active_function_name(TSRMLS_D);
+ZEND_API const char *zend_get_executed_filename(TSRMLS_D);
 ZEND_API uint zend_get_executed_lineno(TSRMLS_D);
 ZEND_API zend_bool zend_is_executing(TSRMLS_D);
 
index 9d4cc799a234a697746d99642da7d593bc14579f..5ae15f40e0a9ba7b47c8aec77c5f4ab894ef1567 100644 (file)
@@ -341,7 +341,7 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
 /* }}} */
 
 /* return class name and "::" or "". */
-ZEND_API char *get_active_class_name(char **space TSRMLS_DC) /* {{{ */
+ZEND_API const char *get_active_class_name(const char **space TSRMLS_DC) /* {{{ */
 {
        if (!zend_is_executing(TSRMLS_C)) {
                if (space) {
@@ -369,14 +369,14 @@ ZEND_API char *get_active_class_name(char **space TSRMLS_DC) /* {{{ */
 }
 /* }}} */
 
-ZEND_API char *get_active_function_name(TSRMLS_D) /* {{{ */
+ZEND_API const char *get_active_function_name(TSRMLS_D) /* {{{ */
 {
        if (!zend_is_executing(TSRMLS_C)) {
                return NULL;
        }
        switch (EG(current_execute_data)->function_state.function->type) {
                case ZEND_USER_FUNCTION: {
-                               char *function_name = ((zend_op_array *) EG(current_execute_data)->function_state.function)->function_name;
+                               const char *function_name = ((zend_op_array *) EG(current_execute_data)->function_state.function)->function_name;
 
                                if (function_name) {
                                        return function_name;
@@ -394,7 +394,7 @@ ZEND_API char *get_active_function_name(TSRMLS_D) /* {{{ */
 }
 /* }}} */
 
-ZEND_API char *zend_get_executed_filename(TSRMLS_D) /* {{{ */
+ZEND_API const char *zend_get_executed_filename(TSRMLS_D) /* {{{ */
 {
        if (EG(active_op_array)) {
                return EG(active_op_array)->filename;
@@ -515,7 +515,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
                if (!zend_get_constant_ex(p->value.str.val, p->value.str.len, &const_value, scope, Z_REAL_TYPE_P(p) TSRMLS_CC)) {
                        char *actual = Z_STRVAL_P(p);
 
-                       if ((colon = zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) {
+                       if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) {
                                zend_error(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(p));
                                Z_STRLEN_P(p) -= ((colon - Z_STRVAL_P(p)) + 1);
                                if (inline_change) {
@@ -615,8 +615,9 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
                                continue;
                        }
                        if (!zend_get_constant_ex(str_index, str_index_len - 3, &const_value, scope, str_index[str_index_len - 2] TSRMLS_CC)) {
-                               char *actual, *save = str_index;
-                               if ((colon = zend_memrchr(str_index, ':', str_index_len - 3))) {
+                               char *actual;
+                               const char *save = str_index;
+                               if ((colon = (char*)zend_memrchr(str_index, ':', str_index_len - 3))) {
                                        zend_error(E_ERROR, "Undefined class constant '%s'", str_index);
                                        str_index_len -= ((colon - str_index) + 1);
                                        str_index = colon;
@@ -1003,7 +1004,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                }
 
                if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
-                       efree(EX(function_state).function->common.function_name);
+                       efree((char*)EX(function_state).function->common.function_name);
                }
                efree(EX(function_state).function);
 
@@ -1686,7 +1687,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */
 }
 /* }}} */
 
-ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
 {
        if (zend_hash_quick_del(ht, name, name_len, hash_value) == SUCCESS) {
                name_len--;
@@ -1709,7 +1710,7 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, char *n
 }
 /* }}} */
 
-ZEND_API int zend_delete_global_variable_ex(char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
 {
        zend_execute_data *ex;
 
@@ -1734,7 +1735,7 @@ ZEND_API int zend_delete_global_variable_ex(char *name, int name_len, ulong hash
 }
 /* }}} */
 
-ZEND_API int zend_delete_global_variable(char *name, int name_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_delete_global_variable(const char *name, int name_len TSRMLS_DC) /* {{{ */
 {
        return zend_delete_global_variable_ex(name, name_len, zend_inline_hash_func(name, name_len + 1) TSRMLS_CC);
 }
index 6a0b7aa7f3850283d171ce8cc8c2aef82057562f..8ed037c7dd03d49fd25c66dedcd40db4ad008187 100644 (file)
@@ -84,7 +84,7 @@ typedef struct _gc_root_buffer {
        zend_object_handle        handle;       /* must be 0 for zval               */
        union {
                zval                 *pz;
-               zend_object_handlers *handlers;
+               const zend_object_handlers *handlers;
        } u;
 } gc_root_buffer;
 
index 3aca2e7b928f05d43b247dbadf4eca823d856b57..ad3f46a08d29f1816f43538b91b1a2eb3bc06962 100644 (file)
@@ -248,14 +248,14 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe
                if (!p) {
                        return FAILURE;
                }
-               p->arKey = (char*)arKey;
+               p->arKey = arKey;
        } else {
                p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent);
                if (!p) {
                        return FAILURE;
                }
-               p->arKey = (char*)(p + 1);
-               memcpy(p->arKey, arKey, nKeyLength);
+               p->arKey = (const char*)(p + 1);
+               memcpy((char*)p->arKey, arKey, nKeyLength);
        }
        p->nKeyLength = nKeyLength;
        INIT_DATA(ht, p, pData, nDataSize);
@@ -325,14 +325,14 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui
                if (!p) {
                        return FAILURE;
                }
-               p->arKey = (char*)arKey;
+               p->arKey = arKey;
        } else {
                p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent);
                if (!p) {
                        return FAILURE;
                }
-               p->arKey = (char*)(p + 1);
-               memcpy(p->arKey, arKey, nKeyLength);
+               p->arKey = (const char*)(p + 1);
+               memcpy((char*)p->arKey, arKey, nKeyLength);
        }
 
        p->nKeyLength = nKeyLength;
@@ -1157,7 +1157,7 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index,
                        if (duplicate) {
                                *str_index = estrndup(p->arKey, p->nKeyLength - 1);
                        } else {
-                               *str_index = p->arKey;
+                               *str_index = (char*)p->arKey;
                        }
                        if (str_length) {
                                *str_length = p->nKeyLength;
@@ -1402,8 +1402,8 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
                        if (IS_INTERNED(str_index)) {
                                p->arKey = str_index;
                        } else {
-                               p->arKey = (char*)(p+1);
-                               memcpy(p->arKey, str_index, str_length);
+                               p->arKey = (const char*)(p+1);
+                               memcpy((char*)p->arKey, str_index, str_length);
                        }
                }
 
index 3d13c3322b5c5be27e898fc4d0f9704955a17dc4..8aa1286e26a2342579d6eb97745fda6d1eb034af 100644 (file)
@@ -60,7 +60,7 @@ typedef struct bucket {
        struct bucket *pListLast;
        struct bucket *pNext;
        struct bucket *pLast;
-       char *arKey;
+       const char *arKey;
 } Bucket;
 
 typedef struct _hashtable {
@@ -83,7 +83,7 @@ typedef struct _hashtable {
 
 
 typedef struct _zend_hash_key {
-       char *arKey;
+       const char *arKey;
        uint nKeyLength;
        ulong h;
 } zend_hash_key;
index d829ed87890ecdf7dd5c5043572cd87f2f9cc6dd..5c2f8be31bcb3f3b63674772dc83f7a339289f82 100644 (file)
@@ -56,12 +56,12 @@ ZEND_API void zend_html_putc(char c)
 
 ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
 {
-       const char *ptr=s, *end=s+len;
-       char *filtered;
-       int filtered_len;
+       const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len;
+       unsigned char *filtered;
+       size_t filtered_len;
 
        if (LANG_SCNG(output_filter)) {
-               LANG_SCNG(output_filter)(&filtered, &filtered_len, s, len TSRMLS_CC);
+               LANG_SCNG(output_filter)(&filtered, &filtered_len, ptr, len TSRMLS_CC);
                ptr = filtered;
                end = filtered + filtered_len;
        }
@@ -115,7 +115,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
                                next_color = syntax_highlighter_ini->highlight_string;
                                break;
                        case T_WHITESPACE:
-                               zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);  /* no color needed */
+                               zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);  /* no color needed */
                                token.type = 0;
                                continue;
                                break;
@@ -138,7 +138,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
                        }
                }
 
-               zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);
+               zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);
 
                if (token.type == IS_STRING) {
                        switch (token_type) {
@@ -187,11 +187,11 @@ ZEND_API void zend_strip(TSRMLS_D)
                                continue;
                        
                        case T_END_HEREDOC:
-                               zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
+                               zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                efree(token.value.str.val);
                                /* read the following character, either newline or ; */
                                if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) {
-                                       zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
+                                       zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                }
                                zend_write("\n", sizeof("\n") - 1);
                                prev_space = 1;
@@ -199,7 +199,7 @@ ZEND_API void zend_strip(TSRMLS_D)
                                continue;
 
                        default:
-                               zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
+                               zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                break;
                }
 
index b8432a0be3699fca525ff9c603ab369bedcb13b3..03c572b9a3d8b08de183f002f78b653536b6d324 100644 (file)
@@ -64,7 +64,7 @@ ZEND_API void zend_indent()
        while ((token_type=lex_scan(&token TSRMLS_CC))) {
                switch (token_type) {
                        case T_INLINE_HTML:
-                               zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
+                               zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                break;
                        case T_WHITESPACE: {
                                        token.type = 0;
@@ -118,16 +118,16 @@ dflt_printout:
                                                        } else {
                                                                handle_whitespace(emit_whitespace);
                                                        }
-                                                       zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
+                                                       zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                                        break;
                                        }
                                } else {
                                        handle_whitespace(emit_whitespace);
                                        if (in_string) {
-                                               zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
+                                               zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                                /* a part of a string */
                                        } else {
-                                               zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
+                                               zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                        }
                                }
                                break;
index d2828b087f8c51eb7e470922f055e0ca2ccec0e4..d504cab6dcd69b335635d3f960b7015d4a7664f3 100755 (executable)
@@ -31,7 +31,7 @@ ZEND_API zend_class_entry *zend_ce_serializable;
 
 /* {{{ zend_call_method
  Only returns the returned zval if retval_ptr != NULL */
-ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
+ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
 {
        int result;
        zend_fcall_info fci;
index 6c14c8920ccc2b3241593d99c615590128f083b9..2cb3b7f152e8df88e3012f35de977f05918ad9c3 100755 (executable)
@@ -38,7 +38,7 @@ typedef struct _zend_user_iterator {
        zval                     *value;
 } zend_user_iterator;
 
-ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
+ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
 
 #define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \
        zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC)
index c8827aecae43710c5e69a5011c65cfaef3959248..fe707555581ca631347dc8cdde933b22329eceaa 100755 (executable)
@@ -51,9 +51,7 @@ static zend_object_handlers iterator_object_handlers = {
 ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)
 {
        INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL);
-       if (!IS_INTERNED(zend_iterator_class_entry.name)) {
-               free(zend_iterator_class_entry.name);
-       }
+       str_free(zend_iterator_class_entry.name);
        zend_iterator_class_entry.name = "__iterator_wrapper";
 }
 
index 02a82efc8fad665cf195fee849483a91c43313f8..447e8dc7f65cee1083105acf82c206bbd1ad39d8 100644 (file)
@@ -56,7 +56,7 @@ int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
 ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
 ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
 ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC);
-ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC);
+ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC);
 ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC);
 
 END_EXTERN_C()
index 827b7bf3d72816903f20334db7037fc58b4b9b0a..1dd509e090b2a795d5a3bc88553ad51d2c68a2ed 100644 (file)
@@ -469,7 +469,8 @@ ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSR
 
 ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
 {
-       char *file_path = NULL, *buf;
+       const char *file_path = NULL;
+       char *buf;
        size_t size, offset = 0;
 
        /* The shebang line was read, get the current position to obtain the buffer start */
@@ -497,7 +498,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
 
        if (size != -1) {
                if (CG(multibyte)) {
-                       SCNG(script_org) = buf;
+                       SCNG(script_org) = (unsigned char*)buf;
                        SCNG(script_org_size) = size;
                        SCNG(script_filtered) = NULL;
 
@@ -508,7 +509,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
                                        zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
                                                        "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
                                }
-                               buf = SCNG(script_filtered);
+                               buf = (char*)SCNG(script_filtered);
                                size = SCNG(script_filtered_size);
                        }
                }
@@ -663,7 +664,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
        size = str->value.str.len;
 
        if (CG(multibyte)) {
-               SCNG(script_org) = buf;
+               SCNG(script_org) = (unsigned char*)buf;
                SCNG(script_org_size) = size;
                SCNG(script_filtered) = NULL;
 
@@ -674,7 +675,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
                                zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
                                                "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
                        }
-                       buf = SCNG(script_filtered);
+                       buf = (char*)SCNG(script_filtered);
                        size = SCNG(script_filtered_size);
                }
        }
@@ -820,7 +821,7 @@ int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_
        return SUCCESS;
 }
 
-ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC)
+ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC)
 {
        size_t length;
        unsigned char *new_yy_start;
@@ -1552,7 +1553,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
 }
 
 <ST_IN_SCRIPTING>"__CLASS__" {
-       char *class_name = NULL;
+       const char *class_name = NULL;
        
        if (CG(active_class_entry)
                && (ZEND_ACC_TRAIT ==
@@ -1579,7 +1580,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
 }
 
 <ST_IN_SCRIPTING>"__TRAIT__" {
-       char *trait_name = NULL;
+       const char *trait_name = NULL;
        
        if (CG(active_class_entry)
                && (ZEND_ACC_TRAIT == 
@@ -1599,7 +1600,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
 }
 
 <ST_IN_SCRIPTING>"__FUNCTION__" {
-       char *func_name = NULL;
+       const char *func_name = NULL;
 
        if (CG(active_op_array)) {
                func_name = CG(active_op_array)->function_name;
@@ -1615,8 +1616,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
 }
 
 <ST_IN_SCRIPTING>"__METHOD__" {
-       char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
-       char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
+       const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
+       const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
        size_t len = 0;
 
        if (class_name) {
@@ -1691,7 +1692,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
 }
 
 <INITIAL>"<script"{WHITESPACE}+"language"{WHITESPACE}*"="{WHITESPACE}*("php"|"\"php\""|"'php'"){WHITESPACE}*">" {
-       YYCTYPE *bracket = zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
+       YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
 
        if (bracket != SCNG(yy_text)) {
                /* Handle previously scanned HTML, as possible <script> tags found are assumed to not be PHP's */
@@ -1780,7 +1781,7 @@ inline_char_handler:
                if (YYCURSOR < YYLIMIT) {
                        switch (*YYCURSOR) {
                                case '?':
-                                       if (CG(short_tags) || !strncasecmp(YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
+                                       if (CG(short_tags) || !strncasecmp((char*)YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
                                                break;
                                        }
                                        continue;
index 6f7c789ec4860b3af11975cf3f967411f0894f2d..2bd6ad409e1a54600b48aee38b928f04936c96ca 100644 (file)
@@ -113,8 +113,8 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
        void *resource;
        va_list resource_types;
        int i;
-       char *space;
-       char *class_name;
+       const char *space;
+       const char *class_name;
 
        if (default_id==-1) { /* use id */
                if (!passed_id) {
index b640d49a9750bb2148adad02da06e7f0f124a11f..92a1ddc6787533c48208bd47486e3ae0a1ba6bd5 100644 (file)
@@ -325,10 +325,10 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
 }
 /* }}} */
 
-ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, int prop_info_name_len TSRMLS_DC) /* {{{ */
 {
        zend_property_info *property_info;
-       char *class_name, *prop_name;
+       const char *class_name, *prop_name;
        zval member;
 
        zend_unmangle_property_name(prop_info_name, prop_info_name_len, &class_name, &prop_name);
@@ -1105,7 +1105,7 @@ static inline union _zend_function *zend_get_user_callstatic_function(zend_class
 
 /* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */
 
-ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen, const zend_literal *key TSRMLS_DC) /* {{{ */
+ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const zend_literal *key TSRMLS_DC) /* {{{ */
 {
        zend_function *fbc = NULL;
        char *lc_class_name, *lc_function_name = NULL;
@@ -1194,7 +1194,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
 }
 /* }}} */
 
-ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent, const zend_literal *key TSRMLS_DC) /* {{{ */
+ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const zend_literal *key TSRMLS_DC) /* {{{ */
 {
        zend_property_info *property_info;
        ulong hash_value;
@@ -1243,7 +1243,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *propert
 }
 /* }}} */
 
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len, const zend_literal *key TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, const zend_literal *key TSRMLS_DC) /* {{{ */
 {
        zend_error_noreturn(E_ERROR, "Attempt to unset static property %s::$%s", ce->name, property_name);
        return 0;
@@ -1439,7 +1439,7 @@ zend_class_entry *zend_std_object_get_class(const zval *object TSRMLS_DC) /* {{{
 }
 /* }}} */
 
-int zend_std_object_get_class_name(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) /* {{{ */
+int zend_std_object_get_class_name(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) /* {{{ */
 {
        zend_object *zobj;
        zend_class_entry *ce;
index ad472fe1245402447d40741135a227e876a926fd..8e830d16e62b24abe7f01aed0ae2029e1075b8a0 100644 (file)
@@ -87,7 +87,7 @@ typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp TS
 /* args on stack! */
 /* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this.
  */
-typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS);
+typedef int (*zend_object_call_method_t)(const char *method, INTERNAL_FUNCTION_PARAMETERS);
 typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len, const struct _zend_literal *key TSRMLS_DC);
 typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC);
 
@@ -98,7 +98,7 @@ typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC);
 typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC);
 
 typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zval *object TSRMLS_DC);
-typedef int (*zend_object_get_class_name_t)(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC);
+typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC);
 typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
 
 /* Cast an object to some other type
@@ -144,9 +144,9 @@ struct _zend_object_handlers {
 extern ZEND_API zend_object_handlers std_object_handlers;
 
 BEGIN_EXTERN_C()
-ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
-ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len, const struct _zend_literal *key TSRMLS_DC);
+ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
+ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
+ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, const struct _zend_literal *key TSRMLS_DC);
 ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC);
 ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC);
 ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
@@ -163,7 +163,7 @@ ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce,
 
 ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
 
-ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC);
+ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, int prop_info_name_len TSRMLS_DC);
 
 ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
 END_EXTERN_C()
index fdb3c32f2e1976e64ec28f0242d14ca0715cf2db..9d4f3e715f93220391913d3586f3ff8c4d3f1702 100644 (file)
@@ -223,16 +223,16 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce)
                while (ce->trait_aliases[i]) {
                        if (ce->trait_aliases[i]->trait_method) {
                                if (ce->trait_aliases[i]->trait_method->method_name) {
-                                       efree(ce->trait_aliases[i]->trait_method->method_name);
+                                       efree((char*)ce->trait_aliases[i]->trait_method->method_name);
                                }
                                if (ce->trait_aliases[i]->trait_method->class_name) {
-                                       efree(ce->trait_aliases[i]->trait_method->class_name);
+                                       efree((char*)ce->trait_aliases[i]->trait_method->class_name);
                                }
                                efree(ce->trait_aliases[i]->trait_method);
                        }
                        
                        if (ce->trait_aliases[i]->alias) {
-                               efree(ce->trait_aliases[i]->alias);
+                               efree((char*)ce->trait_aliases[i]->alias);
                        }
                        
                        efree(ce->trait_aliases[i]);
@@ -246,8 +246,8 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce)
                size_t i = 0;
                
                while (ce->trait_precedences[i]) {
-                       efree(ce->trait_precedences[i]->trait_method->method_name);
-                       efree(ce->trait_precedences[i]->trait_method->class_name);
+                       efree((char*)ce->trait_precedences[i]->trait_method->method_name);
+                       efree((char*)ce->trait_precedences[i]->trait_method->class_name);
                        efree(ce->trait_precedences[i]->trait_method);
 
                        if (ce->trait_precedences[i]->exclude_from_classes) {
@@ -291,16 +291,14 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce)
                                efree(ce->default_static_members_table);
                        }
                        zend_hash_destroy(&ce->properties_info);
-                       if (!IS_INTERNED(ce->name)) {
-                               efree(ce->name);
-                       }
+                       str_efree(ce->name);
                        zend_hash_destroy(&ce->function_table);
                        zend_hash_destroy(&ce->constants_table);
                        if (ce->num_interfaces > 0 && ce->interfaces) {
                                efree(ce->interfaces);
                        }
                        if (ce->info.user.doc_comment) {
-                               efree(ce->info.user.doc_comment);
+                               efree((char*)ce->info.user.doc_comment);
                        }
                        
                        _destroy_zend_class_traits_info(ce);
@@ -327,9 +325,7 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce)
                                free(ce->default_static_members_table);
                        }
                        zend_hash_destroy(&ce->properties_info);
-                       if (!IS_INTERNED(ce->name)) {
-                               free(ce->name);
-                       }
+                       str_free(ce->name);
                        zend_hash_destroy(&ce->function_table);
                        zend_hash_destroy(&ce->constants_table);
                        if (ce->num_interfaces > 0) {
@@ -386,10 +382,10 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
        efree(op_array->opcodes);
 
        if (op_array->function_name) {
-               efree(op_array->function_name);
+               efree((char*)op_array->function_name);
        }
        if (op_array->doc_comment) {
-               efree(op_array->doc_comment);
+               efree((char*)op_array->doc_comment);
        }
        if (op_array->brk_cont_array) {
                efree(op_array->brk_cont_array);
@@ -402,9 +398,9 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
        }
        if (op_array->arg_info) {
                for (i=0; i<op_array->num_args; i++) {
-                       str_efree((char *)op_array->arg_info[i].name);
-                       if (op_array->arg_info[i].class_name && !IS_INTERNED(op_array->arg_info[i].class_name)) {
-                               efree((char*)op_array->arg_info[i].class_name);
+                       str_efree(op_array->arg_info[i].name);
+                       if (op_array->arg_info[i].class_name) {
+                               str_efree(op_array->arg_info[i].class_name);
                        }
                }
                efree(op_array->arg_info);
index 263fa869e26aa78693e8f08707f4ba9f6d475253..88ef53bdb0f7a791467eafd502b104a6d0eaf503 100644 (file)
@@ -311,7 +311,7 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh TSRMLS_DC) /* {{{ */
                fh->opened_path = NULL;
        }
        if (fh->free_filename && fh->filename) {
-               efree(fh->filename);
+               efree((char*)fh->filename);
                fh->filename = NULL;
        }
 }
index 5c0434798521ab960354c9202e37bc296d492be7..d4bfe7ce96e8085588c2a341ab4f5fba1f29df1c 100644 (file)
@@ -61,7 +61,7 @@ typedef struct _zend_stream {
 
 typedef struct _zend_file_handle {
        zend_stream_type  type;
-       char              *filename;
+       const char        *filename;
        char              *opened_path;
        union {
                int           fd;
index 949c19158247083150f505feffad3732e0702ec4..bb423c02ed0f6193d71ee748b85da7f0460acbd1 100644 (file)
@@ -119,7 +119,7 @@ static const char *zend_new_interned_string_int(const char *arKey, int nKeyLengt
 #endif
        
        p->arKey = (char*)(p+1);
-       memcpy(p->arKey, arKey, nKeyLength);
+       memcpy((char*)p->arKey, arKey, nKeyLength);
        if (free_src) {
                efree((void *)arKey);
        }
index a130fbcc383864053809d9446fc06fbde852151f..6c0045278bfd98e28f1da6e87c0d81fce3759c4c 100644 (file)
@@ -50,13 +50,13 @@ void zend_interned_strings_dtor(TSRMLS_D);
 
 #define str_efree(s) do { \
                if (!IS_INTERNED(s)) { \
-                       efree(s); \
+                       efree((char*)s); \
                } \
        } while (0)
 
 #define str_free(s) do { \
                if (!IS_INTERNED(s)) { \
-                       free(s); \
+                       free((char*)s); \
                } \
        } while (0)
 
index 172f98a9bed6b39c9fd18543cd8d033b07f0b6a7..1667e7db396017fef61e62a8b83d8e08bfb385ea 100644 (file)
@@ -55,7 +55,7 @@ typedef struct _zend_object_handlers zend_object_handlers;
 
 typedef struct _zend_object_value {
        zend_object_handle handle;
-       zend_object_handlers *handlers;
+       const zend_object_handlers *handlers;
 } zend_object_value;
 
 #endif /* ZEND_TYPES_H */
index 3901b3804f76fa1ea01285400ab693660904c15c..4e944a13509e56b8534ee6b22f0d884df6b943d3 100644 (file)
@@ -2727,7 +2727,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
                }
 
                if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
-                       efree(fbc->common.function_name);
+                       efree((char*)fbc->common.function_name);
                }
                efree(fbc);
 
@@ -3167,8 +3167,8 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
        SAVE_OPLINE();
        if (UNEXPECTED(param == NULL)) {
                if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
-                       char *space;
-                       char *class_name;
+                       const char *space;
+                       const char *class_name;
                        zend_execute_data *ptr;
 
                        if (EG(active_op_array)->scope) {
@@ -4204,7 +4204,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
                        ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
 
                case ZEND_ITER_PLAIN_OBJECT: {
-                       char *class_name, *prop_name;
+                       const char *class_name, *prop_name;
                        zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
 
                        fe_ht = Z_OBJPROP_P(array);
@@ -4303,7 +4303,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
 
                switch (key_type) {
                        case HASH_KEY_IS_STRING:
-                               Z_STRVAL_P(key) = str_key;
+                               Z_STRVAL_P(key) = (char*)str_key;
                                Z_STRLEN_P(key) = str_key_len-1;
                                Z_TYPE_P(key) = IS_STRING;
                                break;
index 5b336256f7e0c4e17303a4c091cbb52f5941a4bb..af40d57d0ebf17413b51d02cd9d7957f853119a8 100644 (file)
@@ -696,7 +696,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
                }
 
                if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
-                       efree(fbc->common.function_name);
+                       efree((char*)fbc->common.function_name);
                }
                efree(fbc);
 
@@ -761,8 +761,8 @@ static int ZEND_FASTCALL  ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        SAVE_OPLINE();
        if (UNEXPECTED(param == NULL)) {
                if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
-                       char *space;
-                       char *class_name;
+                       const char *space;
+                       const char *class_name;
                        zend_execute_data *ptr;
 
                        if (EG(active_op_array)->scope) {
@@ -11387,7 +11387,7 @@ static int ZEND_FASTCALL  ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
                        ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
 
                case ZEND_ITER_PLAIN_OBJECT: {
-                       char *class_name, *prop_name;
+                       const char *class_name, *prop_name;
                        zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
 
                        fe_ht = Z_OBJPROP_P(array);
@@ -11486,7 +11486,7 @@ static int ZEND_FASTCALL  ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
 
                switch (key_type) {
                        case HASH_KEY_IS_STRING:
-                               Z_STRVAL_P(key) = str_key;
+                               Z_STRVAL_P(key) = (char*)str_key;
                                Z_STRLEN_P(key) = str_key_len-1;
                                Z_TYPE_P(key) = IS_STRING;
                                break;
index 690c887ac882246a86edc5ac95dcf439d6550093..93589f9cee5062326bc39658e5b5534d678fe344 100644 (file)
@@ -1825,7 +1825,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
                                if (Z_TYPE_PP(tmpns) == IS_STRING) {
                                        char *prefix;
                                        ulong idx;
-                                       int prefix_key_len;
+                                       uint prefix_key_len;
 
                                        if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(tmp), 
                                                &prefix, &prefix_key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) {
index c4380d1e48b1e2be52b52fdd1f5f6ecbfc28e18b..d9035f23fbbc66139fcf25135e8ded4f848cdb7c 100755 (executable)
@@ -401,7 +401,7 @@ options:
                if (options) {
                        zval **attr_value;
                        char *str_key;
-                       long long_key;
+                       ulong long_key;
                        
                        zend_hash_internal_pointer_reset(Z_ARRVAL_P(options));
                        while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(options), (void**)&attr_value) 
index 86f1543c8a547f3c342495ece62bb29650bedb12..75964272132b4245ebd216c5dd2c137cd5e56325 100755 (executable)
@@ -2727,7 +2727,7 @@ static union _zend_function *row_method_get(
        return fbc;
 }
 
-static int row_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
+static int row_call_method(const char *method, INTERNAL_FUNCTION_PARAMETERS)
 {
        return FAILURE;
 }
@@ -2749,7 +2749,7 @@ static zend_class_entry *row_get_ce(const zval *object TSRMLS_DC)
        return pdo_row_ce;
 }
 
-static int row_get_classname(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
+static int row_get_classname(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
 {
        if (parent) {
                return FAILURE;
index d90aeac7ac0e5af1e6abb6afe198a34c842a526a..697c35c1992606048c7cbef911da18d1b2c0ca1c 100644 (file)
@@ -45,7 +45,7 @@ PHAR_FUNC(phar_opendir) /* {{{ */
        if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
                char *arch, *entry, *fname;
                int arch_len, entry_len, fname_len;
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
                /* we are checking for existence of a file within the relative path.  Chances are good that this is
                   retrieving something from within the phar archive */
@@ -122,7 +122,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
                int arch_len, entry_len, fname_len;
                php_stream_context *context = NULL;
 
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
                if (strncasecmp(fname, "phar://", 7)) {
                        goto skip_phar;
@@ -253,7 +253,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
                php_stream_context *context = NULL;
                char *name;
                phar_archive_data *phar;
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
                if (strncasecmp(fname, "phar://", 7)) {
                        goto skip_phar;
@@ -349,7 +349,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
                php_stream_context *context = NULL;
                char *name;
                phar_archive_data *phar;
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
                if (strncasecmp(fname, "phar://", 7)) {
                        goto skip_phar;
@@ -621,7 +621,7 @@ static void phar_file_stat(const char *filename, php_stat_len filename_length, i
                phar_entry_info *data = NULL;
                phar_archive_data *phar;
 
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
                /* we are checking for existence of a file within the relative path.  Chances are good that this is
                   retrieving something from within the phar archive */
@@ -911,7 +911,7 @@ PHAR_FUNC(phar_is_file) /* {{{ */
        if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
                char *arch, *entry, *fname;
                int arch_len, entry_len, fname_len;
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
                /* we are checking for existence of a file within the relative path.  Chances are good that this is
                   retrieving something from within the phar archive */
@@ -978,7 +978,7 @@ PHAR_FUNC(phar_is_link) /* {{{ */
        if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
                char *arch, *entry, *fname;
                int arch_len, entry_len, fname_len;
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
                /* we are checking for existence of a file within the relative path.  Chances are good that this is
                   retrieving something from within the phar archive */
index c45efbf44171e5d9d59e9942f7520d7ac02839fa..05d24d4384b39132400d61211eec69b51f084dbc 100644 (file)
@@ -2331,7 +2331,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
                *error = NULL;
        }
 
-       fname = zend_get_executed_filename(TSRMLS_C);
+       fname = (char*)zend_get_executed_filename(TSRMLS_C);
        fname_len = strlen(fname);
 
        if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, 0, REPORT_ERRORS, NULL, 0 TSRMLS_CC) == SUCCESS) {
@@ -3336,7 +3336,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
                return phar_orig_compile_file(file_handle, type TSRMLS_CC);
        }
        if (strstr(file_handle->filename, ".phar") && !strstr(file_handle->filename, "://")) {
-               if (SUCCESS == phar_open_from_filename(file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
+               if (SUCCESS == phar_open_from_filename((char*)file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
                        if (phar->is_zip || phar->is_tar) {
                                zend_file_handle f = *file_handle;
 
@@ -3417,7 +3417,7 @@ int phar_zend_open(const char *filename, zend_file_handle *handle TSRMLS_DC) /*
                char *fname;
                int fname_len;
 
-               fname = zend_get_executed_filename(TSRMLS_C);
+               fname = (char*)zend_get_executed_filename(TSRMLS_C);
                fname_len = strlen(fname);
 
                if (fname_len > 7 && !strncasecmp(fname, "phar://", 7)) {
index 70dcc3fbbd3a8675321cfd95aa0a6aa74c6c1f87..ceff6caa34f2226a1d7bec9a909a5ec0a574e976 100644 (file)
@@ -541,7 +541,7 @@ PHP_METHOD(Phar, running)
                return;
        }
 
-       fname = zend_get_executed_filename(TSRMLS_C);
+       fname = (char*)zend_get_executed_filename(TSRMLS_C);
        fname_len = strlen(fname);
 
        if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
@@ -575,7 +575,7 @@ PHP_METHOD(Phar, mount)
                return;
        }
 
-       fname = zend_get_executed_filename(TSRMLS_C);
+       fname = (char*)zend_get_executed_filename(TSRMLS_C);
        fname_len = strlen(fname);
 
 #ifdef PHP_WIN32
@@ -670,7 +670,7 @@ PHP_METHOD(Phar, webPhar)
        }
 
        phar_request_initialize(TSRMLS_C);
-       fname = zend_get_executed_filename(TSRMLS_C);
+       fname = (char*)zend_get_executed_filename(TSRMLS_C);
        fname_len = strlen(fname);
 
        if (phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) != SUCCESS) {
@@ -1482,7 +1482,7 @@ PHP_METHOD(Phar, unlinkArchive)
                return;
        }
 
-       zname = zend_get_executed_filename(TSRMLS_C);
+       zname = (char*)zend_get_executed_filename(TSRMLS_C);
        zname_len = strlen(zname);
 
        if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
index 22c99bb8d9cedd8ce7f098cf878ff62a0a25cfee..ad59a612ca17cac27b238f540df69bfbf35a5d62 100644 (file)
@@ -273,7 +273,7 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d
                return phar_save_resolve_path(filename, filename_len TSRMLS_CC);
        }
 
-       fname = zend_get_executed_filename(TSRMLS_C);
+       fname = (char*)zend_get_executed_filename(TSRMLS_C);
        fname_len = strlen(fname);
 
        if (PHAR_G(last_phar) && !memcmp(fname, "phar://", 7) && fname_len - 7 >= PHAR_G(last_phar_name_len) && !memcmp(fname + 7, PHAR_G(last_phar_name), PHAR_G(last_phar_name_len))) {
@@ -365,7 +365,7 @@ splitted:
                goto doit;
        }
 
-       fname = zend_get_executed_filename(TSRMLS_C);
+       fname = (char*)zend_get_executed_filename(TSRMLS_C);
 
        if (SUCCESS != phar_split_fname(fname, strlen(fname), &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) {
                goto doit;
@@ -523,7 +523,7 @@ not_stream:
 
        /* check in calling scripts' current working directory as a fall back case */
        if (zend_is_executing(TSRMLS_C)) {
-               char *exec_fname = zend_get_executed_filename(TSRMLS_C);
+               char *exec_fname = (char*)zend_get_executed_filename(TSRMLS_C);
                int exec_fname_length = strlen(exec_fname);
                const char *p;
                int n = 0;
index 628f492a21503694649e11eae9e8ba653f1047ca..a6339fa56f8396654a8fefb17da178cff774be11 100644 (file)
@@ -275,7 +275,7 @@ static void _free_function(zend_function *fptr TSRMLS_DC) /* {{{ */
                && fptr->type == ZEND_INTERNAL_FUNCTION
                && (fptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0)
        {
-               efree(fptr->internal_function.function_name);
+               efree((char*)fptr->internal_function.function_name);
                efree(fptr);
        }
 }
@@ -302,7 +302,7 @@ static void reflection_free_objects_storage(void *object TSRMLS_DC) /* {{{ */
                        break;
                case REF_TYPE_DYNAMIC_PROPERTY:
                        prop_reference = (property_reference*)intern->ptr;
-                       efree(prop_reference->prop.name);
+                       efree((char*)prop_reference->prop.name);
                        efree(intern->ptr);
                        break;
                case REF_TYPE_OTHER:
@@ -923,7 +923,7 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry
 /* {{{ _property_string */
 static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC)
 {
-       char *class_name;
+       const char *class_name;
 
        string_printf(str, "%sProperty [ ", indent);
        if (!prop) {
@@ -953,7 +953,7 @@ static void _property_string(string *str, zend_property_info *prop, char *prop_n
                        string_printf(str, "static ");
                }
 
-               zend_unmangle_property_name(prop->name, prop->name_length, &class_name, &prop_name);
+               zend_unmangle_property_name(prop->name, prop->name_length, &class_name, (const char**)&prop_name);
                string_printf(str, "$%s", prop_name);
        }
 
@@ -1316,7 +1316,7 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
        zval *name;
        zval *classname;
        property_reference *reference;
-       char *class_name, *prop_name;
+       const char *class_name, *prop_name;
 
        zend_unmangle_property_name(prop->name, prop->name_length, &class_name, &prop_name);
 
@@ -2205,7 +2205,7 @@ ZEND_METHOD(reflection_parameter, __construct)
                if (position < 0 || (zend_uint)position >= fptr->common.num_args) {
                        if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
                                if (fptr->type != ZEND_OVERLOADED_FUNCTION) {
-                                       efree(fptr->common.function_name);
+                                       efree((char*)fptr->common.function_name);
                                }
                                efree(fptr);
                        }
@@ -2229,7 +2229,7 @@ ZEND_METHOD(reflection_parameter, __construct)
                if (position == -1) {
                        if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
                                if (fptr->type != ZEND_OVERLOADED_FUNCTION) {
-                                       efree(fptr->common.function_name);
+                                       efree((char*)fptr->common.function_name);
                                }
                                efree(fptr);
                        }
@@ -4154,7 +4154,6 @@ ZEND_METHOD(reflection_class, newInstance)
    Returns an instance of this class without invoking its constructor */
 ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
 {
-       zval *retval_ptr = NULL;
        reflection_object *intern;
        zend_class_entry *ce;
 
@@ -4646,7 +4645,8 @@ ZEND_METHOD(reflection_property, export)
 ZEND_METHOD(reflection_property, __construct)
 {
        zval *propname, *classname;
-       char *name_str, *class_name, *prop_name;
+       char *name_str;
+       const char *class_name, *prop_name;
        int name_len, dynam_prop = 0;
        zval *object;
        reflection_object *intern;
@@ -4871,7 +4871,7 @@ ZEND_METHOD(reflection_property, getValue)
                zval_copy_ctor(return_value);
                INIT_PZVAL(return_value);
        } else {
-               char *class_name, *prop_name;
+               const char *class_name, *prop_name;
 
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
                        return;
@@ -4946,7 +4946,7 @@ ZEND_METHOD(reflection_property, setValue)
                        }
                }
        } else {
-               char *class_name, *prop_name;
+               const char *class_name, *prop_name;
 
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) {
                        return;
@@ -4965,7 +4965,7 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
        property_reference *ref;
        zend_class_entry *tmp_ce, *ce;
        zend_property_info *tmp_info;
-       char *prop_name, *class_name;
+       const char *prop_name, *class_name;
        int prop_name_len;
 
        if (zend_parse_parameters_none() == FAILURE) {
index d511a462fe0d1e7adca02c0234f6b848080d9a5f..4e2578a44750aadf58b06e9b09519b207536d857 100644 (file)
@@ -1116,7 +1116,7 @@ static int php_session_cache_limiter(TSRMLS_D) /* {{{ */
        if (PS(cache_limiter)[0] == '\0') return 0;
 
        if (SG(headers_sent)) {
-               char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
+               const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
                int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
 
                if (output_start_filename) {
@@ -1156,7 +1156,7 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */
        char *e_session_name, *e_id;
 
        if (SG(headers_sent)) {
-               char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
+               const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
                int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
 
                if (output_start_filename) {
index 5469d6d8261027425b02b7503d3e48236ec36f13..e7c3f2fcf9fb38567330647e0a5cc3978ca16794 100644 (file)
@@ -2062,10 +2062,10 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
                                property = master_to_xml(get_conversion((*zprop)->type), (*zprop), style, xmlParam TSRMLS_CC);
 
                                if (key_type == HASH_KEY_IS_STRING) {
-                               char *prop_name;
+                                       const char *prop_name;
 
                                        if (Z_TYPE_P(data) == IS_OBJECT) {
-                                               char *class_name;
+                                               const char *class_name;
 
                                                zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
                                        } else {
index d189c7faefefb9ea2037937410ecb4f48f78084d..dd23c95c5f85542c76b6fb728e79479755e25f1d 100644 (file)
@@ -186,7 +186,7 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
                Z_LVAL(first) = f->h;
        } else {
                Z_TYPE(first) = IS_STRING;
-               Z_STRVAL(first) = f->arKey;
+               Z_STRVAL(first) = (char*)f->arKey;
                Z_STRLEN(first) = f->nKeyLength - 1;
        }
 
@@ -195,7 +195,7 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
                Z_LVAL(second) = s->h;
        } else {
                Z_TYPE(second) = IS_STRING;
-               Z_STRVAL(second) = s->arKey;
+               Z_STRVAL(second) = (char*)s->arKey;
                Z_STRLEN(second) = s->nKeyLength - 1;
        }
 
index 9fd11049280d1043597d3214254c6f91caf4d8d2..e163d5fee1947ce75be230837f0ca7362b28f9ea 100644 (file)
@@ -200,7 +200,7 @@ PHP_FUNCTION(assert)
                zval *retval;
                int i;
                uint lineno = zend_get_executed_lineno(TSRMLS_C);
-               char *filename = zend_get_executed_filename(TSRMLS_C);
+               const char *filename = zend_get_executed_filename(TSRMLS_C);
 
                MAKE_STD_ZVAL(args[0]);
                MAKE_STD_ZVAL(args[1]);
index 05f5fb4e5af9c637b9cc750733dc26e2b51d835b..75035b30b075c60ac76cc679ccf7422b76a65112 100644 (file)
@@ -220,7 +220,7 @@ PHP_FUNCTION(setrawcookie)
 PHP_FUNCTION(headers_sent)
 {
        zval *arg1 = NULL, *arg2 = NULL;
-       char *file="";
+       const char *file="";
        int line=0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zz", &arg1, &arg2) == FAILURE)
index 352119d9721535ff6ca1dc7f534488bdd7e8025a..189114614275811ba90bd057ecfe531871dd9ca1 100644 (file)
@@ -31,8 +31,10 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
                                const char *key_suffix, int key_suffix_len,
                          zval *type, char *arg_sep, int enc_type TSRMLS_DC)
 {
-       char *key = NULL, *ekey, *newprefix, *p;
-       int arg_sep_len, key_len, ekey_len, key_type, newprefix_len;
+       char *key = NULL;
+       char *ekey, *newprefix, *p;
+       int arg_sep_len, ekey_len, key_type, newprefix_len;
+       uint key_len;
        ulong idx;
        zval **zdata = NULL, *copyzval;
 
@@ -64,14 +66,14 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
 
                /* handling for private & protected object properties */
                if (key && *key == '\0' && type != NULL) {
-                       char *tmp;
+                       const char *tmp;
 
                        zend_object *zobj = zend_objects_get_address(type TSRMLS_CC);
                        if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) != SUCCESS) {
                                /* private or protected property access outside of the class */
                                continue;
                        }
-                       zend_unmangle_property_name(key, key_len-1, &tmp, &key);
+                       zend_unmangle_property_name(key, key_len-1, &tmp, (const char**)&key);
                        key_len = strlen(key);          
                }
 
index 936371b21f521c373a4868df8248704124b2c33c..0540a82514324be613bc7d837817df280da2c568 100644 (file)
@@ -232,7 +232,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
                efree(tmp);
        }
        if (PG(mail_x_header)) {
-               char *tmp = zend_get_executed_filename(TSRMLS_C);
+               const char *tmp = zend_get_executed_filename(TSRMLS_C);
                char *f;
                size_t f_len;
 
index 8284204c8902c6de7df985cf82a17b522ec58832..495b8f07aa413df92cb44580ece664117f71dcad 100644 (file)
@@ -122,10 +122,10 @@ PHPAPI char *php_strtoupper(char *s, size_t len);
 PHPAPI char *php_strtolower(char *s, size_t len);
 PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
 PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC);
-PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC);
+PHPAPI char *php_addcslashes(const char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC);
 PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC);
 PHPAPI void php_stripcslashes(char *str, int *len);
-PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC);
+PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC);
 PHPAPI size_t php_dirname(char *str, size_t len);
 PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len);
 PHPAPI char *php_str_to_str_ex(char *haystack, int length, char *needle,
index dd43665525293515191fcc49395d6d8ccbf4a874..e79df5b5d5059a4a1a1cea1066aa0a34fd243fda 100644 (file)
@@ -1400,13 +1400,13 @@ PHP_FUNCTION(strtolower)
 
 /* {{{ php_basename
  */
-PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC)
+PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC)
 {
        char *ret = NULL, *c, *comp, *cend;
        size_t inc_len, cnt;
        int state;
 
-       c = comp = cend = s;
+       c = comp = cend = (char*)s;
        cnt = len;
        state = 0;
        while (cnt > 0) {
@@ -3214,7 +3214,7 @@ PHPAPI void php_stripcslashes(char *str, int *len)
                        
 /* {{{ php_addcslashes
  */
-PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_free, char *what, int wlength TSRMLS_DC)
+PHPAPI char *php_addcslashes(const char *str, int length, int *new_length, int should_free, char *what, int wlength TSRMLS_DC)
 {
        char flags[256];
        char *new_str = safe_emalloc(4, (length?length:(length=strlen(str))), 1);
@@ -3229,7 +3229,7 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_
 
        php_charmask((unsigned char *)what, wlength, flags TSRMLS_CC);
 
-       for (source = str, end = source + length, target = new_str; source < end; source++) {
+       for (source = (char*)str, end = source + length, target = new_str; source < end; source++) {
                c = *source; 
                if (flags[(unsigned char)c]) {
                        if ((unsigned char) c < 32 || (unsigned char) c > 126) {
@@ -3259,7 +3259,7 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_
                *new_length = newlen;
        }
        if (should_free) {
-               STR_FREE(str);
+               STR_FREE((char*)str);
        }
        return new_str;
 }
@@ -4747,7 +4747,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
 PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */
 {
        zval op1_copy, op2_copy;
-       int use_copy1 = 0, use_copy2 = 0, sort_result;
+       int use_copy1 = 0, use_copy2 = 0;
 
        if (Z_TYPE_P(op1) != IS_STRING) {
                zend_make_printable_zval(op1, &op1_copy, &use_copy1);
index 9afc4f1568a8785708944ce2fc3c162f4d80310b..251ef3db48d3bbb9b2b9a7a24a36dadd0848e1ad 100644 (file)
@@ -544,7 +544,8 @@ PHP_FUNCTION(stream_bucket_new)
 PHP_FUNCTION(stream_get_filters)
 {
        char *filter_name;
-       int key_flags, filter_name_len = 0;
+       int key_flags;
+       uint filter_name_len = 0;
        HashTable *filters_hash;
        ulong num_key;
 
index 404504a1f37319d46542d05b12a2343701d14eda..a70438bc7fa575c4afc696bc130e8481d14d044d 100644 (file)
@@ -56,7 +56,7 @@ static int php_array_element_dump(zval **zv TSRMLS_DC, int num_args, va_list arg
 static int php_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
 {
        int level;
-       char *prop_name, *class_name;
+       const char *prop_name, *class_name;
 
        level = va_arg(args, int);
 
@@ -87,7 +87,7 @@ static int php_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list a
 PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC) /* {{{ */
 {
        HashTable *myht;
-       char *class_name;
+       const char *class_name;
        zend_uint class_name_len;
        int (*php_element_dump_func)(zval** TSRMLS_DC, int, va_list, zend_hash_key*);
        int is_temp;
@@ -136,7 +136,7 @@ PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC) /* {{{ */
                if (Z_OBJ_HANDLER(**struc, get_class_name)) {
                        Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC);
                        php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0);
-                       efree(class_name);
+                       efree((char*)class_name);
                } else {
                        php_printf("%sobject(unknown class)#%d (%d) {\n", COMMON, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0);
                }
@@ -213,7 +213,7 @@ static int zval_array_element_dump(zval **zv TSRMLS_DC, int num_args, va_list ar
 static int zval_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
 {
        int level;
-       char *prop_name, *class_name;
+       const char *prop_name, *class_name;
 
        level = va_arg(args, int);
 
@@ -242,7 +242,7 @@ static int zval_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list
 PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC) /* {{{ */
 {
        HashTable *myht = NULL;
-       char *class_name;
+       const char *class_name;
        zend_uint class_name_len;
        int (*zval_element_dump_func)(zval** TSRMLS_DC, int, va_list, zend_hash_key*);
        int is_temp = 0;
@@ -286,7 +286,7 @@ PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC) /* {{{ */
                }
                Z_OBJ_HANDLER_PP(struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC);
                php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0, Z_REFCOUNT_PP(struc));
-               efree(class_name);
+               efree((char*)class_name);
                zval_element_dump_func = zval_object_property_dump;
 head_done:
                if (myht) {
@@ -388,9 +388,9 @@ static int php_object_element_export(zval **zv TSRMLS_DC, int num_args, va_list
 
        buffer_append_spaces(buf, level + 2);
        if (hash_key->nKeyLength != 0) {
-               char *class_name, /* ignored, but must be passed to unmangle */
-                        *pname,
-                        *pname_esc;
+               const char *class_name; /* ignored, but must be passed to unmangle */
+               const char *pname;
+               char *pname_esc;
                int  pname_esc_len;
                
                zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength - 1,
@@ -418,7 +418,7 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC)
        HashTable *myht;
        char *tmp_str, *tmp_str2;
        int tmp_len, tmp_len2;
-       char *class_name;
+       const char *class_name;
        zend_uint class_name_len;
 
        switch (Z_TYPE_PP(struc)) {
@@ -478,7 +478,7 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC)
                smart_str_appendl(buf, class_name, class_name_len);
                smart_str_appendl(buf, "::__set_state(array(\n", 21);
 
-               efree(class_name);
+               efree((char*)class_name);
                if (myht) {
                        zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) php_object_element_export, 1, level, buf);
                }
index 13345017a061759b9523e936eec3f7c0b3497e54..f9ebfe36315298524aa8429bd35acdbb1b2992f9 100644 (file)
@@ -457,7 +457,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
 /* OBJECTS_FIXME */
        zval **ent, *fname, **varname;
        zval *retval = NULL;
-       char *key;
+       const char *key;
        ulong idx;
        char tmp_buf[WDDX_BUF_LEN];
        HashTable *objhash, *sleephash;
@@ -529,7 +529,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
                        }
 
                        if (zend_hash_get_current_key_ex(objhash, &key, &key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) {
-                               char *class_name, *prop_name;
+                               const char *class_name, *prop_name;
                                
                                zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
                                php_wddx_serialize_var(packet, *ent, prop_name, strlen(prop_name)+1 TSRMLS_CC);
index 91ed4be65411126e0eb694c83e52d2adcb271534..2bcf19dd13567e330390315b368186ca0486f315 100644 (file)
@@ -644,7 +644,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
        int http_response_code;
 
        if (SG(headers_sent) && !SG(request_info).no_headers) {
-               char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
+               const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
                int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
 
                if (output_start_filename) {
index f4d122bbbb420f6a369e214af167911e169381aa..19313561fada77fe182c1d620d499fa6790966bb 100644 (file)
@@ -565,7 +565,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
        /* check in calling scripts' current working directory as a fall back case
         */
        if (zend_is_executing(TSRMLS_C)) {
-               char *exec_fname = zend_get_executed_filename(TSRMLS_C);
+               const char *exec_fname = zend_get_executed_filename(TSRMLS_C);
                int exec_fname_length = strlen(exec_fname);
 
                while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length]));
@@ -611,7 +611,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
 PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC)
 {
        char *pathbuf, *ptr, *end;
-       char *exec_fname;
+       const char *exec_fname;
        char trypath[MAXPATHLEN];
        FILE *fp;
        int path_length;
index 4a70b2b691fcb2e66fac08a3986dbee204712547..7ee8e69057e23c494fe94f0d4ecb35602a3032e7 100644 (file)
@@ -627,9 +627,9 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
        char *docref_target = "", *docref_root = "";
        char *p;
        int buffer_len = 0;
-       char *space = "";
-       char *class_name = "";
-       char *function;
+       const char *space = "";
+       const char *class_name = "";
+       const char *function;
        int origin_len;
        char *origin;
        char *message;
@@ -1287,7 +1287,7 @@ static int php_get_configuration_directive_for_zend(const char *name, uint name_
 
 /* {{{ php_message_handler_for_zend
  */
-static void php_message_handler_for_zend(long message, void *data TSRMLS_DC)
+static void php_message_handler_for_zend(long message, const void *data TSRMLS_DC)
 {
        switch (message) {
                case ZMSG_FAILED_INCLUDE_FOPEN:
index 6006b5321d19f703cd9d58eae7c78376604ea45c..866ff1d0f575a606d27d1fc8e4400d648fd0ad3e 100644 (file)
@@ -676,7 +676,7 @@ PHPAPI void php_output_set_implicit_flush(int flush TSRMLS_DC)
 
 /* {{{ char *php_output_get_start_filename(TSRMLS_D)
  * Get the file name where output has started */
-PHPAPI char *php_output_get_start_filename(TSRMLS_D)
+PHPAPI const char *php_output_get_start_filename(TSRMLS_D)
 {
        return OG(output_start_filename);
 }
index 2ba0a5b67806826a5e3a6dc9b92b15f0c731e608..da212d8ff6403f8b9393c3ff5ca0f977784c10d9 100644 (file)
@@ -145,7 +145,7 @@ ZEND_BEGIN_MODULE_GLOBALS(output)
        zend_stack handlers;
        php_output_handler *active;
        php_output_handler *running;
-       char *output_start_filename;
+       const char *output_start_filename;
        int output_start_lineno;
 ZEND_END_MODULE_GLOBALS(output)
 
@@ -201,7 +201,7 @@ PHPAPI void php_output_deactivate(TSRMLS_D);
 PHPAPI void php_output_set_status(int status TSRMLS_DC);
 PHPAPI int php_output_get_status(TSRMLS_D);
 PHPAPI void php_output_set_implicit_flush(int flush TSRMLS_DC);
-PHPAPI char *php_output_get_start_filename(TSRMLS_D);
+PHPAPI const char *php_output_get_start_filename(TSRMLS_D);
 PHPAPI int php_output_get_start_lineno(TSRMLS_D);
 
 PHPAPI int php_output_write_unbuffered(const char *str, size_t len TSRMLS_DC);
index 40ad26fc9de5100fe042b12e9ee29b9df13900a7..cfb238021077a8133c51c21baddc7c69e67814cd 100644 (file)
@@ -617,9 +617,9 @@ static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC)
 }
 /* }}} */
 
-static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC);
-static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC);
-static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC);
+static zend_bool php_auto_globals_create_server(const char *name, uint name_len TSRMLS_DC);
+static zend_bool php_auto_globals_create_env(const char *name, uint name_len TSRMLS_DC);
+static zend_bool php_auto_globals_create_request(const char *name, uint name_len TSRMLS_DC);
 
 /* {{{ php_hash_environment
  */
@@ -634,7 +634,7 @@ int php_hash_environment(TSRMLS_D)
 }
 /* }}} */
 
-static zend_bool php_auto_globals_create_get(char *name, uint name_len TSRMLS_DC)
+static zend_bool php_auto_globals_create_get(const char *name, uint name_len TSRMLS_DC)
 {
        zval *vars;
 
@@ -657,7 +657,7 @@ static zend_bool php_auto_globals_create_get(char *name, uint name_len TSRMLS_DC
        return 0; /* don't rearm */
 }
 
-static zend_bool php_auto_globals_create_post(char *name, uint name_len TSRMLS_DC)
+static zend_bool php_auto_globals_create_post(const char *name, uint name_len TSRMLS_DC)
 {
        zval *vars;
 
@@ -684,7 +684,7 @@ static zend_bool php_auto_globals_create_post(char *name, uint name_len TSRMLS_D
        return 0; /* don't rearm */
 }
 
-static zend_bool php_auto_globals_create_cookie(char *name, uint name_len TSRMLS_DC)
+static zend_bool php_auto_globals_create_cookie(const char *name, uint name_len TSRMLS_DC)
 {
        zval *vars;
 
@@ -707,7 +707,7 @@ static zend_bool php_auto_globals_create_cookie(char *name, uint name_len TSRMLS
        return 0; /* don't rearm */
 }
 
-static zend_bool php_auto_globals_create_files(char *name, uint name_len TSRMLS_DC)
+static zend_bool php_auto_globals_create_files(const char *name, uint name_len TSRMLS_DC)
 {
        zval *vars;
 
@@ -726,7 +726,7 @@ static zend_bool php_auto_globals_create_files(char *name, uint name_len TSRMLS_
        return 0; /* don't rearm */
 }
 
-static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC)
+static zend_bool php_auto_globals_create_server(const char *name, uint name_len TSRMLS_DC)
 {
        if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) {
                php_register_server_variables(TSRMLS_C);
@@ -764,7 +764,7 @@ static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS
        return 0; /* don't rearm */
 }
 
-static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC)
+static zend_bool php_auto_globals_create_env(const char *name, uint name_len TSRMLS_DC)
 {
        zval *env_vars = NULL;
        ALLOC_ZVAL(env_vars);
@@ -785,7 +785,7 @@ static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC
        return 0; /* don't rearm */
 }
 
-static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC)
+static zend_bool php_auto_globals_create_request(const char *name, uint name_len TSRMLS_DC)
 {
        zval *form_variables;
        unsigned char _gpc_flags[3] = {0, 0, 0};
index c54ccd2ccffe91c848c3367108650a6442e7c9e5..d7d405150297c766bbedbeaa75644a43cc4fe087 100644 (file)
@@ -1362,7 +1362,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char
 {
        /* code ripped off from fopen_wrappers.c */
        char *pathbuf, *ptr, *end;
-       char *exec_fname;
+       const char *exec_fname;
        char trypath[MAXPATHLEN];
        php_stream *stream;
        int path_length;
index 9d8c1f113246c453b8265f60ff6ad3cb6a65ec32..5c2725f28b87aa59b85a980282cd79f28ee946f6 100644 (file)
@@ -940,15 +940,15 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
                file_handle.type = ZEND_HANDLE_FP;
                file_handle.opened_path = NULL;
                file_handle.free_filename = 0;
-               php_self = file_handle.filename;
+               php_self = (char*)file_handle.filename;
 
                /* before registering argv to module exchange the *new* argv[0] */
                /* we can achieve this without allocating more memory */
                SG(request_info).argc=argc-php_optind+1;
                arg_excp = argv+php_optind-1;
                arg_free = argv[php_optind-1];
-               SG(request_info).path_translated = file_handle.filename;
-               argv[php_optind-1] = file_handle.filename;
+               SG(request_info).path_translated = (char*)file_handle.filename;
+               argv[php_optind-1] = (char*)file_handle.filename;
                SG(request_info).argv=argv+php_optind-1;
 
                if (php_request_startup(TSRMLS_C)==FAILURE) {