Fixed compilation warnings

This commit is contained in:
Dmitry Stogov 2014-12-12 21:57:34 +03:00
parent 68cfeed70f
commit 3893c1fc3d
14 changed files with 37 additions and 32 deletions

View file

@ -1127,7 +1127,7 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC)
} }
/* }}} */ /* }}} */
static int zval_update_class_constant(zval *pp, int is_static, int offset TSRMLS_DC) /* {{{ */ static int zval_update_class_constant(zval *pp, int is_static, uint32_t offset TSRMLS_DC) /* {{{ */
{ {
ZVAL_DEREF(pp); ZVAL_DEREF(pp);
if (Z_CONSTANT_P(pp)) { if (Z_CONSTANT_P(pp)) {
@ -2195,7 +2195,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
internal_function->arg_info = (zend_internal_arg_info*)ptr->arg_info+1; internal_function->arg_info = (zend_internal_arg_info*)ptr->arg_info+1;
internal_function->num_args = ptr->num_args; internal_function->num_args = ptr->num_args;
/* Currently you cannot denote that the function can accept less arguments than num_args */ /* Currently you cannot denote that the function can accept less arguments than num_args */
if (info->required_num_args == -1) { if (info->required_num_args == (zend_uintptr_t)-1) {
internal_function->required_num_args = ptr->num_args; internal_function->required_num_args = ptr->num_args;
} else { } else {
internal_function->required_num_args = info->required_num_args; internal_function->required_num_args = info->required_num_args;

View file

@ -525,7 +525,7 @@ ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D);
ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data); ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data);
ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data); ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data);
ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS_DC); ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS_DC);
ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int force TSRMLS_DC); ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force TSRMLS_DC);
ZEND_API zend_string *zend_find_alias_name(zend_class_entry *ce, zend_string *name); ZEND_API zend_string *zend_find_alias_name(zend_class_entry *ce, zend_string *name);
ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f); ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f);

View file

@ -436,7 +436,7 @@ static const zend_function_entry closure_functions[] = {
ZEND_ME(Closure, bind, arginfo_closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ZEND_ME(Closure, bind, arginfo_closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
ZEND_MALIAS(Closure, bindTo, bind, arginfo_closure_bindto, ZEND_ACC_PUBLIC) ZEND_MALIAS(Closure, bindTo, bind, arginfo_closure_bindto, ZEND_ACC_PUBLIC)
ZEND_ME(Closure, call, arginfo_closure_call, ZEND_ACC_PUBLIC) ZEND_ME(Closure, call, arginfo_closure_call, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL} ZEND_FE_END
}; };
void zend_register_closure_ce(TSRMLS_D) /* {{{ */ void zend_register_closure_ce(TSRMLS_D) /* {{{ */

View file

@ -1033,7 +1033,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) { if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) {
uint32_t *opline_num = &CG(active_op_array)->early_binding; uint32_t *opline_num = &CG(active_op_array)->early_binding;
while (*opline_num != -1) { while (*opline_num != (uint32_t)-1) {
opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num; opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num;
} }
*opline_num = opline - CG(active_op_array)->opcodes; *opline_num = opline - CG(active_op_array)->opcodes;
@ -1074,13 +1074,13 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC) /* {{{ */ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC) /* {{{ */
{ {
if (op_array->early_binding != -1) { if (op_array->early_binding != (uint32_t)-1) {
zend_bool orig_in_compilation = CG(in_compilation); zend_bool orig_in_compilation = CG(in_compilation);
uint32_t opline_num = op_array->early_binding; uint32_t opline_num = op_array->early_binding;
zend_class_entry *ce; zend_class_entry *ce;
CG(in_compilation) = 1; CG(in_compilation) = 1;
while (opline_num != -1) { while (opline_num != (uint32_t)-1) {
if ((ce = zend_lookup_class(Z_STR_P(RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2)) TSRMLS_CC)) != NULL) { if ((ce = zend_lookup_class(Z_STR_P(RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2)) TSRMLS_CC)) != NULL) {
do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0 TSRMLS_CC); do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0 TSRMLS_CC);
} }
@ -1973,7 +1973,7 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
/* there is a chance someone is accessing $this */ /* there is a chance someone is accessing $this */
if (ast->kind != ZEND_AST_ZVAL if (ast->kind != ZEND_AST_ZVAL
&& CG(active_op_array)->scope && CG(active_op_array)->this_var == -1 && CG(active_op_array)->scope && CG(active_op_array)->this_var == (uint32_t)-1
) { ) {
zend_string *key = zend_string_init("this", sizeof("this") - 1, 0); zend_string *key = zend_string_init("this", sizeof("this") - 1, 0);
CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key TSRMLS_CC); CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key TSRMLS_CC);

View file

@ -664,7 +664,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_exception___construct, 0, 0, 0)
ZEND_ARG_INFO(0, previous) ZEND_ARG_INFO(0, previous)
ZEND_END_ARG_INFO() ZEND_END_ARG_INFO()
const static zend_function_entry default_exception_functions[] = { static const zend_function_entry default_exception_functions[] = {
ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
ZEND_ME(exception, __construct, arginfo_exception___construct, ZEND_ACC_PUBLIC) ZEND_ME(exception, __construct, arginfo_exception___construct, ZEND_ACC_PUBLIC)
ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
@ -675,7 +675,7 @@ const static zend_function_entry default_exception_functions[] = {
ZEND_ME(exception, getPrevious, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(exception, getPrevious, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(exception, getTraceAsString, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(exception, getTraceAsString, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(exception, __toString, NULL, 0) ZEND_ME(exception, __toString, NULL, 0)
{NULL, NULL, NULL} ZEND_FE_END
}; };
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 0) ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 0)
@ -690,7 +690,7 @@ ZEND_END_ARG_INFO()
static const zend_function_entry error_exception_functions[] = { static const zend_function_entry error_exception_functions[] = {
ZEND_ME(error_exception, __construct, arginfo_error_exception___construct, ZEND_ACC_PUBLIC) ZEND_ME(error_exception, __construct, arginfo_error_exception___construct, ZEND_ACC_PUBLIC)
ZEND_ME(error_exception, getSeverity, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(error_exception, getSeverity, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
{NULL, NULL, NULL} ZEND_FE_END
}; };
/* }}} */ /* }}} */

View file

@ -1168,7 +1168,7 @@ str_index:
return retval; return retval;
} }
static zend_never_inline zend_long zend_check_string_offset(zval *container, zval *dim, int type TSRMLS_DC) static zend_never_inline zend_long zend_check_string_offset(zval *dim, int type TSRMLS_DC)
{ {
zend_long offset; zend_long offset;
@ -1211,7 +1211,7 @@ try_again:
static zend_always_inline zend_long zend_fetch_string_offset(zval *container, zval *dim, int type TSRMLS_DC) static zend_always_inline zend_long zend_fetch_string_offset(zval *container, zval *dim, int type TSRMLS_DC)
{ {
zend_long offset = zend_check_string_offset(container, dim, type TSRMLS_CC); zend_long offset = zend_check_string_offset(dim, type TSRMLS_CC);
if (Z_REFCOUNTED_P(container)) { if (Z_REFCOUNTED_P(container)) {
if (Z_REFCOUNT_P(container) > 1) { if (Z_REFCOUNT_P(container) > 1) {
@ -1250,7 +1250,7 @@ convert_to_array:
goto fetch_from_array; goto fetch_from_array;
} }
zend_check_string_offset(container, dim, type TSRMLS_CC); zend_check_string_offset(dim, type TSRMLS_CC);
ZVAL_INDIRECT(result, NULL); /* wrong string offset */ ZVAL_INDIRECT(result, NULL); /* wrong string offset */
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { } else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@ -1666,7 +1666,7 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
} while (var != end); } while (var != end);
} }
if (op_array->this_var != -1 && EXPECTED(Z_OBJ(EX(This)))) { if (op_array->this_var != (uint32_t)-1 && EXPECTED(Z_OBJ(EX(This)))) {
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This))); ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
GC_REFCOUNT(Z_OBJ(EX(This)))++; GC_REFCOUNT(Z_OBJ(EX(This)))++;
} }
@ -1691,7 +1691,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
zend_attach_symbol_table(execute_data); zend_attach_symbol_table(execute_data);
if (op_array->this_var != -1 && EXPECTED(Z_OBJ(EX(This)))) { if (op_array->this_var != (uint32_t)-1 && EXPECTED(Z_OBJ(EX(This)))) {
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This))); ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
GC_REFCOUNT(Z_OBJ(EX(This)))++; GC_REFCOUNT(Z_OBJ(EX(This)))++;
} }
@ -1762,7 +1762,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
} }
} }
if (op_array->this_var != -1 && EXPECTED(Z_OBJ(EX(This)))) { if (op_array->this_var != (uint32_t)-1 && EXPECTED(Z_OBJ(EX(This)))) {
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This))); ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
GC_REFCOUNT(Z_OBJ(EX(This)))++; GC_REFCOUNT(Z_OBJ(EX(This)))++;
} }

View file

@ -218,7 +218,7 @@ void shutdown_destructors(TSRMLS_D) /* {{{ */
EG(symbol_table).ht.pDestructor = zend_unclean_zval_ptr_dtor; EG(symbol_table).ht.pDestructor = zend_unclean_zval_ptr_dtor;
} }
zend_try { zend_try {
int symbols; uint32_t symbols;
do { do {
symbols = zend_hash_num_elements(&EG(symbol_table).ht); symbols = zend_hash_num_elements(&EG(symbol_table).ht);
zend_hash_reverse_apply(&EG(symbol_table).ht, (apply_func_t) zval_call_destructor TSRMLS_CC); zend_hash_reverse_apply(&EG(symbol_table).ht, (apply_func_t) zval_call_destructor TSRMLS_CC);
@ -1542,7 +1542,7 @@ ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS
} }
/* }}} */ /* }}} */
ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int force TSRMLS_DC) /* {{{ */ ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force TSRMLS_DC) /* {{{ */
{ {
zend_execute_data *execute_data = EG(current_execute_data); zend_execute_data *execute_data = EG(current_execute_data);

View file

@ -34,7 +34,7 @@
static void handle_whitespace(unsigned int *emit_whitespace) static void handle_whitespace(unsigned int *emit_whitespace)
{ {
unsigned char c; unsigned char c;
int i; unsigned int i;
for (c=0; c<128; c++) { for (c=0; c<128; c++) {
if (emit_whitespace[c]>0) { if (emit_whitespace[c]>0) {

View file

@ -591,7 +591,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
} }
/* }}} */ /* }}} */
static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */ static zend_bool do_inherit_property_access_check(zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */
{ {
zend_property_info *child_info; zend_property_info *child_info;
zend_class_entry *parent_ce = ce->parent; zend_class_entry *parent_ce = ce->parent;
@ -831,7 +831,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) { ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) {
if (do_inherit_property_access_check(&ce->properties_info, property_info, key, ce TSRMLS_CC)) { if (do_inherit_property_access_check(property_info, key, ce TSRMLS_CC)) {
if (ce->type & ZEND_INTERNAL_CLASS) { if (ce->type & ZEND_INTERNAL_CLASS) {
property_info = zend_duplicate_property_info_internal(property_info); property_info = zend_duplicate_property_info_internal(property_info);
} else { } else {

View file

@ -499,7 +499,7 @@ static int zend_implement_serializable(zend_class_entry *interface, zend_class_e
/* {{{ function tables */ /* {{{ function tables */
const zend_function_entry zend_funcs_aggregate[] = { const zend_function_entry zend_funcs_aggregate[] = {
ZEND_ABSTRACT_ME(iterator, getIterator, NULL) ZEND_ABSTRACT_ME(iterator, getIterator, NULL)
{NULL, NULL, NULL} ZEND_FE_END
}; };
const zend_function_entry zend_funcs_iterator[] = { const zend_function_entry zend_funcs_iterator[] = {
@ -508,7 +508,7 @@ const zend_function_entry zend_funcs_iterator[] = {
ZEND_ABSTRACT_ME(iterator, key, NULL) ZEND_ABSTRACT_ME(iterator, key, NULL)
ZEND_ABSTRACT_ME(iterator, valid, NULL) ZEND_ABSTRACT_ME(iterator, valid, NULL)
ZEND_ABSTRACT_ME(iterator, rewind, NULL) ZEND_ABSTRACT_ME(iterator, rewind, NULL)
{NULL, NULL, NULL} ZEND_FE_END
}; };
const zend_function_entry *zend_funcs_traversable = NULL; const zend_function_entry *zend_funcs_traversable = NULL;
@ -531,7 +531,7 @@ const zend_function_entry zend_funcs_arrayaccess[] = {
ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get) ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get)
ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value) ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value)
ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset) ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset)
{NULL, NULL, NULL} ZEND_FE_END
}; };
ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0) ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0)
@ -541,7 +541,7 @@ ZEND_END_ARG_INFO()
const zend_function_entry zend_funcs_serializable[] = { const zend_function_entry zend_funcs_serializable[] = {
ZEND_ABSTRACT_ME(serializable, serialize, NULL) ZEND_ABSTRACT_ME(serializable, serialize, NULL)
ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR) ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
{NULL, NULL, NULL} ZEND_FE_END
}; };
/* }}} */ /* }}} */

View file

@ -50,7 +50,12 @@ static zend_object_handlers iterator_object_handlers = {
NULL, /* get class name */ NULL, /* get class name */
NULL, /* compare */ NULL, /* compare */
NULL, /* cast */ NULL, /* cast */
NULL /* count */ NULL, /* count */
NULL, /* get_debug_info */
NULL, /* get_closure */
NULL, /* get_gc */
NULL, /* do_operation */
NULL /* compare */
}; };
ZEND_API void zend_register_iterator_wrapper(TSRMLS_D) ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)

View file

@ -620,7 +620,7 @@ static inline zend_ulong realpath_cache_key(const char *path, int path_len) /* {
CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */ CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
{ {
int i; uint32_t i;
for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) { for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) {
realpath_cache_bucket *p = CWDG(realpath_cache)[i]; realpath_cache_bucket *p = CWDG(realpath_cache)[i];

View file

@ -5513,7 +5513,7 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY)
USE_OPLINE USE_OPLINE
SAVE_OPLINE(); SAVE_OPLINE();
if (++EG(ticks_count)>=opline->extended_value) { if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
EG(ticks_count) = 0; EG(ticks_count) = 0;
if (zend_ticks_function) { if (zend_ticks_function) {
zend_ticks_function(opline->extended_value TSRMLS_CC); zend_ticks_function(opline->extended_value TSRMLS_CC);

View file

@ -1144,7 +1144,7 @@ static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
USE_OPLINE USE_OPLINE
SAVE_OPLINE(); SAVE_OPLINE();
if (++EG(ticks_count)>=opline->extended_value) { if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
EG(ticks_count) = 0; EG(ticks_count) = 0;
if (zend_ticks_function) { if (zend_ticks_function) {
zend_ticks_function(opline->extended_value TSRMLS_CC); zend_ticks_function(opline->extended_value TSRMLS_CC);