]> granicus.if.org Git - php/commitdiff
Fixed compilation warnings
authorDmitry Stogov <dmitry@zend.com>
Tue, 22 Apr 2014 13:46:34 +0000 (17:46 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 22 Apr 2014 13:46:34 +0000 (17:46 +0400)
20 files changed:
Zend/zend.c
Zend/zend_API.c
Zend/zend_builtin_functions.c
Zend/zend_constants.c
Zend/zend_execute.c
Zend/zend_hash.h
Zend/zend_list.c
Zend/zend_objects_API.c
Zend/zend_operators.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/date/php_date.c
ext/libxml/libxml.c
ext/opcache/Optimizer/compact_literals.c
ext/pcre/php_pcre.c
ext/reflection/php_reflection.c
ext/spl/spl_dllist.c
ext/spl/spl_observer.c
ext/standard/array.c
ext/standard/crc32.c

index a72253128349e674ed2e87de77ad306bb0048e05..dc0ae2739ba67286ff896eb2a51aa8a22fa79a50 100644 (file)
@@ -133,7 +133,6 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
 {
        zval *tmp;
        zend_string *string_key;
-       HashPosition iterator;
        ulong num_key;
        int i;
 
@@ -193,7 +192,6 @@ static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
 {
        zval *tmp;
        zend_string *string_key;
-       HashPosition iterator;
        ulong num_key;
        int i = 0;
 
@@ -1029,7 +1027,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
        zval params[5];
        zval retval;
        const char *error_filename;
-       uint error_lineno;
+       uint error_lineno = 0;
        zval orig_user_error_handler;
        zend_bool in_compilation;
        zend_class_entry *saved_class_entry;
index 6cf6cb2157c4483a3efb93b49dc63502684cca9f..9212527963ac86f93fd9805ea43acbf56d590c7f 100644 (file)
@@ -1222,10 +1222,9 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
        if (object->ce->default_properties_count) {
            zval *prop, tmp;
        zend_string *key;
-           ulong num_key;
        zend_property_info *property_info;
 
-       ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, prop) {
+       ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
                    ZVAL_STR(&tmp, key);
                        property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
                        if (property_info &&
@@ -1243,10 +1242,9 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties
 {
     zval *prop, tmp;
        zend_string *key;
-    ulong num_key;
        zend_property_info *property_info;
 
-       ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, prop) {
+       ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
            ZVAL_STR(&tmp, key);
                property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
                if (property_info &&
@@ -4000,10 +3998,8 @@ ZEND_API zend_string* zend_find_alias_name(zend_class_entry *ce, zend_string *na
 ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f) /* {{{ */
 {
        zend_function *func;
-       HashPosition iterator;
        HashTable *function_table;
        zend_string *name;
-       ulong idx;
 
        if (f->common.type != ZEND_USER_FUNCTION ||
            *(f->op_array.refcount) < 2 ||
@@ -4013,7 +4009,7 @@ ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_functi
        }
 
        function_table = &ce->function_table;
-       ZEND_HASH_FOREACH_KEY_PTR(function_table, idx, name, func) {
+       ZEND_HASH_FOREACH_STR_KEY_PTR(function_table, name, func) {
                if (func == f) {
                        if (!name) {
                                return f->common.function_name;
index 4664532b8ffc8ddc33adfa0122b4e2649bf32a77..22076104f000bba81f70c6b13049b8a3eb66285d 100644 (file)
@@ -619,13 +619,10 @@ ZEND_FUNCTION(each)
        zend_hash_str_update(Z_ARRVAL_P(return_value), "value", sizeof("value")-1, entry);
 
        /* add the key elements */
-       switch (zend_hash_get_current_key(target_hash, &key, &num_key, 0)) {
-               case HASH_KEY_IS_STRING:
-                       inserted_pointer = add_get_index_str(return_value, 0, STR_COPY(key));
-                       break;
-               case HASH_KEY_IS_LONG:
-                       inserted_pointer = add_get_index_long(return_value, 0, num_key);
-                       break;
+       if (zend_hash_get_current_key(target_hash, &key, &num_key, 0) == HASH_KEY_IS_STRING) {
+               inserted_pointer = add_get_index_str(return_value, 0, STR_COPY(key));
+       } else {
+               inserted_pointer = add_get_index_long(return_value, 0, num_key);
        }
        zend_hash_str_update(Z_ARRVAL_P(return_value), "key", sizeof("key")-1, inserted_pointer);
        if (Z_REFCOUNTED_P(inserted_pointer)) Z_ADDREF_P(inserted_pointer);
@@ -902,9 +899,8 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
        zend_property_info *prop_info;
        zval *prop, prop_copy;
        zend_string *key;
-       ulong num_index;
 
-       ZEND_HASH_FOREACH_KEY_PTR(&ce->properties_info, num_index, key, prop_info) {
+       ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) {
                if (((prop_info->flags & ZEND_ACC_SHADOW) &&
                     prop_info->ce != EG(scope)) ||
                    ((prop_info->flags & ZEND_ACC_PROTECTED) &&
@@ -975,7 +971,6 @@ ZEND_FUNCTION(get_object_vars)
        zend_string *key;
        const char *prop_name, *class_name;
        uint prop_len;
-       ulong num_index;
        zend_object *zobj;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
@@ -996,7 +991,7 @@ ZEND_FUNCTION(get_object_vars)
 
        array_init(return_value);
 
-       ZEND_HASH_FOREACH_KEY_VAL_IND(properties, num_index, key, value) {
+       ZEND_HASH_FOREACH_STR_KEY_VAL_IND(properties, key, value) {
                if (key) {
                        if (zend_check_property_access(zobj, key TSRMLS_CC) == SUCCESS) {
                                /* Not separating references */
@@ -1030,7 +1025,6 @@ ZEND_FUNCTION(get_class_methods)
        zend_class_entry *ce = NULL;
        zend_function *mptr;
        zend_string *key;
-       ulong num_index;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &klass) == FAILURE) {
                return;
@@ -1052,7 +1046,7 @@ ZEND_FUNCTION(get_class_methods)
 
        array_init(return_value);
 
-       ZEND_HASH_FOREACH_KEY_PTR(&ce->function_table, num_index, key, mptr) {
+       ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, key, mptr) {
 
                if ((mptr->common.fn_flags & ZEND_ACC_PUBLIC) 
                 || (EG(scope) &&
@@ -1422,14 +1416,13 @@ ZEND_FUNCTION(crash)
 ZEND_FUNCTION(get_included_files)
 {
        zend_string *entry;
-       ulong num_idx;
 
        if (zend_parse_parameters_none() == FAILURE) {
                return;
        }
 
        array_init(return_value);
-       ZEND_HASH_FOREACH_KEY(&EG(included_files), num_idx, entry) {
+       ZEND_HASH_FOREACH_STR_KEY(&EG(included_files), entry) {
                if (entry) {
                        add_next_index_str(return_value, STR_COPY(entry));
                }
index 30ae65d267c080eb756577cc5e7bc042094487db..72fa9cb1776fe3bc9699bae2bff7f88b8ab15327 100644 (file)
@@ -309,7 +309,6 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
        const char *colon;
        zend_class_entry *ce = NULL;
        zend_string *class_name;
-       zval *ret_constant;
 
        /* Skip leading \\ */
        if (name[0] == '\\') {
@@ -317,13 +316,13 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
                name_len -= 1;
        }
 
-
        if ((colon = zend_memrchr(name, ':', name_len)) &&
            colon > name && (*(colon - 1) == ':')) {
                int class_name_len = colon - name - 1;
                int const_name_len = name_len - class_name_len - 2;
                zend_string *constant_name = STR_INIT(colon + 1, const_name_len, 0);
                zend_string *lcname;
+               zval *ret_constant = NULL;
 
                class_name = STR_INIT(name, class_name_len, 0);
                lcname = STR_ALLOC(class_name_len, 0);
@@ -381,7 +380,11 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
                }
                STR_FREE(class_name);
                STR_FREE(constant_name);
-               goto finish;
+               if (retval) {
+                       zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
+                       ZVAL_DUP(result, ret_constant);
+               }
+               return retval;
        }
 
        /* non-class constant */
@@ -425,14 +428,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
                        name_len = const_name_len;
                        return zend_get_constant(name, name_len, result TSRMLS_CC);
                }
-               retval = 0;
-finish:
-               if (retval) {
-                       zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
-                       ZVAL_DUP(result, ret_constant);
-               }
-
-               return retval;
+               return 0;
        }
 
        return zend_get_constant(name, name_len, result TSRMLS_CC);
index 839fc491ef05ebb07ca37cdb0185d0cfc1c2f4d9..2866f841d6e15ea2167e41b3a154673b4de61d33 100644 (file)
@@ -382,10 +382,10 @@ static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const zend_
                        return NULL;
                        break;
                case IS_CV:
+               default:
                        should_free->var = NULL;
                        return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
                        break;
-               EMPTY_SWITCH_DEFAULT_CASE()
        }
        return NULL;
 }
@@ -412,10 +412,10 @@ static inline zval *_get_zval_ptr_deref(int op_type, const znode_op *node, const
                        return NULL;
                        break;
                case IS_CV:
+               default:
                        should_free->var = NULL;
                        return _get_zval_ptr_cv_deref(execute_data, node->var, type TSRMLS_CC);
                        break;
-               EMPTY_SWITCH_DEFAULT_CASE()
        }
        return NULL;
 }
@@ -438,8 +438,6 @@ static zend_always_inline zval *_get_zval_ptr_ptr_var(zend_uint var, const zend_
 
 static inline zval *_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
 {
-       zval *ret;
-
        if (op_type == IS_CV) {
                should_free->var = NULL;
                return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
index cc1dcca0e7d34517d676130d153400b806b0800f..829348d388d4284558c222a3a0fd0e891ff772cc 100644 (file)
@@ -569,23 +569,42 @@ static inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPositio
        ZEND_HASH_FOREACH(ht, 0); \
        _ptr = Z_PTR_P(_z);
 
+#define ZEND_HASH_FOREACH_STR_KEY(ht, _key) \
+       ZEND_HASH_FOREACH(ht, 0); \
+       _key = _p->key;
+               
 #define ZEND_HASH_FOREACH_KEY(ht, _h, _key) \
        ZEND_HASH_FOREACH(ht, 0); \
        _h = _p->h; \
        _key = _p->key;
                
+#define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) \
+       ZEND_HASH_FOREACH(ht, 0); \
+       _key = _p->key; \
+       _val = _z;
+
 #define ZEND_HASH_FOREACH_KEY_VAL(ht, _h, _key, _val) \
        ZEND_HASH_FOREACH(ht, 0); \
        _h = _p->h; \
        _key = _p->key; \
        _val = _z;
 
+#define ZEND_HASH_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \
+       ZEND_HASH_FOREACH(ht, 1); \
+       _key = _p->key; \
+       _val = _z;
+
 #define ZEND_HASH_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \
        ZEND_HASH_FOREACH(ht, 1); \
        _h = _p->h; \
        _key = _p->key; \
        _val = _z;
 
+#define ZEND_HASH_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \
+       ZEND_HASH_FOREACH(ht, 0); \
+       _key = _p->key; \
+       _ptr = Z_PTR_P(_z);
+
 #define ZEND_HASH_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \
        ZEND_HASH_FOREACH(ht, 0); \
        _h = _p->h; \
index fa1af763971c0b4edfde239776082c7d59816682..c9b9ff66dfc8f5ca893687fa43c2800037b18dc1 100644 (file)
@@ -329,8 +329,6 @@ static void list_destructors_dtor(zval *zv)
 
 int zend_init_rsrc_list_dtors(void)
 {
-       int retval;
-
        zend_hash_init(&list_destructors, 64, NULL, list_destructors_dtor, 1);
        list_destructors.nNextFreeElement=1;    /* we don't want resource type 0 */
        return SUCCESS;
index 285a752c2ba6c04595a0c7a247979f32153c750f..bd6673c0bb287d7060658f3ae0edac283e3c756d 100644 (file)
@@ -276,12 +276,12 @@ ZEND_API void zend_object_proxy_set(zval *property, zval *value TSRMLS_DC)
        }
 }
 
-ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC)
+ZEND_API zval* zend_object_proxy_get(zval *property, zval *rv TSRMLS_DC)
 {
        zend_proxy_object *probj = (zend_proxy_object*)Z_OBJ_P(property);
 
        if (Z_OBJ_HT(probj->object) && Z_OBJ_HT(probj->object)->read_property) {
-               return Z_OBJ_HT(probj->object)->read_property(&probj->object, &probj->property, BP_VAR_R, -1, NULL TSRMLS_CC);
+               return Z_OBJ_HT(probj->object)->read_property(&probj->object, &probj->property, BP_VAR_R, -1, rv TSRMLS_CC);
        } else {
                zend_error(E_WARNING, "Cannot read property of object - no read handler defined");
        }
index d943ae739a646820c980606e0ab884c9816d69a0..397f8f60d76e77cceddcb04df643fb1d56a86aac 100644 (file)
@@ -1807,7 +1807,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
 }
 /* }}} */
 
-static int hash_zval_identical_function(const zval *z1, const zval *z2) /* {{{ */
+static int hash_zval_identical_function(zval *z1, zval *z2) /* {{{ */
 {
        zval result;
        TSRMLS_FETCH();
@@ -2406,7 +2406,7 @@ string_cmp:
 }
 /* }}} */
 
-static int hash_zval_compare_function(const zval *z1, const zval *z2 TSRMLS_DC) /* {{{ */
+static int hash_zval_compare_function(zval *z1, zval *z2 TSRMLS_DC) /* {{{ */
 {
        zval result;
 
index 11fafb53abca915d53492dd207b396db881cd9da..7b65cd6f4ab57738cb3e34a2f1619d71c4962d95 100644 (file)
@@ -1540,7 +1540,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
 {
        USE_OPLINE
        zend_free_op free_op1, free_op2;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
@@ -3128,11 +3128,10 @@ ZEND_VM_C_LABEL(send_again):
                        HashTable *ht = Z_ARRVAL_P(args);
                        zval *arg;
                        zend_string *name;
-                       zend_ulong index;
 
                        ZEND_VM_STACK_GROW_IF_NEEDED(zend_hash_num_elements(ht));
 
-                       ZEND_HASH_FOREACH_KEY_VAL(ht, index, name, arg) {
+                       ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
                                if (name) {
                                        zend_error(E_RECOVERABLE_ERROR, "Cannot unpack array with string keys");
                                        FREE_OP1();
index 6ee7eed781dd4486760fe5c1548cd391cef108ec..512267f9e1eccf8688a81f9fd539b2d28aad9ede 100644 (file)
@@ -724,11 +724,10 @@ send_again:
                        HashTable *ht = Z_ARRVAL_P(args);
                        zval *arg;
                        zend_string *name;
-                       zend_ulong index;
 
                        ZEND_VM_STACK_GROW_IF_NEEDED(zend_hash_num_elements(ht));
 
-                       ZEND_HASH_FOREACH_KEY_VAL(ht, index, name, arg) {
+                       ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
                                if (name) {
                                        zend_error(E_RECOVERABLE_ERROR, "Cannot unpack array with string keys");
                                        FREE_OP(free_op1);
@@ -14584,7 +14583,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
 {
        USE_OPLINE
        zend_free_op free_op1;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -16747,7 +16746,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
 {
        USE_OPLINE
        zend_free_op free_op1, free_op2;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -18814,7 +18813,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
 {
        USE_OPLINE
        zend_free_op free_op1, free_op2;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -22090,7 +22089,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
 {
        USE_OPLINE
        zend_free_op free_op1;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -23732,7 +23731,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OP
 {
        USE_OPLINE
        zend_free_op free_op1;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -25060,7 +25059,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCO
 {
        USE_OPLINE
        zend_free_op free_op1, free_op2;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -26301,7 +26300,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO
 {
        USE_OPLINE
        zend_free_op free_op1, free_op2;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -28031,7 +28030,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD
 {
        USE_OPLINE
        zend_free_op free_op1;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
@@ -31069,7 +31068,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
 {
        USE_OPLINE
        zend_free_op free_op1;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -33019,7 +33018,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H
 {
        USE_OPLINE
        zend_free_op free_op1, free_op2;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -34969,7 +34968,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H
 {
        USE_OPLINE
        zend_free_op free_op1, free_op2;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -37993,7 +37992,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
 {
        USE_OPLINE
        zend_free_op free_op1;
-       zval *container, *property, *retval_ptr;
+       zval *container, *property;
 
        SAVE_OPLINE();
        container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
index 06c131014eb13cfdb146c8ab606f99927e01a647..35c018e324f335ed48bbb35ebf67f90c2f1590db 100644 (file)
@@ -2503,7 +2503,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
        timelib_error_container *err = NULL;
        int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
        char *new_abbr = NULL;
-       timelib_sll     new_offset;
+       timelib_sll new_offset = 0;
        
        if (dateobj->time) {
                timelib_time_dtor(dateobj->time);
@@ -4016,7 +4016,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, zend_uin
 void date_interval_write_property(zval *object, zval *member, zval *value, zend_uint cache_slot TSRMLS_DC)
 {
        php_interval_obj *obj;
-       zval tmp_member, tmp_value;
+       zval tmp_member;
 
        if (Z_TYPE_P(member) != IS_STRING) {
                tmp_member = *member;
index cfa339fe245191c8e062ed4948dde7bf663d36fd..8b6af6a52b6ff6f8f7daa3c250ab3fc1f9d18d37 100644 (file)
@@ -478,7 +478,7 @@ static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
                error_copy.int1 = 0;
                error_copy.int2 = 0;
                error_copy.ctxt = NULL;
-               error_copy.message = xmlStrdup(msg);
+               error_copy.message = (char*)xmlStrdup((xmlChar*)msg);
                error_copy.file = NULL;
                error_copy.str1 = NULL;
                error_copy.str2 = NULL;
index 59628243f6bd060b375f674f19f52f7b7ca658ce..04183292d62320939bb9d12c0a945b30b63e0961 100644 (file)
@@ -96,7 +96,7 @@ static void optimizer_compact_literals(zend_op_array *op_array TSRMLS_DC)
        int l_false = -1;
        int l_true = -1;
        HashTable hash;
-       zend_string *key;
+       zend_string *key = NULL;
 
        if (op_array->last_literal) {
                info = (literal_info*)ecalloc(op_array->last_literal, sizeof(literal_info));
index 724b667bdec4d19955bd5179d1be7d2e1c494211..60769f131405ee2007729554de5555758f20c6a6 100644 (file)
@@ -1008,7 +1008,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
                                        *match,                         /* The current match */
                                        *piece,                         /* The current piece of subject */
                                        *replace_end=NULL,      /* End of replacement string */
-                                       *eval_result,           /* Result of eval or custom function */
+                                       *eval_result=NULL,      /* Result of eval or custom function */
                                         walk_last;                     /* Last walked character */
        int                              rc,
                                         result_len;            /* Length of result */
index 4940457333dd63640f1cc392c58b26c4a83e30f0..4af0b7383d015c556be92b1bdefec7d57d0ccfea 100644 (file)
@@ -98,12 +98,15 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
                return;                                                                                             \
        }
 
-#define GET_REFLECTION_OBJECT_PTR(target)                                                                   \
-       intern = Z_REFLECTION_P(getThis());                                                      \
+#define GET_REFLECTION_OBJECT()                                                                                                \
+       intern = Z_REFLECTION_P(getThis());                                                                                     \
        if (intern == NULL || intern->ptr == NULL) {                                                            \
                RETURN_ON_EXCEPTION                                                                                 \
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object");                    \
        }                                                                                                       \
+
+#define GET_REFLECTION_OBJECT_PTR(target)                                                                   \
+       GET_REFLECTION_OBJECT()                                                                                                                                                                 \
        target = intern->ptr;                                                                                   \
 
 /* Class constants */
@@ -1679,13 +1682,12 @@ ZEND_METHOD(reflection_function, isClosure)
 ZEND_METHOD(reflection_function, getClosureThis)
 {
        reflection_object *intern;
-       zend_function *fptr;
        zval* closure_this;
 
        if (zend_parse_parameters_none() == FAILURE) {
                return;
        }
-       GET_REFLECTION_OBJECT_PTR(fptr);
+       GET_REFLECTION_OBJECT();
        if (!ZVAL_IS_UNDEF(&intern->obj)) {
                closure_this = zend_get_closure_this_ptr(&intern->obj TSRMLS_CC);
                if (!ZVAL_IS_UNDEF(closure_this)) {
@@ -1700,13 +1702,12 @@ ZEND_METHOD(reflection_function, getClosureThis)
 ZEND_METHOD(reflection_function, getClosureScopeClass)
 {
        reflection_object *intern;
-       zend_function *fptr;
        const zend_function *closure_func;
 
        if (zend_parse_parameters_none() == FAILURE) {
                return;
        }
-       GET_REFLECTION_OBJECT_PTR(fptr);
+       GET_REFLECTION_OBJECT();
        if (!ZVAL_IS_UNDEF(&intern->obj)) {
                closure_func = zend_get_closure_method_def(&intern->obj TSRMLS_CC);
                if (closure_func && closure_func->common.scope) {
index dc10dde6e9bffdf759a94ae45f03b65519ebfe90..d2f17452ac9efdb6bbe4a86bd23dc6568f6ee18a 100644 (file)
@@ -326,12 +326,12 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{
 static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /* {{{ */
 {
        spl_ptr_llist_element *current = from->head, *next;
-       spl_ptr_llist_ctor_func ctor = from->ctor;
+//???  spl_ptr_llist_ctor_func ctor = from->ctor;
 
        while (current) {
                next = current->next;
 
-               /*!! FIXME
+               /*??? FIXME
                if (ctor) {
                        ctor(current TSRMLS_CC);
                }
index 5abedecb7f873738f00da525539636c36f31bc35..35c5353da100cfa0bc45f62a47f215c6a9fc6eed 100644 (file)
@@ -200,7 +200,7 @@ spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *int
        zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
 
        if (!hash) {
-               return;
+               return NULL;
        }
 
        pelement = spl_object_storage_get(intern, hash TSRMLS_CC);
@@ -419,7 +419,7 @@ static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {
                return 1;
        }
 
-       return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, spl_object_storage_compare_info, 0 TSRMLS_CC);
+       return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0 TSRMLS_CC);
 }
 /* }}} */
 
@@ -799,7 +799,6 @@ SPL_METHOD(SplObjectStorage, unserialize)
        zval entry, pmembers, pcount, inf;
        spl_SplObjectStorageElement *element;
        long count;
-       HashPosition pos;
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
                return;
index 6dada188cfc909595d8d2fbc51c9aff052ab7cfc..918d5112e612a805e49cde66a5de9078bc443d6b 100644 (file)
@@ -2633,6 +2633,8 @@ PHP_FUNCTION(array_column)
 {
        zval *zcolumn = NULL, *zkey = NULL, *data;
        HashTable *arr_hash;
+       zval *zcolval = NULL, *zkeyval = NULL;
+       HashTable *ht;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) {
                return;
@@ -2645,9 +2647,6 @@ PHP_FUNCTION(array_column)
 
        array_init(return_value);
        ZEND_HASH_FOREACH_VAL(arr_hash, data) {
-               zval *zcolval, *zkeyval = NULL;
-               HashTable *ht;
-
                if (Z_TYPE_P(data) != IS_ARRAY) {
                        /* Skip elemens which are not sub-arrays */
                        continue;
@@ -4506,7 +4505,7 @@ PHP_FUNCTION(array_key_exists)
    Split array into chunks */
 PHP_FUNCTION(array_chunk)
 {
-       int argc = ZEND_NUM_ARGS(), key_type, num_in;
+       int argc = ZEND_NUM_ARGS(), num_in;
        long size, current = 0;
        zend_string *str_key;
        ulong num_key;
index 3ce355a45f42cd747e29b02a89dbd258c64a3749..e9176e84da846eefc2da6d15af7adc14c5e1245a 100644 (file)
@@ -27,7 +27,7 @@
 PHP_NAMED_FUNCTION(php_if_crc32)
 {
        char *p;
-       int len, nr;
+       int nr;
        php_uint32 crcinit = 0;
        register php_uint32 crc;
 
@@ -36,7 +36,7 @@ PHP_NAMED_FUNCTION(php_if_crc32)
        }
        crc = crcinit^0xFFFFFFFF;
 
-       for (len =+nr; nr--; ++p) {
+       for (; nr--; ++p) {
                crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF ];
        }
        RETVAL_LONG(crc^0xFFFFFFFF);