]> granicus.if.org Git - php/commitdiff
Track down a few more functions that don't check for 0 args and use
authorRasmus Lerdorf <rasmus@php.net>
Mon, 13 Aug 2001 07:55:39 +0000 (07:55 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Mon, 13 Aug 2001 07:55:39 +0000 (07:55 +0000)
faster mechanism

17 files changed:
ext/curl/curl.c
ext/db/db.c
ext/domxml/php_domxml.c
ext/fdf/fdf.c
ext/gd/gd.c
ext/hyperwave/hw.c
ext/interbase/interbase.c
ext/mhash/mhash.c
ext/odbc/php_odbc.c
ext/sablot/sablot.c
ext/session/session.c
ext/snmp/snmp.c
ext/sockets/sockets.c
ext/standard/basic_functions.c
ext/standard/head.c
ext/standard/info.c
ext/standard/rand.c

index 21c2641111d336bb4de6c94c80d2206001f38b72..6e97eaafca6864296519c35a3032995156dedbfc 100644 (file)
@@ -504,8 +504,9 @@ static void curl_free_slist(void **slist)
    Return the CURL version string. */
 PHP_FUNCTION(curl_version)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_STRING(curl_version(), 1);
 }
index cf0712da7186d294444b7cfb3ef6e10b5aec5658..6ea3bdb83a663baf302307611a6ba2432b44d661 100644 (file)
@@ -252,8 +252,9 @@ PHP_MINFO_FUNCTION(db)
    Describes the dbm-compatible library being used */ 
 PHP_FUNCTION(dblist)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        char *str = php_get_info_db();
        RETURN_STRING(str, 1);
index d1a3042a119e73658a978deba2cac71f4ebd6a95..10a0849c6034ff6bca4d996346cd1ba364ade247 100644 (file)
@@ -2432,8 +2432,9 @@ PHP_FUNCTION(xmltree)
    Initializing XPath environment */
 PHP_FUNCTION(xpath_init)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        xmlXPathInit();
        RETURN_TRUE;
index f09b7433da071a3a85df00a3b4bade67701e1b3c..08a9d00563b05fc992d208825452c243ddcdaa74 100644 (file)
@@ -209,8 +209,9 @@ PHP_FUNCTION(fdf_create)
        FDFDoc fdf;
        FDFErc err;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        err = FDFCreate(&fdf);
 
index e00f3c26e78a2d79efe97feb4294b724d6cbefa1..a0a96742d30519367c7db482bac8c5c5398c2398 100644 (file)
@@ -931,8 +931,9 @@ PHP_FUNCTION(imagetypes)
 #ifdef HAVE_GD_XPM
        ret |= 16;
 #endif
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_LONG(ret);
 }
index a00e1c7fa3f0ae809a40f2636e7d3e218fbc5eac..077a7ae263c5557f1072820bc6254da0564186bb 100644 (file)
@@ -1331,8 +1331,9 @@ PHP_FUNCTION(hw_errormsg)
    Returns object id of root collection */
 PHP_FUNCTION(hw_root)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        return_value->value.lval = 0;
        return_value->type = IS_LONG;
index 0ed2c2412a973e42dd53284f3e2430754b45e78d..05d66f1decf05f8145bffe2d805e83c5196dba65 100644 (file)
@@ -236,8 +236,9 @@ typedef struct {
    Return error message */
 PHP_FUNCTION(ibase_errmsg)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        if (IBG(errmsg[0])) {
                RETURN_STRING(IBG(errmsg), 1);
index d6ad84c7cfe7c24d43dfd6d3398543dced20ac0f..68950f9bfcf4369e222b8c6b69a19be0b3072064 100644 (file)
@@ -83,8 +83,9 @@ static PHP_MINIT_FUNCTION(mhash)
    Gets the number of available hashes */
 PHP_FUNCTION(mhash_count)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_LONG(mhash_count());
 }
index 951e35a1618b952bd363c0dfec50ac4cd199821d..14dc9093a17b94630ffc2ca751cffd087f04d256 100644 (file)
@@ -711,8 +711,9 @@ PHP_FUNCTION(odbc_close_all)
        int i;
        int nument;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return; 
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        nument = zend_hash_next_free_element(&EG(regular_list));
        
index 3d1a73609fcf336032c400a099822396ac551e76..228b52e2980ba98909790271b49a85a5d1b4eaf9 100644 (file)
@@ -292,8 +292,9 @@ PHP_FUNCTION(xslt_output_endtransform)
          *buffer = NULL;
     int ret = 0;
    
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
     /** 
      * Make sure that we don't have more than one output buffer going on
@@ -551,7 +552,6 @@ PHP_FUNCTION(xslt_process)
 }
 /* }}} */
 
-
 /* {{{ proto resource xslt_create(void)
    Create a new XSL processor and return a resource identifier. */
 PHP_FUNCTION(xslt_create)
@@ -560,8 +560,9 @@ PHP_FUNCTION(xslt_create)
     SablotHandle p;
     int ret;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
     ret = SablotCreateProcessor(&p);
     
index 7ed6ad84d97f96d71902b922fbb479e146cd04cc..491b58f31816e8d99d3ec65f3bf1c330767c9d8d 100644 (file)
@@ -1229,8 +1229,9 @@ PHP_FUNCTION(session_encode)
        int len;
        char *enc;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        enc = php_session_encode(&len TSRMLS_CC);
        RETVAL_STRINGL(enc, len, 0);
@@ -1266,8 +1267,9 @@ PHP_FUNCTION(session_start)
    Destroy the current session and all data associated with it */
 PHP_FUNCTION(session_destroy)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        if (php_session_destroy(TSRMLS_C) == SUCCESS) {
                RETURN_TRUE;
index 56c87e4dc49416cc43e0804b266eda3d9949a33d..810642bb1d5f3e5d3afbed1cf2c0eb51c6c28e77 100644 (file)
@@ -402,8 +402,9 @@ PHP_FUNCTION(snmprealwalk)
    Return the current status of quick_print */
 PHP_FUNCTION(snmp_get_quick_print)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_LONG(snmp_get_quick_print() ? 1 : 0);
 }
@@ -418,6 +419,7 @@ PHP_FUNCTION(snmp_set_quick_print)
 
        if (zend_parse_parameters(argc, "l", &a1) == FAILURE)
                return;
+
        snmp_set_quick_print((int)a1);
 }
 /* }}} */
index d8629f0b42e34bd19d8dee714d8013825040959a..49963044ef6b5b5b7844f1e0193d184486e24993 100644 (file)
@@ -397,8 +397,9 @@ PHP_FUNCTION(socket_fd_alloc)
 {
        php_fd_set *php_fd;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        php_fd = (php_fd_set*)emalloc(sizeof(php_fd_set));
 
index 17b093bf59dc22b31a1cce1efae9f43047821c7f..2fd601bf42988b09583609c203baf0cda4870e42 100644 (file)
@@ -1316,8 +1316,9 @@ PHP_FUNCTION(settype)
    Get the name of the owner of the current PHP script */
 PHP_FUNCTION(get_current_user)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_STRING(php_get_current_user(), 1);
 }
@@ -1343,7 +1344,6 @@ PHP_FUNCTION(get_cfg_var)
 }
 /* }}} */
 
-
 /* {{{ proto bool set_magic_quotes_runtime(int new_setting)
    Set the current active configuration setting of magic_quotes_runtime and return previous */
 PHP_FUNCTION(set_magic_quotes_runtime)
index 532cd7c5a6c1a317190d3ab2a70cd63ecfc372b0..38f8438f7f751fb4d24cd7af8546b069187aa303 100644 (file)
@@ -180,6 +180,10 @@ PHP_FUNCTION(setcookie)
    Return true if headers have already been sent, false otherwise */
 PHP_FUNCTION(headers_sent)
 {
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
+
        if (SG(headers_sent)) {
                RETURN_TRUE;
        } else {
index ca41591ca3b71bf25a26e7659128d5aa7761dc71..0fa5414a1d5281e9c107da1404309694490f2077 100644 (file)
@@ -476,8 +476,9 @@ PHP_FUNCTION(phpinfo)
    Return the current PHP version */
 PHP_FUNCTION(phpversion)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
     RETURN_STRING(PHP_VERSION, 1);
 }
@@ -506,8 +507,9 @@ PHP_FUNCTION(phpcredits)
    Return the special ID used to request the PHP logo in phpinfo screens*/
 PHP_FUNCTION(php_logo_guid)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1);
 }
@@ -517,8 +519,9 @@ PHP_FUNCTION(php_logo_guid)
    Return the special ID used to request the PHP logo in phpinfo screens*/
 PHP_FUNCTION(php_egg_logo_guid)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1);
 }
@@ -528,8 +531,9 @@ PHP_FUNCTION(php_egg_logo_guid)
    Return the special ID used to request the Zend logo in phpinfo screens*/
 PHP_FUNCTION(zend_logo_guid)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1);
 }
@@ -539,8 +543,9 @@ PHP_FUNCTION(zend_logo_guid)
    Return the current SAPI module name */
 PHP_FUNCTION(php_sapi_name)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        if (sapi_module.name) {
                RETURN_STRING(sapi_module.name, 1);
@@ -555,8 +560,9 @@ PHP_FUNCTION(php_sapi_name)
    Return information about the system PHP was built on */
 PHP_FUNCTION(php_uname)
 {
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE)
-               return;
+    if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
 
        RETURN_STRING(php_get_uname(), 0);
 }
index 567ee7277a4111eeb3f6d090d632753fa647b6f3..4ac3bc050730fce2429f558702ee439920f415ac 100644 (file)
@@ -329,6 +329,10 @@ PHP_FUNCTION(mt_rand)
    Returns the maximum value a random number can have */
 PHP_FUNCTION(getrandmax)
 {
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
+
        return_value->type = IS_LONG;
        return_value->value.lval = PHP_RAND_MAX;
 }
@@ -338,6 +342,10 @@ PHP_FUNCTION(getrandmax)
    Returns the maximum value a random number from Mersenne Twister can have */
 PHP_FUNCTION(mt_getrandmax)
 {
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
+
        return_value->type = IS_LONG;
        /*
         * Melo: it could be 2^^32 but we only use 2^^31 to maintain