From: Sara Golemon Date: Sat, 31 Dec 2016 16:38:14 +0000 (-0800) Subject: Use new param API in libxml X-Git-Tag: php-7.2.0alpha1~707 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a470a8c0a05a394afd6c2432fc9231ea9406b78a;p=php Use new param API in libxml --- diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 1084979bbb..c61d16dacc 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -952,9 +952,10 @@ static PHP_FUNCTION(libxml_set_streams_context) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_RESOURCE(arg) + ZEND_PARSE_PARAMETERS_END(); + if (!Z_ISUNDEF(LIBXML(stream_context))) { zval_ptr_dtor(&LIBXML(stream_context)); ZVAL_UNDEF(&LIBXML(stream_context)); @@ -970,9 +971,10 @@ static PHP_FUNCTION(libxml_use_internal_errors) xmlStructuredErrorFunc current_handler; zend_bool use_errors=0, retval; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &use_errors) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(use_errors) + ZEND_PARSE_PARAMETERS_END(); current_handler = xmlStructuredError; if (current_handler && current_handler == php_libxml_structured_error_handler) { @@ -1099,9 +1101,10 @@ static PHP_FUNCTION(libxml_disable_entity_loader) { zend_bool disable = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &disable) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(disable) + ZEND_PARSE_PARAMETERS_END(); RETURN_BOOL(php_libxml_disable_entity_loader(disable)); } @@ -1113,10 +1116,10 @@ static PHP_FUNCTION(libxml_set_external_entity_loader) { zend_fcall_info fci; zend_fcall_info_cache fcc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!", &fci, &fcc) - == FAILURE) { - return; - } + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_FUNC_EX(fci, fcc, 1, 0) + ZEND_PARSE_PARAMETERS_END(); _php_libxml_destroy_fci(&LIBXML(entity_loader).fci, &LIBXML(entity_loader).object);