]> granicus.if.org Git - php/commitdiff
Use new param API in libxml
authorSara Golemon <pollita@php.net>
Sat, 31 Dec 2016 16:38:14 +0000 (08:38 -0800)
committerSara Golemon <pollita@php.net>
Sat, 31 Dec 2016 16:38:14 +0000 (08:38 -0800)
ext/libxml/libxml.c

index 1084979bbb10bcf69c9480529ebbbf7df2bd3197..c61d16dacc01997989ba5e699be9b2a4aecb4545 100644 (file)
@@ -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);