@@ -246,7 +246,7 @@ struct deferred_call {
246
246
#endif
247
247
} data ;
248
248
#if PHP_VERSION_ID >= 70400
249
- zend_bool is_unserialize ;
249
+ bool is_unserialize ;
250
250
#endif
251
251
};
252
252
/** Unserializer data.
@@ -268,7 +268,7 @@ struct igbinary_unserialize_data {
268
268
struct deferred_call * deferred ; /**< objects&data for calls to __unserialize/__wakeup */
269
269
size_t deferred_capacity ; /**< capacity of objects in array for calls to __unserialize/__wakeup */
270
270
uint32_t deferred_count ; /**< count of objects in array for calls to __unserialize/__wakeup. NOTE: Current php releases including 8.1 limit the total number of objects to a 32-bit integer. */
271
- zend_bool deferred_finished ; /**< whether the deferred calls were performed */
271
+ bool deferred_finished ; /**< whether the deferred calls were performed */
272
272
struct deferred_dtor_tracker deferred_dtor_tracker ; /**< refcounted objects and arrays to call dtor on after unserializing. See i_zval_ptr_dtor */
273
273
#if PHP_VERSION_ID >= 70400
274
274
HashTable * ref_props ; /**< objects&data for calls to __unserialize/__wakeup */
@@ -324,9 +324,9 @@ zend_always_inline static uint64_t igbinary_unserialize64(struct igbinary_unseri
324
324
zend_always_inline static int igbinary_unserialize_long (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zend_long * ret );
325
325
zend_always_inline static int igbinary_unserialize_double (struct igbinary_unserialize_data * igsd , double * ret );
326
326
zend_always_inline static zend_string * igbinary_unserialize_string (struct igbinary_unserialize_data * igsd , enum igbinary_type t );
327
- zend_always_inline static zend_string * igbinary_unserialize_chararray (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zend_bool check_interned );
327
+ zend_always_inline static zend_string * igbinary_unserialize_chararray (struct igbinary_unserialize_data * igsd , enum igbinary_type t , bool check_interned );
328
328
329
- zend_always_inline static int igbinary_unserialize_array (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zval * const z , int flags , zend_bool create_ref );
329
+ zend_always_inline static int igbinary_unserialize_array (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zval * const z , int flags , bool create_ref );
330
330
zend_always_inline static int igbinary_unserialize_object (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zval * const z , int flags );
331
331
static int igbinary_unserialize_object_ser (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zval * const z , zend_class_entry * ce );
332
332
@@ -548,7 +548,7 @@ static int igbinary_finish_deferred_calls(struct igbinary_unserialize_data *igsd
548
548
uint32_t i ;
549
549
struct deferred_call * deferred_arr ;
550
550
uint32_t deferred_count = igsd -> deferred_count ;
551
- zend_bool delayed_call_failed = 0 ;
551
+ bool delayed_call_failed = 0 ;
552
552
igsd -> deferred_finished = 1 ;
553
553
if (deferred_count == 0 ) { /* nothing to do */
554
554
return 0 ;
@@ -1494,28 +1494,28 @@ inline static int igbinary_serialize_array(struct igbinary_serialize_data *igsd,
1494
1494
/* TODO: Use different result codes for missing keys and errors */
1495
1495
zend_always_inline static int igbinary_serialize_array_ref (struct igbinary_serialize_data * igsd , zval * const z , bool object ) {
1496
1496
size_t t ;
1497
- zend_uintptr_t key ; /* The address of the pointer to the zend_refcounted struct or other struct */
1497
+ uintptr_t key ; /* The address of the pointer to the zend_refcounted struct or other struct */
1498
1498
static int INVALID_KEY ; /* Not used, but we take the pointer of this knowing other zvals won't share it*/
1499
1499
1500
1500
/* Similar to php_var_serialize_intern's first part, as well as php_add_var_hash, for printing R: (reference) or r:(object) */
1501
1501
/* However, it differs from the built in serialize() in that references to objects are preserved when serializing and unserializing? (TODO check, test for backwards compatibility) */
1502
1502
1503
1503
ZEND_ASSERT (Z_ISREF_P (z ) || (object && Z_TYPE_P (z ) == IS_OBJECT ) || Z_TYPE_P (z ) == IS_ARRAY );
1504
- // zend_bool is_ref = Z_ISREF_P(z);
1504
+ // bool is_ref = Z_ISREF_P(z);
1505
1505
/* Do I have to dereference object references so that reference ids will be the same as in php5? */
1506
1506
/* If I do, then more tests fail. */
1507
1507
/* is_ref || IS_OBJECT implies it has a unique refcounted struct */
1508
1508
// NOTE: The original code would always use the same memory address - Z_COUNTED_P is the start of an object/array/reference
1509
1509
// if (object && Z_TYPE_P(z) == IS_OBJECT) {
1510
- // key = (zend_uintptr_t )Z_OBJ_P(z); /* expand object handle(uint32_t), cast to 32-bit/64-bit pointer */
1510
+ // key = (uintptr_t )Z_OBJ_P(z); /* expand object handle(uint32_t), cast to 32-bit/64-bit pointer */
1511
1511
// } else if (is_ref) {
1512
1512
// /* NOTE: PHP switched from `zval*` to `zval` for the values stored in HashTables.
1513
1513
// * If an array has two references to the same ZVAL, then those references will have different zvals.
1514
1514
// * We use Z_COUNTED_P(ref), which will be the same if (and only if) the references are the same. */
1515
1515
// /* is_ref implies there is a unique reference counting pointer for the reference */
1516
- // key = (zend_uintptr_t )Z_COUNTED_P(z);
1516
+ // key = (uintptr_t )Z_COUNTED_P(z);
1517
1517
// } else if (EXPECTED(Z_TYPE_P(z) == IS_ARRAY)) {
1518
- // key = (zend_uintptr_t )Z_ARR_P(z);
1518
+ // key = (uintptr_t )Z_ARR_P(z);
1519
1519
// } else {
1520
1520
// /* Nothing else is going to reference this when this is serialized, this isn't ref counted or an object, shouldn't be reached. */
1521
1521
// /* Increment the reference id for the deserializer, give up. */
@@ -1528,9 +1528,9 @@ zend_always_inline static int igbinary_serialize_array_ref(struct igbinary_seria
1528
1528
/* because that's the way it was serialized in php5. */
1529
1529
/* Does this work with different forms of recursive arrays? */
1530
1530
if (igsd -> references_id == 0 && !object ) {
1531
- key = (zend_uintptr_t )& INVALID_KEY ;
1531
+ key = (uintptr_t )& INVALID_KEY ;
1532
1532
} else {
1533
- key = (zend_uintptr_t )z -> value .ptr ;
1533
+ key = (uintptr_t )z -> value .ptr ;
1534
1534
}
1535
1535
1536
1536
t = hash_si_ptr_find_or_insert (& igsd -> references , key , igsd -> references_id );
@@ -2407,7 +2407,7 @@ static ZEND_COLD zend_never_inline zend_string* igbinary_unserialize_extremely_l
2407
2407
/* }}} */
2408
2408
/* {{{ igbinary_unserialize_chararray */
2409
2409
/** Unserializes chararray of string. Returns NULL on error. */
2410
- inline static zend_string * igbinary_unserialize_chararray (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zend_bool check_interned ) {
2410
+ inline static zend_string * igbinary_unserialize_chararray (struct igbinary_unserialize_data * igsd , enum igbinary_type t , bool check_interned ) {
2411
2411
size_t l ;
2412
2412
zend_string * zstr ;
2413
2413
@@ -2490,7 +2490,7 @@ inline static zend_string *igbinary_unserialize_chararray(struct igbinary_unseri
2490
2490
/* }}} */
2491
2491
/* {{{ igbinary_unserialize_array */
2492
2492
/** Unserializes a PHP array. */
2493
- zend_always_inline static int igbinary_unserialize_array (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zval * const z , int flags , zend_bool create_ref ) {
2493
+ zend_always_inline static int igbinary_unserialize_array (struct igbinary_unserialize_data * igsd , enum igbinary_type t , zval * const z , int flags , bool create_ref ) {
2494
2494
/* WANT_REF means that z will be wrapped by an IS_REFERENCE */
2495
2495
uint32_t n ;
2496
2496
uint32_t i ;
@@ -2708,7 +2708,7 @@ inline static int igbinary_unserialize_object_properties(struct igbinary_unseria
2708
2708
zval * z_deref ;
2709
2709
2710
2710
HashTable * h ;
2711
- zend_bool did_extend ;
2711
+ bool did_extend ;
2712
2712
2713
2713
if (t == igbinary_type_array8 ) {
2714
2714
if (IGB_NEEDS_MORE_DATA (igsd , 1 )) {
@@ -2845,7 +2845,7 @@ inline static int igbinary_unserialize_object_properties(struct igbinary_unseria
2845
2845
if (igsd -> ref_props ) {
2846
2846
/* Remove old entry from ref_props table, if it exists. */
2847
2847
zend_hash_index_del (
2848
- igsd -> ref_props , ((zend_uintptr_t ) prototype_value ) >> ZEND_MM_ALIGNMENT_LOG2 );
2848
+ igsd -> ref_props , ((uintptr_t ) prototype_value ) >> ZEND_MM_ALIGNMENT_LOG2 );
2849
2849
}
2850
2850
}
2851
2851
#endif
@@ -2927,7 +2927,7 @@ inline static int igbinary_unserialize_object_properties(struct igbinary_unseria
2927
2927
zend_hash_init (igsd -> ref_props , 8 , NULL , NULL , 0 );
2928
2928
}
2929
2929
zend_hash_index_update_ptr (
2930
- igsd -> ref_props , ((zend_uintptr_t ) vp ) >> ZEND_MM_ALIGNMENT_LOG2 , info );
2930
+ igsd -> ref_props , ((uintptr_t ) vp ) >> ZEND_MM_ALIGNMENT_LOG2 , info );
2931
2931
}
2932
2932
}
2933
2933
#endif
@@ -3459,7 +3459,7 @@ static int igbinary_unserialize_zval(struct igbinary_unserialize_data *igsd, zva
3459
3459
#if PHP_VERSION_ID >= 70400
3460
3460
zend_property_info * info = NULL ;
3461
3461
if (igsd -> ref_props ) {
3462
- info = zend_hash_index_find_ptr (igsd -> ref_props , ((zend_uintptr_t ) z ) >> ZEND_MM_ALIGNMENT_LOG2 );
3462
+ info = zend_hash_index_find_ptr (igsd -> ref_props , ((uintptr_t ) z ) >> ZEND_MM_ALIGNMENT_LOG2 );
3463
3463
}
3464
3464
#endif
3465
3465
ZVAL_NEW_REF (z , z );
0 commit comments