com php-src: Use new param API in libxml: ext/libxml/libxml.c
| From: | Sara Golemon | Date: | Sat, 31 Dec 2016 16:38:14 +0000 |
| Subject: | com php-src: Use new param API in libxml: ext/libxml/libxml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96465@lists.php.net to get a copy of this message | ||
Commit: a470a8c0a05a394afd6c2432fc9231ea9406b78a
Author: Sara Golemon <pollita@php.net> Sat, 31 Dec 2016 08:38:14 -0800
Parents: 6007eb75843cba2a76a16c6b34ef2509e6560aa2
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a470a8c0a05a394afd6c2432fc9231ea9406b78a
Log:
Use new param API in libxml
Changed paths:
M ext/libxml/libxml.c
Diff:
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 1084979..c61d16d 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);