Skip to content

Commit 3893c1f

Browse files
committed
Fixed compilation warnings
1 parent 68cfeed commit 3893c1f

14 files changed

+37
-32
lines changed

Zend/zend_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC)
11271127
}
11281128
/* }}} */
11291129

1130-
static int zval_update_class_constant(zval *pp, int is_static, int offset TSRMLS_DC) /* {{{ */
1130+
static int zval_update_class_constant(zval *pp, int is_static, uint32_t offset TSRMLS_DC) /* {{{ */
11311131
{
11321132
ZVAL_DEREF(pp);
11331133
if (Z_CONSTANT_P(pp)) {
@@ -2195,7 +2195,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
21952195
internal_function->arg_info = (zend_internal_arg_info*)ptr->arg_info+1;
21962196
internal_function->num_args = ptr->num_args;
21972197
/* Currently you cannot denote that the function can accept less arguments than num_args */
2198-
if (info->required_num_args == -1) {
2198+
if (info->required_num_args == (zend_uintptr_t)-1) {
21992199
internal_function->required_num_args = ptr->num_args;
22002200
} else {
22012201
internal_function->required_num_args = info->required_num_args;

Zend/zend_API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D);
525525
ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data);
526526
ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data);
527527
ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS_DC);
528-
ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int force TSRMLS_DC);
528+
ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force TSRMLS_DC);
529529

530530
ZEND_API zend_string *zend_find_alias_name(zend_class_entry *ce, zend_string *name);
531531
ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f);

Zend/zend_closures.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static const zend_function_entry closure_functions[] = {
436436
ZEND_ME(Closure, bind, arginfo_closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
437437
ZEND_MALIAS(Closure, bindTo, bind, arginfo_closure_bindto, ZEND_ACC_PUBLIC)
438438
ZEND_ME(Closure, call, arginfo_closure_call, ZEND_ACC_PUBLIC)
439-
{NULL, NULL, NULL}
439+
ZEND_FE_END
440440
};
441441

442442
void zend_register_closure_ce(TSRMLS_D) /* {{{ */

Zend/zend_compile.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
10331033
if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) {
10341034
uint32_t *opline_num = &CG(active_op_array)->early_binding;
10351035

1036-
while (*opline_num != -1) {
1036+
while (*opline_num != (uint32_t)-1) {
10371037
opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num;
10381038
}
10391039
*opline_num = opline - CG(active_op_array)->opcodes;
@@ -1074,13 +1074,13 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
10741074

10751075
ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC) /* {{{ */
10761076
{
1077-
if (op_array->early_binding != -1) {
1077+
if (op_array->early_binding != (uint32_t)-1) {
10781078
zend_bool orig_in_compilation = CG(in_compilation);
10791079
uint32_t opline_num = op_array->early_binding;
10801080
zend_class_entry *ce;
10811081

10821082
CG(in_compilation) = 1;
1083-
while (opline_num != -1) {
1083+
while (opline_num != (uint32_t)-1) {
10841084
if ((ce = zend_lookup_class(Z_STR_P(RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2)) TSRMLS_CC)) != NULL) {
10851085
do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0 TSRMLS_CC);
10861086
}
@@ -1973,7 +1973,7 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
19731973

19741974
/* there is a chance someone is accessing $this */
19751975
if (ast->kind != ZEND_AST_ZVAL
1976-
&& CG(active_op_array)->scope && CG(active_op_array)->this_var == -1
1976+
&& CG(active_op_array)->scope && CG(active_op_array)->this_var == (uint32_t)-1
19771977
) {
19781978
zend_string *key = zend_string_init("this", sizeof("this") - 1, 0);
19791979
CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key TSRMLS_CC);

Zend/zend_exceptions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_exception___construct, 0, 0, 0)
664664
ZEND_ARG_INFO(0, previous)
665665
ZEND_END_ARG_INFO()
666666

667-
const static zend_function_entry default_exception_functions[] = {
667+
static const zend_function_entry default_exception_functions[] = {
668668
ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
669669
ZEND_ME(exception, __construct, arginfo_exception___construct, ZEND_ACC_PUBLIC)
670670
ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
@@ -675,7 +675,7 @@ const static zend_function_entry default_exception_functions[] = {
675675
ZEND_ME(exception, getPrevious, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
676676
ZEND_ME(exception, getTraceAsString, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
677677
ZEND_ME(exception, __toString, NULL, 0)
678-
{NULL, NULL, NULL}
678+
ZEND_FE_END
679679
};
680680

681681
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 0)
@@ -690,7 +690,7 @@ ZEND_END_ARG_INFO()
690690
static const zend_function_entry error_exception_functions[] = {
691691
ZEND_ME(error_exception, __construct, arginfo_error_exception___construct, ZEND_ACC_PUBLIC)
692692
ZEND_ME(error_exception, getSeverity, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
693-
{NULL, NULL, NULL}
693+
ZEND_FE_END
694694
};
695695
/* }}} */
696696

Zend/zend_execute.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht
11681168
return retval;
11691169
}
11701170

1171-
static zend_never_inline zend_long zend_check_string_offset(zval *container, zval *dim, int type TSRMLS_DC)
1171+
static zend_never_inline zend_long zend_check_string_offset(zval *dim, int type TSRMLS_DC)
11721172
{
11731173
zend_long offset;
11741174

@@ -1211,7 +1211,7 @@ static zend_never_inline zend_long zend_check_string_offset(zval *container, zva
12111211

12121212
static zend_always_inline zend_long zend_fetch_string_offset(zval *container, zval *dim, int type TSRMLS_DC)
12131213
{
1214-
zend_long offset = zend_check_string_offset(container, dim, type TSRMLS_CC);
1214+
zend_long offset = zend_check_string_offset(dim, type TSRMLS_CC);
12151215

12161216
if (Z_REFCOUNTED_P(container)) {
12171217
if (Z_REFCOUNT_P(container) > 1) {
@@ -1250,7 +1250,7 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *
12501250
goto fetch_from_array;
12511251
}
12521252

1253-
zend_check_string_offset(container, dim, type TSRMLS_CC);
1253+
zend_check_string_offset(dim, type TSRMLS_CC);
12541254

12551255
ZVAL_INDIRECT(result, NULL); /* wrong string offset */
12561256
} 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
16661666
} while (var != end);
16671667
}
16681668

1669-
if (op_array->this_var != -1 && EXPECTED(Z_OBJ(EX(This)))) {
1669+
if (op_array->this_var != (uint32_t)-1 && EXPECTED(Z_OBJ(EX(This)))) {
16701670
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
16711671
GC_REFCOUNT(Z_OBJ(EX(This)))++;
16721672
}
@@ -1691,7 +1691,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
16911691

16921692
zend_attach_symbol_table(execute_data);
16931693

1694-
if (op_array->this_var != -1 && EXPECTED(Z_OBJ(EX(This)))) {
1694+
if (op_array->this_var != (uint32_t)-1 && EXPECTED(Z_OBJ(EX(This)))) {
16951695
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
16961696
GC_REFCOUNT(Z_OBJ(EX(This)))++;
16971697
}
@@ -1762,7 +1762,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
17621762
}
17631763
}
17641764

1765-
if (op_array->this_var != -1 && EXPECTED(Z_OBJ(EX(This)))) {
1765+
if (op_array->this_var != (uint32_t)-1 && EXPECTED(Z_OBJ(EX(This)))) {
17661766
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
17671767
GC_REFCOUNT(Z_OBJ(EX(This)))++;
17681768
}

Zend/zend_execute_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void shutdown_destructors(TSRMLS_D) /* {{{ */
218218
EG(symbol_table).ht.pDestructor = zend_unclean_zval_ptr_dtor;
219219
}
220220
zend_try {
221-
int symbols;
221+
uint32_t symbols;
222222
do {
223223
symbols = zend_hash_num_elements(&EG(symbol_table).ht);
224224
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
15421542
}
15431543
/* }}} */
15441544

1545-
ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int force TSRMLS_DC) /* {{{ */
1545+
ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force TSRMLS_DC) /* {{{ */
15461546
{
15471547
zend_execute_data *execute_data = EG(current_execute_data);
15481548

Zend/zend_indent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
static void handle_whitespace(unsigned int *emit_whitespace)
3535
{
3636
unsigned char c;
37-
int i;
37+
unsigned int i;
3838

3939
for (c=0; c<128; c++) {
4040
if (emit_whitespace[c]>0) {

Zend/zend_inheritance.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
591591
}
592592
/* }}} */
593593

594-
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) /* {{{ */
594+
static zend_bool do_inherit_property_access_check(zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */
595595
{
596596
zend_property_info *child_info;
597597
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
831831
} ZEND_HASH_FOREACH_END();
832832

833833
ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) {
834-
if (do_inherit_property_access_check(&ce->properties_info, property_info, key, ce TSRMLS_CC)) {
834+
if (do_inherit_property_access_check(property_info, key, ce TSRMLS_CC)) {
835835
if (ce->type & ZEND_INTERNAL_CLASS) {
836836
property_info = zend_duplicate_property_info_internal(property_info);
837837
} else {

Zend/zend_interfaces.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static int zend_implement_serializable(zend_class_entry *interface, zend_class_e
499499
/* {{{ function tables */
500500
const zend_function_entry zend_funcs_aggregate[] = {
501501
ZEND_ABSTRACT_ME(iterator, getIterator, NULL)
502-
{NULL, NULL, NULL}
502+
ZEND_FE_END
503503
};
504504

505505
const zend_function_entry zend_funcs_iterator[] = {
@@ -508,7 +508,7 @@ const zend_function_entry zend_funcs_iterator[] = {
508508
ZEND_ABSTRACT_ME(iterator, key, NULL)
509509
ZEND_ABSTRACT_ME(iterator, valid, NULL)
510510
ZEND_ABSTRACT_ME(iterator, rewind, NULL)
511-
{NULL, NULL, NULL}
511+
ZEND_FE_END
512512
};
513513

514514
const zend_function_entry *zend_funcs_traversable = NULL;
@@ -531,7 +531,7 @@ const zend_function_entry zend_funcs_arrayaccess[] = {
531531
ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get)
532532
ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value)
533533
ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset)
534-
{NULL, NULL, NULL}
534+
ZEND_FE_END
535535
};
536536

537537
ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0)
@@ -541,7 +541,7 @@ ZEND_END_ARG_INFO()
541541
const zend_function_entry zend_funcs_serializable[] = {
542542
ZEND_ABSTRACT_ME(serializable, serialize, NULL)
543543
ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
544-
{NULL, NULL, NULL}
544+
ZEND_FE_END
545545
};
546546
/* }}} */
547547

Zend/zend_iterators.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ static zend_object_handlers iterator_object_handlers = {
5050
NULL, /* get class name */
5151
NULL, /* compare */
5252
NULL, /* cast */
53-
NULL /* count */
53+
NULL, /* count */
54+
NULL, /* get_debug_info */
55+
NULL, /* get_closure */
56+
NULL, /* get_gc */
57+
NULL, /* do_operation */
58+
NULL /* compare */
5459
};
5560

5661
ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)

Zend/zend_virtual_cwd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static inline zend_ulong realpath_cache_key(const char *path, int path_len) /* {
620620

621621
CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
622622
{
623-
int i;
623+
uint32_t i;
624624

625625
for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) {
626626
realpath_cache_bucket *p = CWDG(realpath_cache)[i];

Zend/zend_vm_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5513,8 +5513,8 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY)
55135513
USE_OPLINE
55145514

55155515
SAVE_OPLINE();
5516-
if (++EG(ticks_count)>=opline->extended_value) {
5517-
EG(ticks_count)=0;
5516+
if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
5517+
EG(ticks_count) = 0;
55185518
if (zend_ticks_function) {
55195519
zend_ticks_function(opline->extended_value TSRMLS_CC);
55205520
}

Zend/zend_vm_execute.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,8 +1144,8 @@ static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11441144
USE_OPLINE
11451145

11461146
SAVE_OPLINE();
1147-
if (++EG(ticks_count)>=opline->extended_value) {
1148-
EG(ticks_count)=0;
1147+
if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
1148+
EG(ticks_count) = 0;
11491149
if (zend_ticks_function) {
11501150
zend_ticks_function(opline->extended_value TSRMLS_CC);
11511151
}

0 commit comments

Comments
 (0)