Skip to content

Commit 477ee02

Browse files
committed
fixup! change: brotli.state resource in brotli_uncompress_{init,add}() to Btorli\UnCompress\Context class
1 parent a863406 commit 477ee02

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

brotli.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -920,22 +920,13 @@ static zend_class_entry *php_brotli_compress_context_register_class(void)
920920
zend_class_entry *php_brotli_uncompress_context_ce;
921921
static zend_object_handlers php_brotli_uncompress_context_object_handlers;
922922

923-
#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80300
924923
static zend_object *
925924
php_brotli_uncompress_context_create_object(zend_class_entry *class_type)
926925
{
927926
return php_brotli_context_create_object(
928927
class_type,
929928
&php_brotli_uncompress_context_object_handlers);
930929
}
931-
#elif PHP_VERSION_ID < 80000
932-
static zend_object *php_brotli_uncompress_new(zend_class_entry *class_type)
933-
{
934-
return
935-
php_brotli_context_new(class_type,
936-
&php_brotli_uncompress_context_object_handlers);
937-
}
938-
#endif
939930

940931
static zend_function *
941932
php_brotli_uncompress_context_get_constructor(zend_object *object)
@@ -959,7 +950,7 @@ static zend_class_entry *php_brotli_uncompress_context_register_class(void)
959950
class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES;
960951
#endif
961952
#else
962-
ce.create_object = php_brotli_uncompress_new;
953+
ce.create_object = php_brotli_uncompress_context_create_object;
963954
class_entry = zend_register_internal_class(&ce);
964955
class_entry->ce_flags |= ZEND_ACC_FINAL;
965956
#endif
@@ -1028,14 +1019,13 @@ ZEND_MINIT_FUNCTION(brotli)
10281019

10291020
php_brotli_uncompress_context_ce
10301021
= php_brotli_uncompress_context_register_class();
1031-
#if PHP_VERSION_ID >= 80300
1022+
#if PHP_VERSION_ID >= 80000
10321023
php_brotli_uncompress_context_ce->create_object
1033-
= php_brotli_context_create_object;
1024+
= php_brotli_uncompress_context_create_object;
1025+
#if PHP_VERSION_ID >= 80300
10341026
php_brotli_uncompress_context_ce->default_object_handlers
10351027
= &php_brotli_uncompress_context_object_handlers;
1036-
#elif PHP_VERSION_ID >= 80000
1037-
php_brotli_uncompress_context_ce->create_object
1038-
= php_brotli_uncompress_context_create_object;
1028+
#endif
10391029
#if PHP_VERSION_ID < 80100
10401030
php_brotli_uncompress_context_ce->serialize = zend_class_serialize_deny;
10411031
php_brotli_uncompress_context_ce->unserialize = zend_class_unserialize_deny;

0 commit comments

Comments
 (0)