com php-src: Use variables that already received ZEND_NUM_A RGS(): ext/bz2/bz2.c ext/gd/gd_ctx.c ext/ interbase/interbase.c ext/ldap/ldap.c
ext/odbc/php_od bc.c ext/xmlrpc/xmlrpc-epi-php.c
| From: | Gabriel Caruso | Date: | Sun, 22 Jul 2018 18:54:00 +0000 |
| Subject: | com php-src: Use variables that already received ZEND_NUM_A RGS(): ext/bz2/bz2.c ext/gd/gd_ctx.c ext/ interbase/interbase.c ext/ldap/ldap.c ext/odbc/php_od bc.c ext/xmlrpc/xmlrpc-epi-php.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-102641@lists.php.net to get a copy of this message | ||
Commit: 8ca1f47a7a25f61fcc63313a771e6922e3258046
Author: Gabriel Caruso <carusogabriel34@gmail.com> Sun, 22 Jul 2018 15:54:00 -0300
Parents: 26cd84d19f164f592f24593f4d1d1f7bd10696a6
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8ca1f47a7a25f61fcc63313a771e6922e3258046
Log:
Use variables that already received ZEND_NUM_ARGS()
Changed paths:
M ext/bz2/bz2.c
M ext/gd/gd_ctx.c
M ext/interbase/interbase.c
M ext/ldap/ldap.c
M ext/odbc/php_odbc.c
M ext/xmlrpc/xmlrpc-epi-php.c
Diff:
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index 2d6ffc2..c4d7904 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -516,13 +516,11 @@ static PHP_FUNCTION(bzcompress)
int error, /* Error Container */
block_size = 4, /* Block size for compression algorithm */
work_factor = 0, /* Work factor for compression algorithm */
- argc; /* Argument count */
+ argc = ZEND_NUM_ARGS(); /* Argument count */
size_t source_len; /* Length of the source data */
unsigned int dest_len; /* Length of the destination buffer */
- argc = ZEND_NUM_ARGS();
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &source, &source_len,
&zblock_size, &zwork_factor) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|ll", &source, &source_len, &zblock_size,
&zwork_factor) == FAILURE) {
return;
}
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 9c3d733..f00ab4c 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -101,12 +101,12 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int
image_type,
*/
switch (image_type) {
case PHP_GDIMG_TYPE_XBM:
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp!|ll", &imgind, &file,
&file_len, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(argc, "rp!|ll", &imgind, &file, &file_len,
&quality, &basefilter) == FAILURE) {
return;
}
break;
case PHP_GDIMG_TYPE_BMP:
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!b", &imgind, &to_zval,
&compressed) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|z!b", &imgind, &to_zval, &compressed)
== FAILURE) {
return;
}
break;
@@ -117,7 +117,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* PHP_GDIMG_TYPE_WBM
* PHP_GDIMG_TYPE_WEBP
* */
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!ll", &imgind, &to_zval,
&quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|z!ll", &imgind, &to_zval, &quality,
&basefilter) == FAILURE) {
return;
}
}
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 27cbb32..4781332 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -1123,7 +1123,7 @@ PHP_FUNCTION(ibase_drop_db)
PHP_FUNCTION(ibase_trans)
{
unsigned short i, link_cnt = 0, tpb_len = 0;
- int argn;
+ int argn = ZEND_NUM_ARGS();
char last_tpb[TPB_MAX_SIZE];
ibase_db_link **ib_link = NULL;
ibase_trans *ib_trans;
@@ -1132,8 +1132,6 @@ PHP_FUNCTION(ibase_trans)
RESET_ERRMSG;
- argn = ZEND_NUM_ARGS();
-
/* (1+argn) is an upper bound for the number of links this trans connects to */
ib_link = (ibase_db_link **) safe_emalloc(sizeof(ibase_db_link *),1+argn,0);
@@ -1143,7 +1141,7 @@ PHP_FUNCTION(ibase_trans)
ISC_TEB *teb;
zval *args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argn) == FAILURE) {
+ if (zend_parse_parameters(argn, "+", &args, &argn) == FAILURE) {
efree(ib_link);
RETURN_FALSE;
}
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 244b039..110c53a 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -3335,7 +3335,7 @@ PHP_FUNCTION(ldap_parse_result)
char *lmatcheddn, *lerrmsg;
int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrz/|z/z/z/z/", &link, &result,
&errcode, &matcheddn, &errmsg, &referrals, &serverctrls) != SUCCESS) {
+ if (zend_parse_parameters(myargcount, "rrz/|z/z/z/z/", &link, &result,
&errcode, &matcheddn, &errmsg, &referrals, &serverctrls) != SUCCESS) {
return;
}
@@ -3411,7 +3411,7 @@ PHP_FUNCTION(ldap_parse_exop)
struct berval *lretdata;
int rc, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|z/z/", &link, &result,
&retdata, &retoid) != SUCCESS) {
+ if (zend_parse_parameters(myargcount, "rr|z/z/", &link, &result, &retdata,
&retoid) != SUCCESS) {
WRONG_PARAM_COUNT;
}
@@ -3925,7 +3925,7 @@ PHP_FUNCTION(ldap_control_paged_result)
LDAPControl ctrl, *ctrlsp[2];
int rc, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|bs", &link, &pagesize,
&iscritical, &cookie, &cookie_len) != SUCCESS) {
+ if (zend_parse_parameters(myargcount, "rl|bs", &link, &pagesize,
&iscritical, &cookie, &cookie_len) != SUCCESS) {
return;
}
@@ -4017,7 +4017,7 @@ PHP_FUNCTION(ldap_control_paged_result_response)
ber_tag_t tag;
int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|z/z/", &link, &result,
&cookie, &estimated) != SUCCESS) {
+ if (zend_parse_parameters(myargcount, "rr|z/z/", &link, &result, &cookie,
&estimated) != SUCCESS) {
return;
}
@@ -4221,7 +4221,7 @@ PHP_FUNCTION(ldap_exop_passwd)
int rc, myargcount = ZEND_NUM_ARGS(), msgid, err;
char* errmsg;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|zzzz/", &link, &user, &oldpw,
&newpw, &serverctrls) == FAILURE) {
+ if (zend_parse_parameters(myargcount, "r|zzzz/", &link, &user, &oldpw,
&newpw, &serverctrls) == FAILURE) {
WRONG_PARAM_COUNT;
}
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 0ecdee9..941252a 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1302,12 +1302,10 @@ PHP_FUNCTION(odbc_execute)
unsigned char otype;
SQLSMALLINT ctype;
odbc_result *result;
- int numArgs, i, ne;
+ int numArgs = ZEND_NUM_ARGS(), i, ne;
RETCODE rc;
- numArgs = ZEND_NUM_ARGS();
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|a", &pv_res, &pv_param_arr) ==
FAILURE) {
+ if (zend_parse_parameters(numArgs, "r|a", &pv_res, &pv_param_arr) == FAILURE) {
return;
}
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index e1ccd92..b4dad38 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -1026,7 +1026,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
php_output_options out;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|a", &handle, &rawxml,
&rawxml_len, &caller_params, &output_opts) != SUCCESS) {
+ if (zend_parse_parameters(argc, "rsz|a", &handle, &rawxml, &rawxml_len,
&caller_params, &output_opts) != SUCCESS) {
return;
}
/* user output options */
@@ -1447,4 +1447,3 @@ PHP_FUNCTION(xmlrpc_is_fault)
* c-basic-offset: 4
* End:
*/
-