Skip to content

Commit 5bb2577

Browse files
committed
further fixes on core
1 parent 7534bf1 commit 5bb2577

23 files changed

+119
-119
lines changed

Zend/zend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
388388
# else /* ! (CRAY || __arm) */
389389

390390
# define XtOffset(p_type, field) \
391-
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
391+
((zend_int_t) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
392392

393393
# endif /* !CRAY */
394394

Zend/zend_alloc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ static int zend_mm_check_ptr(zend_mm_heap *heap, void *ptr, int silent ZEND_FILE
13731373
#ifdef ZTS
13741374
if (ZEND_MM_BAD_THREAD_ID(p)) {
13751375
if (!silent) {
1376-
zend_debug_alloc_output("Invalid pointer: ((thread_id=0x%0.8X) != (expected=0x%0.8X))\n", (long)p->thread_id, (long)tsrm_thread_id());
1376+
zend_debug_alloc_output("Invalid pointer: ((thread_id=0x%0.8X) != (expected=0x%0.8X))\n", (zend_int_t)p->thread_id, (zend_int_t)tsrm_thread_id());
13771377
had_problems = 1;
13781378
} else {
13791379
return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -2474,7 +2474,7 @@ ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_
24742474
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24752475
{
24762476
size_t res = nmemb;
2477-
unsigned long overflow = 0;
2477+
zend_uint_t overflow = 0;
24782478

24792479
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
24802480
: "=&a"(res), "=&d" (overflow)
@@ -2494,7 +2494,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24942494
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24952495
{
24962496
size_t res = nmemb;
2497-
unsigned long overflow = 0;
2497+
zend_uint_t overflow = 0;
24982498

24992499
#ifdef __ILP32__ /* x32 */
25002500
# define LP_SUFF "l"
@@ -2523,7 +2523,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
25232523
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
25242524
{
25252525
size_t res;
2526-
unsigned long overflow;
2526+
zend_uint_t overflow;
25272527

25282528
__asm__ ("umlal %0,%1,%2,%3"
25292529
: "=r"(res), "=r"(overflow)
@@ -2544,7 +2544,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
25442544
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
25452545
{
25462546
size_t res;
2547-
unsigned long overflow;
2547+
zend_uint_t overflow;
25482548

25492549
__asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr"
25502550
: "=&r"(res), "=&r"(overflow)

Zend/zend_builtin_functions.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ ZEND_FUNCTION(func_get_arg)
411411
{
412412
int arg_count, first_extra_arg;
413413
zval *arg;
414-
long requested_offset;
414+
zend_int_t requested_offset;
415415
zend_execute_data *ex;
416416

417-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &requested_offset) == FAILURE) {
417+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &requested_offset) == FAILURE) {
418418
return;
419419
}
420420

@@ -1907,7 +1907,7 @@ ZEND_FUNCTION(zend_test_func)
19071907
#ifdef ZTS
19081908
ZEND_FUNCTION(zend_thread_id)
19091909
{
1910-
RETURN_INT((long)tsrm_thread_id());
1910+
RETURN_INT((zend_int_t)tsrm_thread_id());
19111911
}
19121912
#endif
19131913
#endif
@@ -2111,10 +2111,10 @@ ZEND_FUNCTION(debug_print_backtrace)
21112111
const char *include_filename = NULL;
21122112
zval arg_array;
21132113
int indent = 0;
2114-
long options = 0;
2115-
long limit = 0;
2114+
zend_int_t options = 0;
2115+
zend_int_t limit = 0;
21162116

2117-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &options, &limit) == FAILURE) {
2117+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ii", &options, &limit) == FAILURE) {
21182118
return;
21192119
}
21202120

@@ -2499,10 +2499,10 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
24992499
Return backtrace as array */
25002500
ZEND_FUNCTION(debug_backtrace)
25012501
{
2502-
long options = DEBUG_BACKTRACE_PROVIDE_OBJECT;
2503-
long limit = 0;
2502+
zend_int_t options = DEBUG_BACKTRACE_PROVIDE_OBJECT;
2503+
zend_int_t limit = 0;
25042504

2505-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &options, &limit) == FAILURE) {
2505+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ii", &options, &limit) == FAILURE) {
25062506
return;
25072507
}
25082508

Zend/zend_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
25392539
}
25402540
/* }}} */
25412541

2542-
static int zend_do_convert_call(zend_op *init_opline, zend_op *opline, long num_args, zend_function **func_ptr TSRMLS_DC) /* {{{ */
2542+
static int zend_do_convert_call(zend_op *init_opline, zend_op *opline, zend_int_t num_args, zend_function **func_ptr TSRMLS_DC) /* {{{ */
25432543
{
25442544
zval *function_name;
25452545
zend_string *lcname;
@@ -6312,7 +6312,7 @@ void zend_do_end_array(znode *result, const znode *array_node TSRMLS_DC) /* {{{
63126312
if (constant_array) {
63136313
/* try to construct constant array */
63146314
zend_uint size;
6315-
long num;
6315+
zend_int_t num;
63166316
zend_string *str;
63176317

63186318
if (init_opline->op1_type != IS_UNUSED) {

Zend/zend_constants.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC)
323323
return c ? &c->value : NULL;
324324
}
325325

326-
ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, ulong flags TSRMLS_DC)
326+
ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, zend_uint_t flags TSRMLS_DC)
327327
{
328328
zend_constant *c;
329329
const char *colon;
@@ -449,7 +449,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
449449
}
450450
}
451451

452-
zend_constant *zend_quick_get_constant(const zval *key, ulong flags TSRMLS_DC)
452+
zend_constant *zend_quick_get_constant(const zval *key, zend_uint_t flags TSRMLS_DC)
453453
{
454454
zend_constant *c;
455455

Zend/zend_constants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void zend_register_standard_constants(TSRMLS_D);
6767
void clean_non_persistent_constants(TSRMLS_D);
6868
ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC);
6969
ZEND_API zval *zend_get_constant_str(const char *name, uint name_len TSRMLS_DC);
70-
ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, ulong flags TSRMLS_DC);
70+
ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, zend_uint_t flags TSRMLS_DC);
7171
ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC);
7272
ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC);
7373
ZEND_API void zend_register_int_constant(const char *name, uint name_len, zend_int_t lval, int flags, int module_number TSRMLS_DC);
@@ -76,7 +76,7 @@ ZEND_API void zend_register_string_constant(const char *name, uint name_len, cha
7676
ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC);
7777
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC);
7878
void zend_copy_constants(HashTable *target, HashTable *sourc);
79-
zend_constant *zend_quick_get_constant(const zval *key, ulong flags TSRMLS_DC);
79+
zend_constant *zend_quick_get_constant(const zval *key, zend_uint_t flags TSRMLS_DC);
8080
END_EXTERN_C()
8181

8282
#define ZEND_CONSTANT_DTOR free_zend_constant

Zend/zend_exceptions.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{
459459
TRACE_APPEND_STR("true, ");
460460
break;
461461
case IS_RESOURCE: {
462-
long lval = Z_RES_HANDLE_P(arg);
462+
zend_int_t lval = Z_RES_HANDLE_P(arg);
463463
char s_tmp[MAX_LENGTH_OF_ZEND_INT + 1];
464464
int l_tmp = zend_sprintf(s_tmp, "%ld", lval); /* SAFE */
465465
TRACE_APPEND_STR("Resource id #");
@@ -468,7 +468,7 @@ static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{
468468
break;
469469
}
470470
case IS_INT: {
471-
long lval = Z_IVAL_P(arg);
471+
zend_int_t lval = Z_IVAL_P(arg);
472472
char s_tmp[MAX_LENGTH_OF_ZEND_INT + 1];
473473
int l_tmp = zend_sprintf(s_tmp, "%ld", lval); /* SAFE */
474474
TRACE_APPEND_STRL(s_tmp, l_tmp);
@@ -509,7 +509,7 @@ static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{
509509
}
510510
/* }}} */
511511

512-
static void _build_trace_string(zval *frame, ulong index, zend_string **str_ptr, int *num TSRMLS_DC) /* {{{ */
512+
static void _build_trace_string(zval *frame, zend_uint_t index, zend_string **str_ptr, int *num TSRMLS_DC) /* {{{ */
513513
{
514514
char *s_tmp;
515515
int len;
@@ -584,7 +584,7 @@ static void _build_trace_string(zval *frame, ulong index, zend_string **str_ptr,
584584
ZEND_METHOD(exception, getTraceAsString)
585585
{
586586
zval *trace, *frame;
587-
ulong index;
587+
zend_uint_t index;
588588
zend_string *str, *key;
589589
int num = 0, len;
590590
char s_tmp[MAX_LENGTH_OF_ZEND_INT + 7 + 1 + 1];

Zend/zend_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
4848
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
4949
ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
5050

51-
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, char **class_name, zend_class_entry **pce TSRMLS_DC);
51+
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, zend_uint_t fetch_type, char **class_name, zend_class_entry **pce TSRMLS_DC);
5252
ZEND_API void 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, zval *arg TSRMLS_DC);
5353

5454
static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)

Zend/zend_execute_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS
16801680

16811681
if (execute_data) {
16821682
if (!execute_data->symbol_table) {
1683-
zend_ulong h = STR_HASH_VAL(name);
1683+
zend_uint_t h = STR_HASH_VAL(name);
16841684
zend_op_array *op_array = &execute_data->func->op_array;
16851685
int i;
16861686

@@ -1716,7 +1716,7 @@ ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int
17161716

17171717
if (execute_data) {
17181718
if (!execute_data->symbol_table) {
1719-
zend_ulong h = zend_hash_func(name, len);
1719+
zend_uint_t h = zend_hash_func(name, len);
17201720
zend_op_array *op_array = &execute_data->func->op_array;
17211721
int i;
17221722

Zend/zend_language_scanner.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
16451645
yyleng = YYCURSOR - SCNG(yy_text);
16461646
#line 2153 "Zend/zend_language_scanner.l"
16471647
{
1648-
Z_IVAL_P(zendlval) = (long) '{';
1648+
Z_IVAL_P(zendlval) = (zend_int_t) '{';
16491649
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
16501650
yyless(1);
16511651
return T_CURLY_OPEN;
@@ -1873,7 +1873,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
18731873
yyleng = YYCURSOR - SCNG(yy_text);
18741874
#line 2153 "Zend/zend_language_scanner.l"
18751875
{
1876-
Z_IVAL_P(zendlval) = (long) '{';
1876+
Z_IVAL_P(zendlval) = (zend_int_t) '{';
18771877
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
18781878
yyless(1);
18791879
return T_CURLY_OPEN;
@@ -2132,7 +2132,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
21322132
yyleng = YYCURSOR - SCNG(yy_text);
21332133
#line 2153 "Zend/zend_language_scanner.l"
21342134
{
2135-
Z_IVAL_P(zendlval) = (long) '{';
2135+
Z_IVAL_P(zendlval) = (zend_int_t) '{';
21362136
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
21372137
yyless(1);
21382138
return T_CURLY_OPEN;

Zend/zend_language_scanner.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ inline_html:
21512151
21522152
21532153
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
2154-
Z_IVAL_P(zendlval) = (long) '{';
2154+
Z_IVAL_P(zendlval) = (zend_int_t) '{';
21552155
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
21562156
yyless(1);
21572157
return T_CURLY_OPEN;

Zend/zend_multiply.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
} \
8282
} while (0)
8383

84-
#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
84+
#elif SIZEOF_ZEND_INT == 4 && defined(HAVE_ZEND_LONG64)
8585

8686
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
8787
zend_long64 __result = (zend_long64) (a) * (zend_long64) (b); \

Zend/zend_objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *o
149149
}
150150
if (old_object->properties) {
151151
zval *prop, new_prop;
152-
ulong num_key;
152+
zend_uint_t num_key;
153153
zend_string *key;
154154

155155
if (!new_object->properties) {

0 commit comments

Comments
 (0)