com php-src: Use new param API in json: ext/json/json.c
| From: | Sara Golemon | Date: | Sat, 31 Dec 2016 16:35:07 +0000 |
| Subject: | com php-src: Use new param API in json: ext/json/json.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96467@lists.php.net to get a copy of this message | ||
Commit: 6007eb75843cba2a76a16c6b34ef2509e6560aa2
Author: Sara Golemon <pollita@php.net> Sat, 31 Dec 2016 08:35:07 -0800
Parents: ae1ecf1173fcbaf47aebb86a0992546f141a34e5
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6007eb75843cba2a76a16c6b34ef2509e6560aa2
Log:
Use new param API in json
Changed paths:
M ext/json/json.c
Diff:
diff --git a/ext/json/json.c b/ext/json/json.c
index 219fd58..c252144 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -226,9 +226,12 @@ static PHP_FUNCTION(json_encode)
zend_long options = 0;
zend_long depth = PHP_JSON_PARSER_DEFAULT_DEPTH;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", ¶meter, &options,
&depth) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL_DEREF(parameter)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(options)
+ Z_PARAM_LONG(depth)
+ ZEND_PARSE_PARAMETERS_END();
php_json_encode_init(&encoder);
encoder.max_depth = (int)depth;
@@ -259,9 +262,13 @@ static PHP_FUNCTION(json_decode)
zend_long depth = PHP_JSON_PARSER_DEFAULT_DEPTH;
zend_long options = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bll", &str, &str_len, &assoc,
&depth, &options) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STRING(str, str_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(assoc)
+ Z_PARAM_LONG(depth)
+ Z_PARAM_LONG(options)
+ ZEND_PARSE_PARAMETERS_END();
JSON_G(error_code) = PHP_JSON_ERROR_NONE;