com php-src: Add Z_PARAM_LONG_OR_NULL macro: Zend /zend_API.h ext/standard/array.c ext/standard/streams funcs.c ext/standard/string.c

From: Date: Tue, 22 Oct 2019 10:09:04 +0000
Subject: com php-src: Add Z_PARAM_LONG_OR_NULL macro: Zend /zend_API.h ext/standard/array.c ext/standard/streams funcs.c ext/standard/string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-109004@lists.php.net to get a copy of this message
Commit: 8ccd58baca77b6fc4c818ac8b4f8af10370af5ad Author: Colin O'Dell <colinodell@gmail.com> Mon, 21 Oct 2019 16:04:57 -0400 Committer: Nikita Popov <nikita.ppv@gmail.com> Tue, 22 Oct 2019 12:09:04 +0200 Parents: c6cdfa967c5a68c4462da0b61d76d9f2c4d1fecb Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8ccd58baca77b6fc4c818ac8b4f8af10370af5ad Log: Add Z_PARAM_LONG_OR_NULL macro Changed paths: M Zend/zend_API.h M ext/standard/array..c M ext/standard/streamsfuncs.c M ext/standard/string.c Diff: diff --git a/Zend/zend_API.h b/Zend/zend_API.h index acc6bb9cf37...0b9fcd76af4 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1349,6 +1349,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *e #define Z_PARAM_LONG(dest) \ Z_PARAM_LONG_EX(dest, _dummy, 0, 0) +#define Z_PARAM_LONG_OR_NULL(dest, is_null) \ + Z_PARAM_LONG_EX(dest, is_null, 1, 0) /* no old equivalent */ #define Z_PARAM_NUMBER_EX(dest, check_null) \ diff --git a/ext/standard/array.c b/ext/standard/array.c index 3b827e519cf..d3aac515a7d 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3473,7 +3473,7 @@ PHP_FUNCTION(array_slice) Z_PARAM_ARRAY(input) Z_PARAM_LONG(offset) Z_PARAM_OPTIONAL - Z_PARAM_LONG_EX(length, length_is_null, 1, 0) + Z_PARAM_LONG_OR_NULL(length, length_is_null) Z_PARAM_BOOL(preserve_keys) ZEND_PARSE_PARAMETERS_END(); diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs..c index 1f84b486fc3..7c08083f5b6 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -753,7 +753,7 @@ PHP_FUNCTION(stream_select) Z_PARAM_ARRAY_EX2(r_array, 1, 1, 0) Z_PARAM_ARRAY_EX2(w_array, 1, 1, 0) Z_PARAM_ARRAY_EX2(e_array, 1, 1, 0) - Z_PARAM_LONG_EX(sec, secnull, 1, 0) + Z_PARAM_LONG_OR_NULL(sec, secnull) Z_PARAM_OPTIONAL Z_PARAM_LONG(usec) ZEND_PARSE_PARAMETERS_END(); @@ -1493,7 +1493,7 @@ PHP_FUNCTION(stream_socket_enable_crypto) Z_PARAM_RESOURCE(zstream) Z_PARAM_BOOL(enable) Z_PARAM_OPTIONAL - Z_PARAM_LONG_EX(cryptokind, cryptokindnull, 1, 0) + Z_PARAM_LONG_OR_NULL(cryptokind, cryptokindnull) Z_PARAM_RESOURCE(zsessstream) ZEND_PARSE_PARAMETERS_END(); diff --git a/ext/standard/string.c b/ext/standard/string.c index 948a1ffce18..b2be54e2cd3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -6098,7 +6098,7 @@ PHP_FUNCTION(substr_compare) Z_PARAM_STR(s2) Z_PARAM_LONG(offset) Z_PARAM_OPTIONAL - Z_PARAM_LONG_EX(len, len_is_default, 1, 0) + Z_PARAM_LONG_OR_NULL(len, len_is_default) Z_PARAM_BOOL(cs) ZEND_PARSE_PARAMETERS_END();

« previous php.cvs (#109004) next »