Skip to content

Commit e21d02a

Browse files
committed
Drop confusing ac local variable for ZEND_NUM_ARGS()
1 parent c6862d0 commit e21d02a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

ext/dba/dba.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,12 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
423423
size_t val_len;
424424
zval *id;
425425
dba_info *info = NULL;
426-
int ac = ZEND_NUM_ARGS();
427426
zval *key;
428427
char *val;
429428
char *key_str, *key_free;
430429
size_t key_len;
431430

432-
if (zend_parse_parameters(ac, "zsr", &key, &val, &val_len, &id) == FAILURE) {
431+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zsr", &key, &val, &val_len, &id) == FAILURE) {
433432
RETURN_THROWS();
434433
}
435434

@@ -896,12 +895,11 @@ PHP_FUNCTION(dba_exists)
896895
{
897896
zval *id;
898897
dba_info *info = NULL;
899-
int ac = ZEND_NUM_ARGS();
900898
zval *key;
901899
char *key_str, *key_free;
902900
size_t key_len;
903901

904-
if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) {
902+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zr", &key, &id) == FAILURE) {
905903
RETURN_THROWS();
906904
}
907905
if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {
@@ -925,20 +923,19 @@ PHP_FUNCTION(dba_fetch)
925923
size_t len = 0;
926924
zval *id;
927925
dba_info *info = NULL;
928-
int ac = ZEND_NUM_ARGS();
929926
zval *key;
930927
char *key_str, *key_free;
931928
size_t key_len;
932929
zend_long skip = 0;
933930

934-
switch(ac) {
931+
switch(ZEND_NUM_ARGS()) {
935932
case 2:
936-
if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) {
933+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zr", &key, &id) == FAILURE) {
937934
RETURN_THROWS();
938935
}
939936
break;
940937
case 3:
941-
if (zend_parse_parameters(ac, "zlr", &key, &skip, &id) == FAILURE) {
938+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zlr", &key, &skip, &id) == FAILURE) {
942939
RETURN_THROWS();
943940
}
944941
break;
@@ -951,7 +948,7 @@ PHP_FUNCTION(dba_fetch)
951948

952949
DBA_FETCH_RESOURCE_WITH_ID(info, id);
953950

954-
if (ac==3) {
951+
if (ZEND_NUM_ARGS() == 3) {
955952
if (!strcmp(info->hnd->name, "cdb")) {
956953
if (skip < 0) {
957954
php_error_docref(NULL, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name);
@@ -1073,12 +1070,11 @@ PHP_FUNCTION(dba_delete)
10731070
{
10741071
zval *id;
10751072
dba_info *info = NULL;
1076-
int ac = ZEND_NUM_ARGS();
10771073
zval *key;
10781074
char *key_str, *key_free;
10791075
size_t key_len;
10801076

1081-
if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) {
1077+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zr", &key, &id) == FAILURE) {
10821078
RETURN_THROWS();
10831079
}
10841080
if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {

0 commit comments

Comments
 (0)