Skip to content

Commit a5a4813

Browse files
committed
Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t
These types are standard C99. For compatibility with out-of-tree extensions, keep the typedefs in main/php.h.
1 parent 5013c10 commit a5a4813

35 files changed

+73
-77
lines changed

.gdbinit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ end
482482

483483
define print_pi
484484
set $pi = (zend_property_info *)$arg0
485-
set $initial_offset = ((uint32_t)(zend_uintptr_t)(&((zend_object*)0)->properties_table[(0)]))
485+
set $initial_offset = ((uint32_t)(uintptr_t)(&((zend_object*)0)->properties_table[(0)]))
486486
set $ptr_to_val = (zval*)((char*)$pi->ce->default_properties_table + $pi->offset - $initial_offset)
487487
printf "[%p] {\n", $pi
488488
printf " offset = %p\n", $pi->offset

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,7 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
27512751
internal_function->arg_info = (zend_internal_arg_info*)ptr->arg_info+1;
27522752
internal_function->num_args = ptr->num_args;
27532753
/* Currently you cannot denote that the function can accept less arguments than num_args */
2754-
if (info->required_num_args == (zend_uintptr_t)-1) {
2754+
if (info->required_num_args == (uintptr_t)-1) {
27552755
internal_function->required_num_args = ptr->num_args;
27562756
} else {
27572757
internal_function->required_num_args = info->required_num_args;

Zend/zend_API.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ typedef struct _zend_fcall_info_cache {
161161

162162
#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, return_reference, required_num_args, class_name, allow_null, is_tentative_return_type) \
163163
static const zend_internal_arg_info name[] = { \
164-
{ (const char*)(zend_uintptr_t)(required_num_args), \
164+
{ (const char*)(uintptr_t)(required_num_args), \
165165
ZEND_TYPE_INIT_CLASS_CONST(#class_name, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL },
166166

167167
#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \
@@ -175,7 +175,7 @@ typedef struct _zend_fcall_info_cache {
175175

176176
#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, is_tentative_return_type) \
177177
static const zend_internal_arg_info name[] = { \
178-
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_MASK(type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL },
178+
{ (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_MASK(type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL },
179179

180180
#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) \
181181
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, 0)
@@ -185,7 +185,7 @@ typedef struct _zend_fcall_info_cache {
185185

186186
#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, is_tentative_return_type) \
187187
static const zend_internal_arg_info name[] = { \
188-
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL },
188+
{ (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL },
189189

190190
#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(name, return_reference, required_num_args, class_name, type) \
191191
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, 0)
@@ -195,7 +195,7 @@ typedef struct _zend_fcall_info_cache {
195195

196196
#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, is_tentative_return_type) \
197197
static const zend_internal_arg_info name[] = { \
198-
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CODE(type, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL },
198+
{ (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_CODE(type, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL },
199199

200200
#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
201201
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, 0)
@@ -208,7 +208,7 @@ typedef struct _zend_fcall_info_cache {
208208

209209
#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) \
210210
static const zend_internal_arg_info name[] = { \
211-
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(return_reference, 0, 0)), NULL },
211+
{ (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(return_reference, 0, 0)), NULL },
212212
#define ZEND_BEGIN_ARG_INFO(name, _unused) \
213213
ZEND_BEGIN_ARG_INFO_EX(name, {}, ZEND_RETURN_VALUE, -1)
214214
#define ZEND_END_ARG_INFO() };

Zend/zend_alloc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ static void *zend_mm_chunk_alloc(zend_mm_heap *heap, size_t size, size_t alignme
777777
#if ZEND_MM_STORAGE
778778
if (UNEXPECTED(heap->storage)) {
779779
void *ptr = heap->storage->handlers.chunk_alloc(heap->storage, size, alignment);
780-
ZEND_ASSERT(((zend_uintptr_t)((char*)ptr + (alignment-1)) & (alignment-1)) == (zend_uintptr_t)ptr);
780+
ZEND_ASSERT(((uintptr_t)((char*)ptr + (alignment-1)) & (alignment-1)) == (uintptr_t)ptr);
781781
return ptr;
782782
}
783783
#endif
@@ -2174,7 +2174,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap)
21742174
repeated = zend_mm_find_leaks_huge(heap, list);
21752175
total += 1 + repeated;
21762176
if (repeated) {
2177-
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated);
2177+
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(uintptr_t)repeated);
21782178
}
21792179

21802180
heap->huge_list = list = list->next;
@@ -2213,7 +2213,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap)
22132213
zend_mm_find_leaks(heap, p, i + bin_pages[bin_num], &leak);
22142214
total += 1 + repeated;
22152215
if (repeated) {
2216-
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated);
2216+
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(uintptr_t)repeated);
22172217
}
22182218
}
22192219
dbg = (zend_mm_debug_info*)((char*)dbg + bin_data_size[bin_num]);
@@ -2239,7 +2239,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap)
22392239
repeated = zend_mm_find_leaks(heap, p, i + pages_count, &leak);
22402240
total += 1 + repeated;
22412241
if (repeated) {
2242-
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated);
2242+
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(uintptr_t)repeated);
22432243
}
22442244
i += pages_count;
22452245
}

Zend/zend_compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ typedef struct _zend_arg_info {
431431
* It's also used for the return type.
432432
*/
433433
typedef struct _zend_internal_function_info {
434-
zend_uintptr_t required_num_args;
434+
uintptr_t required_num_args;
435435
zend_type type;
436436
const char *default_value;
437437
} zend_internal_function_info;

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4731,7 +4731,7 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_array(zend_ar
47314731
}
47324732
/* }}} */
47334733

4734-
#define ZEND_FAKE_OP_ARRAY ((zend_op_array*)(zend_intptr_t)-1)
4734+
#define ZEND_FAKE_OP_ARRAY ((zend_op_array*)(intptr_t)-1)
47354735

47364736
static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval *inc_filename_zv, int type) /* {{{ */
47374737
{

Zend/zend_execute_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *
11521152
ALLOC_HASHTABLE(CG(unlinked_uses));
11531153
zend_hash_init(CG(unlinked_uses), 0, NULL, NULL, 0);
11541154
}
1155-
zend_hash_index_add_empty_element(CG(unlinked_uses), (zend_long)(zend_uintptr_t)ce);
1155+
zend_hash_index_add_empty_element(CG(unlinked_uses), (zend_long)(uintptr_t)ce);
11561156
return ce;
11571157
}
11581158
return NULL;

Zend/zend_hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ ZEND_API ZEND_ATTRIBUTE_PURE int zend_hash_compare(HashTable *ht1, HashTable *
298298
ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, bool renumber);
299299
ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag);
300300

301-
static zend_always_inline void ZEND_FASTCALL zend_hash_sort(HashTable *ht, bucket_compare_func_t compare_func, zend_bool renumber) {
301+
static zend_always_inline void ZEND_FASTCALL zend_hash_sort(HashTable *ht, bucket_compare_func_t compare_func, bool renumber) {
302302
zend_hash_sort_ex(ht, zend_sort, compare_func, renumber);
303303
}
304304

Zend/zend_inheritance.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,7 @@ static void check_unrecoverable_load_failure(zend_class_entry *ce) {
26952695
* a dependence on the inheritance hierarchy of this specific class. Instead we fall back to
26962696
* a fatal error, as would happen if we did not allow exceptions in the first place. */
26972697
if (CG(unlinked_uses)
2698-
&& zend_hash_index_del(CG(unlinked_uses), (zend_long)(zend_uintptr_t)ce) == SUCCESS) {
2698+
&& zend_hash_index_del(CG(unlinked_uses), (zend_long)(uintptr_t)ce) == SUCCESS) {
26992699
zend_exception_uncaught_error(
27002700
"During inheritance of %s with variance dependencies", ZSTR_VAL(ce->name));
27012701
}
@@ -2963,7 +2963,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
29632963
}
29642964

29652965
if (CG(unlinked_uses)) {
2966-
zend_hash_index_del(CG(unlinked_uses), (zend_long)(zend_uintptr_t) ce);
2966+
zend_hash_index_del(CG(unlinked_uses), (zend_long)(uintptr_t) ce);
29672967
}
29682968

29692969
orig_linking_class = CG(current_linking_class);

Zend/zend_object_handlers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
536536

537537
static void zend_property_guard_dtor(zval *el) /* {{{ */ {
538538
uint32_t *ptr = (uint32_t*)Z_PTR_P(el);
539-
if (EXPECTED(!(((zend_uintptr_t)ptr) & 1))) {
539+
if (EXPECTED(!(((uintptr_t)ptr) & 1))) {
540540
efree_size(ptr, sizeof(uint32_t));
541541
}
542542
}
@@ -565,7 +565,7 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
565565
zend_hash_init(guards, 8, NULL, zend_property_guard_dtor, 0);
566566
/* mark pointer as "special" using low bit */
567567
zend_hash_add_new_ptr(guards, str,
568-
(void*)(((zend_uintptr_t)&Z_PROPERTY_GUARD_P(zv)) | 1));
568+
(void*)(((uintptr_t)&Z_PROPERTY_GUARD_P(zv)) | 1));
569569
zval_ptr_dtor_str(zv);
570570
ZVAL_ARR(zv, guards);
571571
}
@@ -574,7 +574,7 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
574574
ZEND_ASSERT(guards != NULL);
575575
zv = zend_hash_find(guards, member);
576576
if (zv != NULL) {
577-
return (uint32_t*)(((zend_uintptr_t)Z_PTR_P(zv)) & ~1);
577+
return (uint32_t*)(((uintptr_t)Z_PTR_P(zv)) & ~1);
578578
}
579579
} else {
580580
ZEND_ASSERT(Z_TYPE_P(zv) == IS_UNDEF);

Zend/zend_objects_API.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525

2626
#define OBJ_BUCKET_INVALID (1<<0)
2727

28-
#define IS_OBJ_VALID(o) (!(((zend_uintptr_t)(o)) & OBJ_BUCKET_INVALID))
28+
#define IS_OBJ_VALID(o) (!(((uintptr_t)(o)) & OBJ_BUCKET_INVALID))
2929

30-
#define SET_OBJ_INVALID(o) ((zend_object*)((((zend_uintptr_t)(o)) | OBJ_BUCKET_INVALID)))
30+
#define SET_OBJ_INVALID(o) ((zend_object*)((((uintptr_t)(o)) | OBJ_BUCKET_INVALID)))
3131

32-
#define GET_OBJ_BUCKET_NUMBER(o) (((zend_intptr_t)(o)) >> 1)
32+
#define GET_OBJ_BUCKET_NUMBER(o) (((intptr_t)(o)) >> 1)
3333

3434
#define SET_OBJ_BUCKET_NUMBER(o, n) do { \
35-
(o) = (zend_object*)((((zend_uintptr_t)(n)) << 1) | OBJ_BUCKET_INVALID); \
35+
(o) = (zend_object*)((((uintptr_t)(n)) << 1) | OBJ_BUCKET_INVALID); \
3636
} while (0)
3737

3838
#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(h) do { \

Zend/zend_portability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ extern "C++" {
668668
# define ZEND_SET_ALIGNED(alignment, decl) decl
669669
#endif
670670

671-
#define ZEND_SLIDE_TO_ALIGNED(alignment, ptr) (((zend_uintptr_t)(ptr) + ((alignment)-1)) & ~((alignment)-1))
671+
#define ZEND_SLIDE_TO_ALIGNED(alignment, ptr) (((uintptr_t)(ptr) + ((alignment)-1)) & ~((alignment)-1))
672672
#define ZEND_SLIDE_TO_ALIGNED16(ptr) ZEND_SLIDE_TO_ALIGNED(Z_UL(16), ptr)
673673

674674
#ifdef ZEND_WIN32

Zend/zend_types.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
# define ZEND_ENDIAN_LOHI_C_4(a, b, c, d) a, b, c, d
5050
#endif
5151

52-
typedef bool zend_bool;
5352
typedef unsigned char zend_uchar;
5453

5554
#ifdef ZEND_ENABLE_ZVAL_LONG64
@@ -66,9 +65,6 @@ typedef unsigned char zend_uchar;
6665
# endif
6766
#endif
6867

69-
typedef intptr_t zend_intptr_t;
70-
typedef uintptr_t zend_uintptr_t;
71-
7268
#ifdef ZTS
7369
#define ZEND_TLS static TSRM_TLS
7470
#define ZEND_EXT_TLS TSRM_TLS

Zend/zend_vm_execute.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Zend/zend_vm_execute.skl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void init_opcode_serialiser(void)
9292
Z_TYPE_INFO(tmp) = IS_LONG;
9393
for (i = 0; i < zend_handlers_count; i++) {
9494
Z_LVAL(tmp) = i;
95-
zend_hash_index_add(zend_handlers_table, (zend_long)(zend_uintptr_t)zend_opcode_handlers[i], &tmp);
95+
zend_hash_index_add(zend_handlers_table, (zend_long)(uintptr_t)zend_opcode_handlers[i], &tmp);
9696
}
9797
}
9898

@@ -103,14 +103,14 @@ ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op)
103103
if (!zend_handlers_table) {
104104
init_opcode_serialiser();
105105
}
106-
zv = zend_hash_index_find(zend_handlers_table, (zend_long)(zend_uintptr_t)op->handler);
106+
zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler);
107107
ZEND_ASSERT(zv != NULL);
108-
op->handler = (const void *)(zend_uintptr_t)Z_LVAL_P(zv);
108+
op->handler = (const void *)(uintptr_t)Z_LVAL_P(zv);
109109
}
110110

111111
ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(zend_op *op)
112112
{
113-
op->handler = zend_opcode_handlers[(zend_uintptr_t)op->handler];
113+
op->handler = zend_opcode_handlers[(uintptr_t)op->handler];
114114
}
115115

116116
ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *op)
@@ -123,7 +123,7 @@ ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *o
123123
if (!zend_handlers_table) {
124124
init_opcode_serialiser();
125125
}
126-
zv = zend_hash_index_find(zend_handlers_table, (zend_long)(zend_uintptr_t)op->handler);
126+
zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler);
127127
ZEND_ASSERT(zv != NULL);
128128
return zend_opcode_handler_funcs[Z_LVAL_P(zv)];
129129
#else

docs/parameter-parsing-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ on input and is used to verify the PHP parameter is an instance of that class.
6767
```txt
6868
a - array (zval*)
6969
A - array or object (zval*)
70-
b - boolean (zend_bool)
70+
b - boolean (bool)
7171
C - class (zend_class_entry*)
7272
d - double (double)
7373
f - function or array containing php method call info (returned as
@@ -97,9 +97,9 @@ The following characters also have a meaning in the specifier string:
9797
* `!` - the parameter it follows can be of specified type or NULL. If NULL is
9898
passed, and the output for such type is a pointer, then the output pointer is
9999
set to a native NULL pointer. For 'b', 'l' and 'd', an extra argument of type
100-
zend_bool* must be passed after the corresponding bool*, zend_long* or
100+
bool* must be passed after the corresponding bool*, zend_long* or
101101
double* arguments, respectively. A non-zero value will be written to the
102-
zend_bool if a PHP NULL is passed.
102+
bool if a PHP NULL is passed.
103103
For `f` use the ``ZEND_FCI_INITIALIZED(fci)`` macro to check if a callable
104104
has been provided and ``!ZEND_FCI_INITIALIZED(fci)`` to check if a PHP NULL
105105
is passed.

ext/date/php_date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ static void date_interval_object_to_hash(php_interval_obj *intervalobj, HashTabl
21552155

21562156
/* Records whether this is a special relative interval that needs to be recreated from a string */
21572157
if (intervalobj->from_string) {
2158-
ZVAL_BOOL(&zv, (zend_bool)intervalobj->from_string);
2158+
ZVAL_BOOL(&zv, (bool)intervalobj->from_string);
21592159
zend_hash_str_update(props, "from_string", strlen("from_string"), &zv);
21602160
ZVAL_STR_COPY(&zv, intervalobj->date_string);
21612161
zend_hash_str_update(props, "date_string", strlen("date_string"), &zv);
@@ -2181,7 +2181,7 @@ static void date_interval_object_to_hash(php_interval_obj *intervalobj, HashTabl
21812181
ZVAL_FALSE(&zv);
21822182
zend_hash_str_update(props, "days", sizeof("days")-1, &zv);
21832183
}
2184-
ZVAL_BOOL(&zv, (zend_bool)intervalobj->from_string);
2184+
ZVAL_BOOL(&zv, (bool)intervalobj->from_string);
21852185
zend_hash_str_update(props, "from_string", strlen("from_string"), &zv);
21862186

21872187
#undef PHP_DATE_INTERVAL_ADD_PROPERTY

ext/opcache/ZendAccelerator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,11 +1539,11 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
15391539
#if defined(__AVX__) || defined(__SSE2__)
15401540
/* Align to 64-byte boundary */
15411541
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 64);
1542-
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 63L) & ~63L);
1542+
ZCG(mem) = (void*)(((uintptr_t)ZCG(mem) + 63L) & ~63L);
15431543
#elif ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT
15441544
/* Align to 8-byte boundary */
15451545
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 8);
1546-
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 7L) & ~7L);
1546+
ZCG(mem) = (void*)(((uintptr_t)ZCG(mem) + 7L) & ~7L);
15471547
#else
15481548
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used);
15491549
#endif
@@ -2471,7 +2471,7 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
24712471

24722472
#if ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT
24732473
/* Align to 8-byte boundary */
2474-
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 7L) & ~7L);
2474+
ZCG(mem) = (void*)(((uintptr_t)ZCG(mem) + 7L) & ~7L);
24752475
#endif
24762476

24772477
memset(ZCG(mem), 0, size);

ext/opcache/jit/zend_jit_disasm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static const char* zend_jit_disasm_resolver(
262262
((void)ud);
263263
# endif
264264
const char *name;
265-
void *a = (void*)(zend_uintptr_t)(addr);
265+
void *a = (void*)(uintptr_t)(addr);
266266
Dl_info info;
267267

268268
name = zend_jit_disasm_find_symbol(addr, offset);

ext/opcache/jit/zend_jit_oprofile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static void zend_jit_oprofile_register(const char *name,
2727
size_t size)
2828
{
2929
if (op_agent) {
30-
op_write_native_code(op_agent, name, (uint64_t)(zend_uintptr_t)start, start, size);
30+
op_write_native_code(op_agent, name, (uint64_t)(uintptr_t)start, start, size);
3131
}
3232
}
3333

ext/opcache/jit/zend_jit_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static zend_always_inline const char *zend_jit_trace_star_desc(uint8_t trace_fla
4646
}
4747
}
4848

49-
static int zend_jit_trace_startup(zend_bool reattached)
49+
static int zend_jit_trace_startup(bool reattached)
5050
{
5151
if (!reattached) {
5252
zend_jit_traces = (zend_jit_trace_info*)zend_shared_alloc(sizeof(zend_jit_trace_info) * JIT_G(max_root_traces));

0 commit comments

Comments
 (0)