Skip to content

Commit 4d11d90

Browse files
committed
Track down a few more functions that don't check for 0 args and use
faster mechanism
1 parent 5b2227e commit 4d11d90

File tree

17 files changed

+79
-46
lines changed

17 files changed

+79
-46
lines changed

ext/curl/curl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,9 @@ static void curl_free_slist(void **slist)
504504
Return the CURL version string. */
505505
PHP_FUNCTION(curl_version)
506506
{
507-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
508-
return;
507+
if (ZEND_NUM_ARGS() != 0) {
508+
WRONG_PARAM_COUNT;
509+
}
509510

510511
RETURN_STRING(curl_version(), 1);
511512
}

ext/db/db.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ PHP_MINFO_FUNCTION(db)
252252
Describes the dbm-compatible library being used */
253253
PHP_FUNCTION(dblist)
254254
{
255-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
256-
return;
255+
if (ZEND_NUM_ARGS() != 0) {
256+
WRONG_PARAM_COUNT;
257+
}
257258

258259
char *str = php_get_info_db();
259260
RETURN_STRING(str, 1);

ext/domxml/php_domxml.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,8 +2432,9 @@ PHP_FUNCTION(xmltree)
24322432
Initializing XPath environment */
24332433
PHP_FUNCTION(xpath_init)
24342434
{
2435-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
2436-
return;
2435+
if (ZEND_NUM_ARGS() != 0) {
2436+
WRONG_PARAM_COUNT;
2437+
}
24372438

24382439
xmlXPathInit();
24392440
RETURN_TRUE;

ext/fdf/fdf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ PHP_FUNCTION(fdf_create)
209209
FDFDoc fdf;
210210
FDFErc err;
211211

212-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
213-
return;
212+
if (ZEND_NUM_ARGS() != 0) {
213+
WRONG_PARAM_COUNT;
214+
}
214215

215216
err = FDFCreate(&fdf);
216217

ext/gd/gd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,9 @@ PHP_FUNCTION(imagetypes)
931931
#ifdef HAVE_GD_XPM
932932
ret |= 16;
933933
#endif
934-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
935-
return;
934+
if (ZEND_NUM_ARGS() != 0) {
935+
WRONG_PARAM_COUNT;
936+
}
936937

937938
RETURN_LONG(ret);
938939
}

ext/hyperwave/hw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,8 +1331,9 @@ PHP_FUNCTION(hw_errormsg)
13311331
Returns object id of root collection */
13321332
PHP_FUNCTION(hw_root)
13331333
{
1334-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
1335-
return;
1334+
if (ZEND_NUM_ARGS() != 0) {
1335+
WRONG_PARAM_COUNT;
1336+
}
13361337

13371338
return_value->value.lval = 0;
13381339
return_value->type = IS_LONG;

ext/interbase/interbase.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ typedef struct {
236236
Return error message */
237237
PHP_FUNCTION(ibase_errmsg)
238238
{
239-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
240-
return;
239+
if (ZEND_NUM_ARGS() != 0) {
240+
WRONG_PARAM_COUNT;
241+
}
241242

242243
if (IBG(errmsg[0])) {
243244
RETURN_STRING(IBG(errmsg), 1);

ext/mhash/mhash.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ static PHP_MINIT_FUNCTION(mhash)
8383
Gets the number of available hashes */
8484
PHP_FUNCTION(mhash_count)
8585
{
86-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
87-
return;
86+
if (ZEND_NUM_ARGS() != 0) {
87+
WRONG_PARAM_COUNT;
88+
}
8889

8990
RETURN_LONG(mhash_count());
9091
}

ext/odbc/php_odbc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,9 @@ PHP_FUNCTION(odbc_close_all)
711711
int i;
712712
int nument;
713713

714-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
715-
return;
714+
if (ZEND_NUM_ARGS() != 0) {
715+
WRONG_PARAM_COUNT;
716+
}
716717

717718
nument = zend_hash_next_free_element(&EG(regular_list));
718719

ext/sablot/sablot.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,9 @@ PHP_FUNCTION(xslt_output_endtransform)
292292
*buffer = NULL;
293293
int ret = 0;
294294

295-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
296-
return;
295+
if (ZEND_NUM_ARGS() != 0) {
296+
WRONG_PARAM_COUNT;
297+
}
297298

298299
/**
299300
* Make sure that we don't have more than one output buffer going on
@@ -551,7 +552,6 @@ PHP_FUNCTION(xslt_process)
551552
}
552553
/* }}} */
553554

554-
555555
/* {{{ proto resource xslt_create(void)
556556
Create a new XSL processor and return a resource identifier. */
557557
PHP_FUNCTION(xslt_create)
@@ -560,8 +560,9 @@ PHP_FUNCTION(xslt_create)
560560
SablotHandle p;
561561
int ret;
562562

563-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
564-
return;
563+
if (ZEND_NUM_ARGS() != 0) {
564+
WRONG_PARAM_COUNT;
565+
}
565566

566567
ret = SablotCreateProcessor(&p);
567568

0 commit comments

Comments
 (0)