Remove unused XSL_DOMOBJ_NEW() macro

And inline the XSL_REGISTER_CLASS() macro.
This commit is contained in:
Nikita Popov 2020-09-28 15:41:31 +02:00
parent d1ddccdc19
commit 1efbc2cf58
2 changed files with 4 additions and 15 deletions

View File

@ -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

View File

@ -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);