From 67e61e31d7981c9aa398de5940861c215e4d0910 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 26 May 2024 13:22:30 +0200 Subject: [PATCH] Cleanup DOM exception throwing parameters --- ext/dom/domexception.c | 6 +++--- ext/dom/php_dom.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c index 09532562d171..b9771fb03852 100644 --- a/ext/dom/domexception.c +++ b/ext/dom/domexception.c @@ -30,7 +30,7 @@ * Since: */ -void php_dom_throw_error_with_message(int error_code, char *error_message, bool strict_error) /* {{{ */ +void php_dom_throw_error_with_message(dom_exception_code error_code, const char *error_message, bool strict_error) /* {{{ */ { if (strict_error) { zend_throw_exception(dom_domexception_class_entry, error_message, error_code); @@ -41,9 +41,9 @@ void php_dom_throw_error_with_message(int error_code, char *error_message, bool /* }}} */ /* {{{ php_dom_throw_error */ -void php_dom_throw_error(int error_code, bool strict_error) +void php_dom_throw_error(dom_exception_code error_code, bool strict_error) { - char *error_message; + const char *error_message; switch (error_code) { diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 891c771d7931..27c603a3d9d4 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -130,8 +130,8 @@ zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type); zend_object *dom_xpath_objects_new(zend_class_entry *class_type); #endif bool dom_get_strict_error(php_libxml_ref_obj *document); -void php_dom_throw_error(int error_code, bool strict_error); -void php_dom_throw_error_with_message(int error_code, char *error_message, bool strict_error); +void php_dom_throw_error(dom_exception_code error_code, bool strict_error); +void php_dom_throw_error_with_message(dom_exception_code error_code, const char *error_message, bool strict_error); void node_list_unlink(xmlNodePtr node); int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len); xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix);