From 1efbc2cf584287346c3e28955fae3c4891d4e9c4 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 28 Sep 2020 15:41:31 +0200 Subject: [PATCH] Remove unused XSL_DOMOBJ_NEW() macro And inline the XSL_REGISTER_CLASS() macro. --- ext/xsl/php_xsl.c | 6 ++++-- ext/xsl/php_xsl.h | 13 ------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 44debcaca7..300b196d03 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -111,7 +111,6 @@ zend_object *xsl_objects_new(zend_class_entry *class_type) /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(xsl) { - zend_class_entry ce; memcpy(&xsl_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -119,7 +118,10 @@ PHP_MINIT_FUNCTION(xsl) xsl_object_handlers.clone_obj = NULL; xsl_object_handlers.free_obj = xsl_objects_free_storage; - REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, class_XSLTProcessor_methods, xsl_xsltprocessor_class_entry); + INIT_CLASS_ENTRY(ce, "XSLTProcessor", class_XSLTProcessor_methods); + ce.create_object = xsl_objects_new; + xsl_xsltprocessor_class_entry = zend_register_internal_class(&ce); + #ifdef HAVE_XSL_EXSLT exsltRegisterAll(); #endif diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h index 6085925024..41e2c0b4e6 100644 --- a/ext/xsl/php_xsl.h +++ b/ext/xsl/php_xsl.h @@ -80,19 +80,6 @@ void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs); void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs); -#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \ -INIT_CLASS_ENTRY(ce, name, funcs); \ -ce.create_object = xsl_objects_new; \ -entry = zend_register_internal_class_ex(&ce, parent_ce); - -#define XSL_DOMOBJ_NEW(zval, obj, ret) \ - zval = php_xsl_create_object(obj, ret, zval, return_value); \ - if (ZVAL_IS_NULL(zval)) { \ - php_error_docref(NULL, E_WARNING, "Cannot create required DOM object"); \ - RETURN_FALSE; \ - } - - PHP_MINIT_FUNCTION(xsl); PHP_MSHUTDOWN_FUNCTION(xsl); PHP_RINIT_FUNCTION(xsl); -- 2.40.0