Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/php/handlers/php_heap_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void php_ds_register_heap_handlers()
{
memcpy(&php_heap_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

php_heap_handlers.offset = XtOffsetOf(php_ds_heap_t, std);
php_heap_handlers.offset = offsetof(php_ds_heap_t, std);
php_heap_handlers.dtor_obj = zend_objects_destroy_object;
php_heap_handlers.free_obj = php_ds_heap_free_object;
php_heap_handlers.get_gc = php_ds_heap_get_gc;
Expand Down
2 changes: 1 addition & 1 deletion src/php/handlers/php_map_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void php_ds_register_map_handlers()
{
memcpy(&php_map_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

php_map_handlers.offset = XtOffsetOf(php_ds_map_t, std);
php_map_handlers.offset = offsetof(php_ds_map_t, std);
php_map_handlers.dtor_obj = zend_objects_destroy_object;
php_map_handlers.get_gc = php_ds_map_get_gc;
php_map_handlers.free_obj = php_ds_map_free_object;
Expand Down
2 changes: 1 addition & 1 deletion src/php/handlers/php_pair_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void php_ds_register_pair_handlers()
{
memcpy(&php_pair_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

php_pair_handlers.offset = XtOffsetOf(php_ds_pair_t, std);
php_pair_handlers.offset = offsetof(php_ds_pair_t, std);

php_pair_handlers.clone_obj = php_ds_pair_clone_object;
php_pair_handlers.cast_object = php_ds_default_cast_object;
Expand Down
11 changes: 2 additions & 9 deletions src/php/handlers/php_seq_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,7 @@ static void php_ds_seq_unset_dimension
zend_long index = 0;
ZVAL_DEREF(offset);

if (Z_TYPE_P(offset) == IS_LONG) {
index = Z_LVAL_P(offset);

} else {
if (zend_parse_parameter(ZEND_PARSE_PARAMS_QUIET, 1, offset, "l", &index) == FAILURE) {
return;
}
}
index = zval_get_long_ex(offset, true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have the same semantics as ZPP as it won't emit a deprecation on NULL nor reject arrays


if (ds_seq_index_exists(seq, index)) {
ds_seq_remove(seq, index, NULL);
Expand Down Expand Up @@ -132,7 +125,7 @@ void php_ds_register_seq_handlers()
{
memcpy(&php_seq_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

php_seq_handlers.offset = XtOffsetOf(php_ds_seq_t, std);
php_seq_handlers.offset = offsetof(php_ds_seq_t, std);

php_seq_handlers.dtor_obj = zend_objects_destroy_object;
php_seq_handlers.free_obj = php_ds_seq_free_object;
Expand Down
2 changes: 1 addition & 1 deletion src/php/handlers/php_set_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void php_ds_register_set_handlers()
{
memcpy(&php_ds_set_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

php_ds_set_handlers.offset = XtOffsetOf(php_ds_set_t, std);
php_ds_set_handlers.offset = offsetof(php_ds_set_t, std);

php_ds_set_handlers.cast_object = php_ds_default_cast_object;
php_ds_set_handlers.clone_obj = php_ds_set_clone_obj;
Expand Down
2 changes: 1 addition & 1 deletion src/php/objects/php_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct _php_ds_heap_t {
} php_ds_heap_t;

static inline php_ds_heap_t *php_ds_heap_fetch_object(zend_object *obj) {
return (php_ds_heap_t *)((char*)(obj) - XtOffsetOf(php_ds_heap_t, std));
return (php_ds_heap_t *)((char*)(obj) - offsetof(php_ds_heap_t, std));
}

#define Z_DS_HEAP(z) (php_ds_heap_fetch_object(Z_OBJ(z)))
Expand Down
2 changes: 1 addition & 1 deletion src/php/objects/php_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef struct _php_ds_map_t {
} php_ds_map_t;

static inline php_ds_map_t *php_ds_map_fetch_object(zend_object *obj) {
return (php_ds_map_t *)((char*)(obj) - XtOffsetOf(php_ds_map_t, std));
return (php_ds_map_t *)((char*)(obj) - offsetof(php_ds_map_t, std));
}

#define Z_DS_MAP(z) (php_ds_map_fetch_object(Z_OBJ(z))->map)
Expand Down
2 changes: 1 addition & 1 deletion src/php/objects/php_seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef struct php_ds_seq {
} php_ds_seq_t;

static inline php_ds_seq_t *php_ds_seq_fetch_object(zend_object *obj) {
return (php_ds_seq_t *)((char*)(obj) - XtOffsetOf(php_ds_seq_t, std));
return (php_ds_seq_t *)((char*)(obj) - offsetof(php_ds_seq_t, std));
}

#define Z_DS_SEQ(z) (php_ds_seq_fetch_object(Z_OBJ(z))->seq)
Expand Down
2 changes: 1 addition & 1 deletion src/php/objects/php_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef struct _php_ds_set_t {
} php_ds_set_t;

static inline php_ds_set_t *php_ds_set_fetch_object(zend_object *obj) {
return (php_ds_set_t *)((char*)(obj) - XtOffsetOf(php_ds_set_t, std));
return (php_ds_set_t *)((char*)(obj) - offsetof(php_ds_set_t, std));
}

#define Z_DS_SET(z) (php_ds_set_fetch_object(Z_OBJ(z))->set)
Expand Down
Loading