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
558 changes: 450 additions & 108 deletions CMakePresets.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions generate-presets.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum PHPVersion: string
case PHP83 = '8.3';
case PHP84 = '8.4';
case PHP85 = '8.5';
case PHP86 = '8.6';
}

enum PHPTS: string
Expand Down
6 changes: 3 additions & 3 deletions include/php_scylladb_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Recover a pointer to the user struct from the embedded zend_object*.
*
* PHP_SCYLLADB_OBJ_ALLOCATE(T, ce, handlers):
* Allocate a user struct (size = sizeof(T), offset = XtOffsetOf(T, zendObject)),
* Allocate a user struct (size = sizeof(T), offset = offsetof(T, zendObject)),
* zero-init the user-fields prefix, call zend_object_std_init /
* object_properties_init on the embedded zend_object, and wire its
* handlers. Returns the user struct.
Expand All @@ -20,7 +20,7 @@
#include <php.h>

#define PHP_SCYLLADB_OBJ_FETCH(T, obj) \
((T *)((char *)(obj) - XtOffsetOf(T, zendObject)))
((T *)((char *)(obj) - offsetof(T, zendObject)))

[[nodiscard]] static zend_always_inline void *php_scylladb_obj_allocate(
size_t size, size_t obj_offset, zend_class_entry *ce, void *handlers)
Expand Down Expand Up @@ -56,4 +56,4 @@
}

#define PHP_SCYLLADB_OBJ_ALLOCATE(T, ce, handlers) \
((T *)php_scylladb_obj_allocate(sizeof(T), XtOffsetOf(T, zendObject), (ce), (handlers)))
((T *)php_scylladb_obj_allocate(sizeof(T), offsetof(T, zendObject), (ce), (handlers)))
8 changes: 7 additions & 1 deletion scripts/compile-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,15 @@ CONFIG_ARGS=(
--enable-sockets
--enable-mbstring
--disable-short-tags
--with-pic
)

# PHP 8.6 renamed --with-pic to --enable-pic; the old spelling now hard-errors.
if [[ "$(printf '%s\n8.6\n' "$PHP_VERSION" | sort -V | head -1)" == "8.6" ]]; then
CONFIG_ARGS+=(--enable-pic)
else
CONFIG_ARGS+=(--with-pic)
fi

if [[ "$(uname -s)" == "Darwin" ]] && command -v brew >/dev/null 2>&1; then
BREW_PREFIX="$(brew --prefix)"
[[ -d "$BREW_PREFIX/opt/libiconv" ]] && CONFIG_ARGS+=(--with-iconv="$BREW_PREFIX/opt/libiconv")
Expand Down
2 changes: 1 addition & 1 deletion src/Blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,5 @@ zend_object* php_scylladb_blob_new(zend_class_entry *ce) {

void php_scylladb_blob_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_blob_handlers.std.offset = XtOffsetOf(php_scylladb_blob, zendObject);
php_scylladb_blob_handlers.std.offset = offsetof(php_scylladb_blob, zendObject);
}
4 changes: 2 additions & 2 deletions src/Collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ php_scylladb_collection_new(zend_class_entry *ce)
self->dirty = 1;
ZVAL_UNDEF(&self->type);

php_scylladb_collection_handlers.std.offset = XtOffsetOf(php_scylladb_collection, zendObject);
php_scylladb_collection_handlers.std.offset = offsetof(php_scylladb_collection, zendObject);
php_scylladb_collection_handlers.std.free_obj = php_scylladb_collection_free;
return &self->zendObject;
}


void php_scylladb_collection_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_collection_handlers.std.offset = XtOffsetOf(php_scylladb_collection, zendObject);
php_scylladb_collection_handlers.std.offset = offsetof(php_scylladb_collection, zendObject);
}
2 changes: 1 addition & 1 deletion src/Database/DefaultAggregate.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ php_scylladb_default_aggregate_new(zend_class_entry *ce )
ZVAL_UNDEF(&self->schema);
self->meta = nullptr;

php_scylladb_default_aggregate_handlers.offset = XtOffsetOf(php_scylladb_aggregate, zendObject);
php_scylladb_default_aggregate_handlers.offset = offsetof(php_scylladb_aggregate, zendObject);
php_scylladb_default_aggregate_handlers.free_obj = php_scylladb_default_aggregate_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/DefaultColumn.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ php_scylladb_default_column_new(zend_class_entry *ce )
ZVAL_UNDEF(&self->name);
ZVAL_UNDEF(&self->type);

php_scylladb_default_column_handlers.offset = XtOffsetOf(php_scylladb_column, zendObject);
php_scylladb_default_column_handlers.offset = offsetof(php_scylladb_column, zendObject);
php_scylladb_default_column_handlers.free_obj = php_scylladb_default_column_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/DefaultFunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ php_scylladb_default_function_new(zend_class_entry *ce )
ZVAL_UNDEF(&self->schema);
self->meta = nullptr;

php_scylladb_default_function_handlers.offset = XtOffsetOf(php_scylladb_function, zendObject);
php_scylladb_default_function_handlers.offset = offsetof(php_scylladb_function, zendObject);
php_scylladb_default_function_handlers.free_obj = php_scylladb_default_function_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/DefaultIndex.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ php_scylladb_default_index_new(zend_class_entry *ce )
ZVAL_UNDEF(&self->schema);
self->meta = nullptr;

php_scylladb_default_index_handlers.offset = XtOffsetOf(php_scylladb_index, zendObject);
php_scylladb_default_index_handlers.offset = offsetof(php_scylladb_index, zendObject);
php_scylladb_default_index_handlers.free_obj = php_scylladb_default_index_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/DefaultKeyspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ zend_object* php_scylladb_default_keyspace_new(zend_class_entry *ce) {
self->meta = nullptr;
ZVAL_UNDEF(&self->schema);

php_scylladb_default_keyspace_handlers.offset = XtOffsetOf(php_scylladb_keyspace, zendObject);
php_scylladb_default_keyspace_handlers.offset = offsetof(php_scylladb_keyspace, zendObject);
php_scylladb_default_keyspace_handlers.free_obj = php_scylladb_default_keyspace_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/DefaultMaterializedView.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ php_scylladb_default_materialized_view_new(zend_class_entry *ce )
self->meta = nullptr;
ZVAL_UNDEF(&self->schema);

php_scylladb_default_materialized_view_handlers.offset = XtOffsetOf(php_scylladb_materialized_view, zendObject);
php_scylladb_default_materialized_view_handlers.offset = offsetof(php_scylladb_materialized_view, zendObject);
php_scylladb_default_materialized_view_handlers.free_obj = php_scylladb_default_materialized_view_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/DefaultSchema.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ php_scylladb_default_schema_new(zend_class_entry *ce )

self->schema_meta = nullptr;

php_scylladb_default_schema_handlers.offset = XtOffsetOf(php_scylladb_schema, zendObject);
php_scylladb_default_schema_handlers.offset = offsetof(php_scylladb_schema, zendObject);
php_scylladb_default_schema_handlers.free_obj = php_scylladb_default_schema_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/DefaultTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ php_scylladb_default_table_new(zend_class_entry *ce )
self->meta = nullptr;
ZVAL_UNDEF(&self->schema);

php_scylladb_default_table_handlers.offset = XtOffsetOf(php_scylladb_table, zendObject);
php_scylladb_default_table_handlers.offset = offsetof(php_scylladb_table, zendObject);
php_scylladb_default_table_handlers.free_obj = php_scylladb_default_table_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/Database/Rows.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ zend_object *php_scylladb_rows_new(zend_class_entry *ce)
ZVAL_UNDEF(&self->next_rows);
ZVAL_UNDEF(&self->future_next_page);

php_scylladb_rows_handlers.offset = XtOffsetOf(php_scylladb_rows, zendObject);
php_scylladb_rows_handlers.offset = offsetof(php_scylladb_rows, zendObject);
php_scylladb_rows_handlers.free_obj = php_scylladb_rows_free;
return &self->zendObject;
}
2 changes: 1 addition & 1 deletion src/DateTime/Date.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,5 @@ zend_object *php_scylladb_date_new(zend_class_entry *ce) {

void php_scylladb_date_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_date_handlers.std.offset = XtOffsetOf(php_scylladb_date, zendObject);
php_scylladb_date_handlers.std.offset = offsetof(php_scylladb_date, zendObject);
}
2 changes: 1 addition & 1 deletion src/DateTime/Duration.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,5 @@ php_scylladb_duration_new(zend_class_entry *ce )

void php_scylladb_duration_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_duration_handlers.std.offset = XtOffsetOf(php_scylladb_duration, zendObject);
php_scylladb_duration_handlers.std.offset = offsetof(php_scylladb_duration, zendObject);
}
2 changes: 1 addition & 1 deletion src/DateTime/Time.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,5 @@ zend_object *php_scylladb_time_new(zend_class_entry *ce) {

void php_scylladb_time_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_time_handlers.std.offset = XtOffsetOf(php_scylladb_time, zendObject);
php_scylladb_time_handlers.std.offset = offsetof(php_scylladb_time, zendObject);
}
2 changes: 1 addition & 1 deletion src/DateTime/Timestamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,5 @@ zend_object *php_scylladb_timestamp_new(zend_class_entry *ce) {

void php_scylladb_timestamp_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_timestamp_handlers.std.offset = XtOffsetOf(php_scylladb_timestamp, zendObject);
php_scylladb_timestamp_handlers.std.offset = offsetof(php_scylladb_timestamp, zendObject);
}
4 changes: 2 additions & 2 deletions src/DateTime/Timeuuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ zend_object* php_scylladb_timeuuid_new(zend_class_entry *ce) {
php_scylladb_uuid *self =
PHP_SCYLLADB_OBJ_ALLOCATE(php_scylladb_uuid, ce, &php_scylladb_timeuuid_handlers);

php_scylladb_timeuuid_handlers.std.offset = XtOffsetOf(php_scylladb_uuid, zendObject);
php_scylladb_timeuuid_handlers.std.offset = offsetof(php_scylladb_uuid, zendObject);
php_scylladb_timeuuid_handlers.std.free_obj = php_scylladb_timeuuid_free;
return &self->zendObject;
}


void php_scylladb_timeuuid_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_timeuuid_handlers.std.offset = XtOffsetOf(php_scylladb_uuid, zendObject);
php_scylladb_timeuuid_handlers.std.offset = offsetof(php_scylladb_uuid, zendObject);
}
2 changes: 1 addition & 1 deletion src/Inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@ php_scylladb_inet_new(zend_class_entry *ce)

void php_scylladb_inet_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_inet_handlers.std.offset = XtOffsetOf(php_scylladb_inet, zendObject);
php_scylladb_inet_handlers.std.offset = offsetof(php_scylladb_inet, zendObject);
}
4 changes: 2 additions & 2 deletions src/Map.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,13 @@ php_scylladb_map_new(zend_class_entry *ce)
self->dirty = 1;
ZVAL_UNDEF(&self->type);

php_scylladb_map_handlers.std.offset = XtOffsetOf(php_scylladb_map, zendObject);
php_scylladb_map_handlers.std.offset = offsetof(php_scylladb_map, zendObject);
php_scylladb_map_handlers.std.free_obj = php_scylladb_map_free;
return &self->zendObject;
}


void php_scylladb_map_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_map_handlers.std.offset = XtOffsetOf(php_scylladb_map, zendObject);
php_scylladb_map_handlers.std.offset = offsetof(php_scylladb_map, zendObject);
}
2 changes: 1 addition & 1 deletion src/Numbers/Bigint.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,5 +517,5 @@ zend_object* php_scylladb_bigint_new(zend_class_entry *ce)

void php_scylladb_bigint_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_bigint_handlers.std.offset = XtOffsetOf(php_scylladb_numeric, zendObject);
php_scylladb_bigint_handlers.std.offset = offsetof(php_scylladb_numeric, zendObject);
}
2 changes: 1 addition & 1 deletion src/Numbers/Decimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,5 +653,5 @@ zend_object* php_scylladb_decimal_new(zend_class_entry *ce)

void php_scylladb_decimal_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_decimal_handlers.std.offset = XtOffsetOf(php_scylladb_numeric, zendObject);
php_scylladb_decimal_handlers.std.offset = offsetof(php_scylladb_numeric, zendObject);
}
2 changes: 1 addition & 1 deletion src/Numbers/Float.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,5 @@ php_scylladb_float_new(zend_class_entry *ce )

void php_scylladb_float_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_float_handlers.std.offset = XtOffsetOf(php_scylladb_numeric, zendObject);
php_scylladb_float_handlers.std.offset = offsetof(php_scylladb_numeric, zendObject);
}
2 changes: 1 addition & 1 deletion src/Numbers/Smallint.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,5 +555,5 @@ zend_object* php_scylladb_smallint_new(zend_class_entry *ce )

void php_scylladb_smallint_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_smallint_handlers.std.offset = XtOffsetOf(php_scylladb_numeric, zendObject);
php_scylladb_smallint_handlers.std.offset = offsetof(php_scylladb_numeric, zendObject);
}
2 changes: 1 addition & 1 deletion src/Numbers/Tinyint.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,5 +553,5 @@ zend_object* php_scylladb_tinyint_new(zend_class_entry *ce )

void php_scylladb_tinyint_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_tinyint_handlers.std.offset = XtOffsetOf(php_scylladb_numeric, zendObject);
php_scylladb_tinyint_handlers.std.offset = offsetof(php_scylladb_numeric, zendObject);
}
2 changes: 1 addition & 1 deletion src/Numbers/Varint.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,5 +500,5 @@ zend_object* php_scylladb_varint_new(zend_class_entry *ce )

void php_scylladb_varint_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_varint_handlers.std.offset = XtOffsetOf(php_scylladb_numeric, zendObject);
php_scylladb_varint_handlers.std.offset = offsetof(php_scylladb_numeric, zendObject);
}
4 changes: 2 additions & 2 deletions src/Set.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ php_scylladb_set_new(zend_class_entry* ce)
self->dirty = 1;
ZVAL_UNDEF(&self->type);

php_scylladb_set_handlers.std.offset = XtOffsetOf(php_scylladb_set, zendObject);
php_scylladb_set_handlers.std.offset = offsetof(php_scylladb_set, zendObject);
php_scylladb_set_handlers.std.free_obj = php_scylladb_set_free;
return &self->zendObject;
}

void php_scylladb_set_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_set_handlers.std.offset = XtOffsetOf(php_scylladb_set, zendObject);
php_scylladb_set_handlers.std.offset = offsetof(php_scylladb_set, zendObject);
}
2 changes: 1 addition & 1 deletion src/TimestampGenerator/Monotonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ php_scylladb_timestamp_generator_monotonic_new(zend_class_entry *ce)

void php_scylladb_timestamp_generator_monotonic_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_timestamp_generator_monotonic_handlers.offset = XtOffsetOf(php_scylladb_timestamp_gen, zendObject);
php_scylladb_timestamp_generator_monotonic_handlers.offset = offsetof(php_scylladb_timestamp_gen, zendObject);
}
2 changes: 1 addition & 1 deletion src/TimestampGenerator/ServerSide.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ php_scylladb_timestamp_generator_server_side_new(zend_class_entry *ce)

void php_scylladb_timestamp_generator_server_side_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_timestamp_generator_server_side_handlers.offset = XtOffsetOf(php_scylladb_timestamp_gen, zendObject);
php_scylladb_timestamp_generator_server_side_handlers.offset = offsetof(php_scylladb_timestamp_gen, zendObject);
}
4 changes: 2 additions & 2 deletions src/Tuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ php_scylladb_tuple_new(zend_class_entry *ce)
self->dirty = 1;
ZVAL_UNDEF(&self->type);

php_scylladb_tuple_handlers.std.offset = XtOffsetOf(php_scylladb_tuple, zendObject);
php_scylladb_tuple_handlers.std.offset = offsetof(php_scylladb_tuple, zendObject);
php_scylladb_tuple_handlers.std.free_obj = php_scylladb_tuple_free;
return &self->zendObject;
}


void php_scylladb_tuple_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_tuple_handlers.std.offset = XtOffsetOf(php_scylladb_tuple, zendObject);
php_scylladb_tuple_handlers.std.offset = offsetof(php_scylladb_tuple, zendObject);
}
2 changes: 1 addition & 1 deletion src/Type/Collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ zend_object* php_scylladb_type_collection_new(
self->data_type = cass_data_type_new(self->type);
ZVAL_UNDEF(&self->data.collection.value_type);

php_scylladb_type_collection_handlers.offset = XtOffsetOf(php_scylladb_type, zendObject);
php_scylladb_type_collection_handlers.offset = offsetof(php_scylladb_type, zendObject);
php_scylladb_type_collection_handlers.free_obj = php_scylladb_type_collection_free;
return &self->zendObject;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Custom.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ zend_object *php_scylladb_type_custom_new(zend_class_entry *ce) {
self->data_type = cass_data_type_new(self->type);
self->data.custom.class_name = nullptr;

php_scylladb_type_custom_handlers.offset = XtOffsetOf(php_scylladb_type, zendObject);
php_scylladb_type_custom_handlers.offset = offsetof(php_scylladb_type, zendObject);
php_scylladb_type_custom_handlers.free_obj = php_scylladb_type_custom_free;
return &self->zendObject;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Map.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ php_scylladb_type_map_new(zend_class_entry *ce )
ZVAL_UNDEF(&self->data.map.key_type);
ZVAL_UNDEF(&self->data.map.value_type);

php_scylladb_type_map_handlers.offset = XtOffsetOf(php_scylladb_type, zendObject);
php_scylladb_type_map_handlers.offset = offsetof(php_scylladb_type, zendObject);
php_scylladb_type_map_handlers.free_obj = php_scylladb_type_map_free;
return &self->zendObject;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Scalar.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ zend_object* php_scylladb_type_scalar_new(zend_class_entry *ce) {
self->type = CASS_VALUE_TYPE_UNKNOWN;
self->data_type = nullptr;

php_scylladb_type_scalar_handlers.offset = XtOffsetOf(php_scylladb_type, zendObject);
php_scylladb_type_scalar_handlers.offset = offsetof(php_scylladb_type, zendObject);
php_scylladb_type_scalar_handlers.free_obj = php_scylladb_type_scalar_free;
return &self->zendObject;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Set.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ php_scylladb_type_set_new(zend_class_entry *ce )
self->data_type = cass_data_type_new(self->type);
ZVAL_UNDEF(&self->data.set.value_type);

php_scylladb_type_set_handlers.offset = XtOffsetOf(php_scylladb_type, zendObject);
php_scylladb_type_set_handlers.offset = offsetof(php_scylladb_type, zendObject);
php_scylladb_type_set_handlers.free_obj = php_scylladb_type_set_free;
return &self->zendObject;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Tuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ php_scylladb_type_tuple_new(zend_class_entry* ce )
self->data_type = cass_data_type_new(self->type);
zend_hash_init(&self->data.tuple.types, 0, nullptr, ZVAL_PTR_DTOR, 0);

php_scylladb_type_tuple_handlers.offset = XtOffsetOf(php_scylladb_type, zendObject);
php_scylladb_type_tuple_handlers.offset = offsetof(php_scylladb_type, zendObject);
php_scylladb_type_tuple_handlers.free_obj = php_scylladb_type_tuple_free;
return &self->zendObject;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/UserType.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ php_scylladb_type_user_type_new(zend_class_entry *ce )
self->data.udt.keyspace = self->data.udt.type_name = nullptr;
zend_hash_init(&self->data.udt.types, 0, nullptr, ZVAL_PTR_DTOR, 0);

php_scylladb_type_user_type_handlers.offset = XtOffsetOf(php_scylladb_type, zendObject);
php_scylladb_type_user_type_handlers.offset = offsetof(php_scylladb_type, zendObject);
php_scylladb_type_user_type_handlers.free_obj = php_scylladb_type_user_type_free;
return &self->zendObject;
}
Expand Down
5 changes: 4 additions & 1 deletion src/Type/ValueHash.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ php_scylladb_value_compare(zval* zvalue1, zval* zvalue2)
case IS_FALSE:
return Z_TYPE_P(zvalue2) == IS_FALSE ? 0 : -1;
case IS_STRING:
return zend_binary_zval_strcmp(zvalue1, zvalue2);
return zend_binary_strcmp(Z_STRVAL_P(zvalue1),
Z_STRLEN_P(zvalue1),
Z_STRVAL_P(zvalue2),
Z_STRLEN_P(zvalue2));
case IS_OBJECT:
return Z_OBJ_P(zvalue1)->handlers->compare(zvalue1, zvalue2);
default:
Expand Down
4 changes: 2 additions & 2 deletions src/UserTypeValue.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ php_scylladb_user_type_value_new(zend_class_entry *ce)
self->dirty = 1;
ZVAL_UNDEF(&self->type);

php_scylladb_user_type_value_handlers.std.offset = XtOffsetOf(php_scylladb_user_type_value, zendObject);
php_scylladb_user_type_value_handlers.std.offset = offsetof(php_scylladb_user_type_value, zendObject);
php_scylladb_user_type_value_handlers.std.free_obj = php_scylladb_user_type_value_free;
return &self->zendObject;
}


void php_scylladb_user_type_value_post_register([[maybe_unused]] zend_class_entry *ce)
{
php_scylladb_user_type_value_handlers.std.offset = XtOffsetOf(php_scylladb_user_type_value, zendObject);
php_scylladb_user_type_value_handlers.std.offset = offsetof(php_scylladb_user_type_value, zendObject);
}
Loading
Loading