Skip to content

Commit a470a8c

Browse files
committed
Use new param API in libxml
1 parent 6007eb7 commit a470a8c

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

ext/libxml/libxml.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,10 @@ static PHP_FUNCTION(libxml_set_streams_context)
952952
{
953953
zval *arg;
954954

955-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg) == FAILURE) {
956-
return;
957-
}
955+
ZEND_PARSE_PARAMETERS_START(1, 1)
956+
Z_PARAM_RESOURCE(arg)
957+
ZEND_PARSE_PARAMETERS_END();
958+
958959
if (!Z_ISUNDEF(LIBXML(stream_context))) {
959960
zval_ptr_dtor(&LIBXML(stream_context));
960961
ZVAL_UNDEF(&LIBXML(stream_context));
@@ -970,9 +971,10 @@ static PHP_FUNCTION(libxml_use_internal_errors)
970971
xmlStructuredErrorFunc current_handler;
971972
zend_bool use_errors=0, retval;
972973

973-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &use_errors) == FAILURE) {
974-
return;
975-
}
974+
ZEND_PARSE_PARAMETERS_START(0, 1)
975+
Z_PARAM_OPTIONAL
976+
Z_PARAM_BOOL(use_errors)
977+
ZEND_PARSE_PARAMETERS_END();
976978

977979
current_handler = xmlStructuredError;
978980
if (current_handler && current_handler == php_libxml_structured_error_handler) {
@@ -1099,9 +1101,10 @@ static PHP_FUNCTION(libxml_disable_entity_loader)
10991101
{
11001102
zend_bool disable = 1;
11011103

1102-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &disable) == FAILURE) {
1103-
return;
1104-
}
1104+
ZEND_PARSE_PARAMETERS_START(0, 1)
1105+
Z_PARAM_OPTIONAL
1106+
Z_PARAM_BOOL(disable)
1107+
ZEND_PARSE_PARAMETERS_END();
11051108

11061109
RETURN_BOOL(php_libxml_disable_entity_loader(disable));
11071110
}
@@ -1113,10 +1116,10 @@ static PHP_FUNCTION(libxml_set_external_entity_loader)
11131116
{
11141117
zend_fcall_info fci;
11151118
zend_fcall_info_cache fcc;
1116-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!", &fci, &fcc)
1117-
== FAILURE) {
1118-
return;
1119-
}
1119+
1120+
ZEND_PARSE_PARAMETERS_START(1, 1)
1121+
Z_PARAM_FUNC_EX(fci, fcc, 1, 0)
1122+
ZEND_PARSE_PARAMETERS_END();
11201123

11211124
_php_libxml_destroy_fci(&LIBXML(entity_loader).fci, &LIBXML(entity_loader).object);
11221125

0 commit comments

Comments
 (0)