cvs: php4 /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 head.c info.c rand.c
| From: | Rasmus Lerdorf | Date: | Mon, 13 Aug 2001 07:55:39 +0000 |
| Subject: | cvs: php4 /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 head.c info.c rand.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6773@lists.php.net to get a copy of this message | ||
rasmus Mon Aug 13 03:55:39 2001 EDT
Modified files:
/php4/ext/curl curl.c
/php4/ext/db db.c
/php4/ext/domxml php_domxml.c
/php4/ext/fdf fdf.c
/php4/ext/gd gd.c
/php4/ext/hyperwave hw.c
/php4/ext/interbase interbase.c
/php4/ext/mhash mhash.c
/php4/ext/odbc php_odbc.c
/php4/ext/sablot sablot.c
/php4/ext/session session.c
/php4/ext/snmp snmp.c
/php4/ext/sockets sockets.c
/php4/ext/standard basic_functions.c head.c info.c rand.c
Log:
Track down a few more functions that don't check for 0 args and use
faster mechanism
Index: php4/ext/curl/curl.c diff -u php4/ext/curl/curl.c:1.78 php4/ext/curl/curl.c:1.79 --- php4/ext/curl/curl.c:1.78 Mon Aug 13 02:43:42 2001 +++ php4/ext/curl/curl.c Mon Aug 13 03:55:32 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: curl.c,v 1.78 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: curl.c,v 1.79 2001/08/13 07:55:32 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -504,8 +504,9 @@ 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: php4/ext/db/db.c diff -u php4/ext/db/db.c:1.62 php4/ext/db/db.c:1.63 --- php4/ext/db/db.c:1.62 Mon Aug 13 02:43:42 2001 +++ php4/ext/db/db.c Mon Aug 13 03:55:32 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: db.c,v 1.62 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: db.c,v 1.63 2001/08/13 07:55:32 rasmus Exp $ */ #define IS_EXT_MODULE #if 1 @@ -252,8 +252,9 @@ 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: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.56 php4/ext/domxml/php_domxml.c:1.57 --- php4/ext/domxml/php_domxml.c:1.56 Mon Aug 13 02:43:42 2001 +++ php4/ext/domxml/php_domxml.c Mon Aug 13 03:55:32 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.56 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: php_domxml.c,v 1.57 2001/08/13 07:55:32 rasmus Exp $ */ #ifdef HAVE_CONFIG_H @@ -2432,8 +2432,9 @@ 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: php4/ext/fdf/fdf.c diff -u php4/ext/fdf/fdf.c:1.58 php4/ext/fdf/fdf.c:1.59 --- php4/ext/fdf/fdf.c:1.58 Mon Aug 13 02:43:42 2001 +++ php4/ext/fdf/fdf.c Mon Aug 13 03:55:32 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fdf.c,v 1.58 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: fdf.c,v 1.59 2001/08/13 07:55:32 rasmus Exp $ */ /* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from http://beta1.adobe.com/ada/acrosdk/forms.html. */ @@ -209,8 +209,9 @@ 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: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.153 php4/ext/gd/gd.c:1.154 --- php4/ext/gd/gd.c:1.153 Mon Aug 13 02:43:43 2001 +++ php4/ext/gd/gd.c Mon Aug 13 03:55:32 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.153 2001/08/13 06:43:43 rasmus Exp $ */ +/* $Id: gd.c,v 1.154 2001/08/13 07:55:32 rasmus Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -931,8 +931,9 @@ #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: php4/ext/hyperwave/hw.c diff -u php4/ext/hyperwave/hw.c:1.93 php4/ext/hyperwave/hw.c:1.94 --- php4/ext/hyperwave/hw.c:1.93 Mon Aug 13 02:43:43 2001 +++ php4/ext/hyperwave/hw.c Mon Aug 13 03:55:33 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: hw.c,v 1.93 2001/08/13 06:43:43 rasmus Exp $ */ +/* $Id: hw.c,v 1.94 2001/08/13 07:55:33 rasmus Exp $ */ #include <stdlib.h> #include <errno.h> @@ -1331,8 +1331,9 @@ 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: php4/ext/interbase/interbase.c diff -u php4/ext/interbase/interbase.c:1.67 php4/ext/interbase/interbase.c:1.68 --- php4/ext/interbase/interbase.c:1.67 Mon Aug 13 02:43:43 2001 +++ php4/ext/interbase/interbase.c Mon Aug 13 03:55:33 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: interbase.c,v 1.67 2001/08/13 06:43:43 rasmus Exp $ */ +/* $Id: interbase.c,v 1.68 2001/08/13 07:55:33 rasmus Exp $ */ /* TODO: Arrays, roles? @@ -236,8 +236,9 @@ 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); @@ -580,7 +581,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.67 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.68 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "yes"); #endif Index: php4/ext/mhash/mhash.c diff -u php4/ext/mhash/mhash.c:1.31 php4/ext/mhash/mhash.c:1.32 --- php4/ext/mhash/mhash.c:1.31 Mon Aug 13 02:43:44 2001 +++ php4/ext/mhash/mhash.c Mon Aug 13 03:55:34 2001 @@ -83,8 +83,9 @@ 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: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.105 php4/ext/odbc/php_odbc.c:1.106 --- php4/ext/odbc/php_odbc.c:1.105 Mon Aug 13 02:43:44 2001 +++ php4/ext/odbc/php_odbc.c Mon Aug 13 03:55:34 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.105 2001/08/13 06:43:44 rasmus Exp $ */ +/* $Id: php_odbc.c,v 1.106 2001/08/13 07:55:34 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -711,8 +711,9 @@ 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: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.52 php4/ext/sablot/sablot.c:1.53 --- php4/ext/sablot/sablot.c:1.52 Mon Aug 13 02:43:45 2001 +++ php4/ext/sablot/sablot.c Mon Aug 13 03:55:35 2001 @@ -292,8 +292,9 @@ *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 @@ } /* }}} */ - /* {{{ proto resource xslt_create(void) Create a new XSL processor and return a resource identifier. */ PHP_FUNCTION(xslt_create) @@ -560,8 +560,9 @@ 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: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.236 php4/ext/session/session.c:1.237 --- php4/ext/session/session.c:1.236 Mon Aug 13 02:43:45 2001 +++ php4/ext/session/session.c Mon Aug 13 03:55:36 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.236 2001/08/13 06:43:45 rasmus Exp $ */ +/* $Id: session.c,v 1.237 2001/08/13 07:55:36 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1229,8 +1229,9 @@ 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 @@ 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: php4/ext/snmp/snmp.c diff -u php4/ext/snmp/snmp.c:1.46 php4/ext/snmp/snmp.c:1.47 --- php4/ext/snmp/snmp.c:1.46 Mon Aug 13 02:43:46 2001 +++ php4/ext/snmp/snmp.c Mon Aug 13 03:55:37 2001 @@ -17,7 +17,7 @@ | Steven Lawrance <slawrance@technologist.com> | +----------------------------------------------------------------------+ */ -/* $Id: snmp.c,v 1.46 2001/08/13 06:43:46 rasmus Exp $ */ +/* $Id: snmp.c,v 1.47 2001/08/13 07:55:37 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -402,8 +402,9 @@ 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 @@ if (zend_parse_parameters(argc, "l", &a1) == FAILURE) return; + snmp_set_quick_print((int)a1); } /* }}} */ Index: php4/ext/sockets/sockets.c diff -u php4/ext/sockets/sockets.c:1.60 php4/ext/sockets/sockets.c:1.61 --- php4/ext/sockets/sockets.c:1.60 Mon Aug 13 02:43:46 2001 +++ php4/ext/sockets/sockets.c Mon Aug 13 03:55:37 2001 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sockets.c,v 1.60 2001/08/13 06:43:46 rasmus Exp $ */ +/* $Id: sockets.c,v 1.61 2001/08/13 07:55:37 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -397,8 +397,9 @@ { 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: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.384 php4/ext/standard/basic_functions.c:1.385 --- php4/ext/standard/basic_functions.c:1.384 Mon Aug 13 02:43:47 2001 +++ php4/ext/standard/basic_functions.c Mon Aug 13 03:55:37 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.384 2001/08/13 06:43:47 rasmus Exp $ */ +/* $Id: basic_functions.c,v 1.385 2001/08/13 07:55:37 rasmus Exp $ */ #include "php.h" #include "php_main.h" @@ -1316,8 +1316,9 @@ 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); } @@ -1342,7 +1343,6 @@ RETURN_STRING(value, 1); } /* }}} */ - /* {{{ proto bool set_magic_quotes_runtime(int new_setting) Set the current active configuration setting of magic_quotes_runtime and return previous */ Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.48 php4/ext/standard/head.c:1.49 --- php4/ext/standard/head.c:1.48 Sat Aug 11 13:03:37 2001 +++ php4/ext/standard/head.c Mon Aug 13 03:55:38 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.48 2001/08/11 17:03:37 zeev Exp $ */ +/* $Id: head.c,v 1.49 2001/08/13 07:55:38 rasmus Exp $ */ #include <stdio.h> #include "php.h" @@ -180,6 +180,10 @@ 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: php4/ext/standard/info.c diff -u php4/ext/standard/info.c:1.151 php4/ext/standard/info.c:1.152 --- php4/ext/standard/info.c:1.151 Mon Aug 13 03:28:57 2001 +++ php4/ext/standard/info.c Mon Aug 13 03:55:38 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.c,v 1.151 2001/08/13 07:28:57 rasmus Exp $ */ +/* $Id: info.c,v 1.152 2001/08/13 07:55:38 rasmus Exp $ */ #include "php.h" #include "php_ini.h" @@ -476,8 +476,9 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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: php4/ext/standard/rand.c diff -u php4/ext/standard/rand.c:1.30 php4/ext/standard/rand.c:1.31 --- php4/ext/standard/rand.c:1.30 Sat Aug 11 13:03:37 2001 +++ php4/ext/standard/rand.c Mon Aug 13 03:55:38 2001 @@ -19,7 +19,7 @@ | Based on code from: Shawn Cokus <Cokus@math.washington.edu> | +----------------------------------------------------------------------+ */ -/* $Id: rand.c,v 1.30 2001/08/11 17:03:37 zeev Exp $ */ +/* $Id: rand.c,v 1.31 2001/08/13 07:55:38 rasmus Exp $ */ #include <stdlib.h> @@ -329,6 +329,10 @@ 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 @@ 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
Index: php4/ext/curl/curl.c diff -u php4/ext/curl/curl.c:1.78 php4/ext/curl/curl.c:1.79 --- php4/ext/curl/curl.c:1.78 Mon Aug 13 02:43:42 2001 +++ php4/ext/curl/curl.c Mon Aug 13 03:55:32 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: curl.c,v 1.78 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: curl.c,v 1.79 2001/08/13 07:55:32 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -504,8 +504,9 @@ 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: php4/ext/db/db.c diff -u php4/ext/db/db.c:1.62 php4/ext/db/db.c:1.63 --- php4/ext/db/db.c:1.62 Mon Aug 13 02:43:42 2001 +++ php4/ext/db/db.c Mon Aug 13 03:55:32 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: db.c,v 1.62 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: db.c,v 1.63 2001/08/13 07:55:32 rasmus Exp $ */ #define IS_EXT_MODULE #if 1 @@ -252,8 +252,9 @@ 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: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.56 php4/ext/domxml/php_domxml.c:1.57 --- php4/ext/domxml/php_domxml.c:1.56 Mon Aug 13 02:43:42 2001 +++ php4/ext/domxml/php_domxml.c Mon Aug 13 03:55:32 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.56 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: php_domxml.c,v 1.57 2001/08/13 07:55:32 rasmus Exp $ */ #ifdef HAVE_CONFIG_H @@ -2432,8 +2432,9 @@ 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: php4/ext/fdf/fdf.c diff -u php4/ext/fdf/fdf.c:1.58 php4/ext/fdf/fdf.c:1.59 --- php4/ext/fdf/fdf.c:1.58 Mon Aug 13 02:43:42 2001 +++ php4/ext/fdf/fdf.c Mon Aug 13 03:55:32 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fdf.c,v 1.58 2001/08/13 06:43:42 rasmus Exp $ */ +/* $Id: fdf.c,v 1.59 2001/08/13 07:55:32 rasmus Exp $ */ /* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from http://beta1.adobe.com/ada/acrosdk/forms.html. */ @@ -209,8 +209,9 @@ 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: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.153 php4/ext/gd/gd.c:1.154 --- php4/ext/gd/gd.c:1.153 Mon Aug 13 02:43:43 2001 +++ php4/ext/gd/gd.c Mon Aug 13 03:55:32 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.153 2001/08/13 06:43:43 rasmus Exp $ */ +/* $Id: gd.c,v 1.154 2001/08/13 07:55:32 rasmus Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -931,8 +931,9 @@ #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: php4/ext/hyperwave/hw.c diff -u php4/ext/hyperwave/hw.c:1.93 php4/ext/hyperwave/hw.c:1.94 --- php4/ext/hyperwave/hw.c:1.93 Mon Aug 13 02:43:43 2001 +++ php4/ext/hyperwave/hw.c Mon Aug 13 03:55:33 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: hw.c,v 1.93 2001/08/13 06:43:43 rasmus Exp $ */ +/* $Id: hw.c,v 1.94 2001/08/13 07:55:33 rasmus Exp $ */ #include <stdlib.h> #include <errno.h> @@ -1331,8 +1331,9 @@ 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: php4/ext/interbase/interbase.c diff -u php4/ext/interbase/interbase.c:1.67 php4/ext/interbase/interbase.c:1.68 --- php4/ext/interbase/interbase.c:1.67 Mon Aug 13 02:43:43 2001 +++ php4/ext/interbase/interbase.c Mon Aug 13 03:55:33 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: interbase.c,v 1.67 2001/08/13 06:43:43 rasmus Exp $ */ +/* $Id: interbase.c,v 1.68 2001/08/13 07:55:33 rasmus Exp $ */ /* TODO: Arrays, roles? @@ -236,8 +236,9 @@ 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); @@ -580,7 +581,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.67 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.68 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "yes"); #endif Index: php4/ext/mhash/mhash.c diff -u php4/ext/mhash/mhash.c:1.31 php4/ext/mhash/mhash.c:1.32 --- php4/ext/mhash/mhash.c:1.31 Mon Aug 13 02:43:44 2001 +++ php4/ext/mhash/mhash.c Mon Aug 13 03:55:34 2001 @@ -83,8 +83,9 @@ 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: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.105 php4/ext/odbc/php_odbc.c:1.106 --- php4/ext/odbc/php_odbc.c:1.105 Mon Aug 13 02:43:44 2001 +++ php4/ext/odbc/php_odbc.c Mon Aug 13 03:55:34 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.105 2001/08/13 06:43:44 rasmus Exp $ */ +/* $Id: php_odbc.c,v 1.106 2001/08/13 07:55:34 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -711,8 +711,9 @@ 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: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.52 php4/ext/sablot/sablot.c:1.53 --- php4/ext/sablot/sablot.c:1.52 Mon Aug 13 02:43:45 2001 +++ php4/ext/sablot/sablot.c Mon Aug 13 03:55:35 2001 @@ -292,8 +292,9 @@ *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 @@ } /* }}} */ - /* {{{ proto resource xslt_create(void) Create a new XSL processor and return a resource identifier. */ PHP_FUNCTION(xslt_create) @@ -560,8 +560,9 @@ 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: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.236 php4/ext/session/session.c:1.237 --- php4/ext/session/session.c:1.236 Mon Aug 13 02:43:45 2001 +++ php4/ext/session/session.c Mon Aug 13 03:55:36 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.236 2001/08/13 06:43:45 rasmus Exp $ */ +/* $Id: session.c,v 1.237 2001/08/13 07:55:36 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1229,8 +1229,9 @@ 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 @@ 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: php4/ext/snmp/snmp.c diff -u php4/ext/snmp/snmp.c:1.46 php4/ext/snmp/snmp.c:1.47 --- php4/ext/snmp/snmp.c:1.46 Mon Aug 13 02:43:46 2001 +++ php4/ext/snmp/snmp.c Mon Aug 13 03:55:37 2001 @@ -17,7 +17,7 @@ | Steven Lawrance <slawrance@technologist.com> | +----------------------------------------------------------------------+ */ -/* $Id: snmp.c,v 1.46 2001/08/13 06:43:46 rasmus Exp $ */ +/* $Id: snmp.c,v 1.47 2001/08/13 07:55:37 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -402,8 +402,9 @@ 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 @@ if (zend_parse_parameters(argc, "l", &a1) == FAILURE) return; + snmp_set_quick_print((int)a1); } /* }}} */ Index: php4/ext/sockets/sockets.c diff -u php4/ext/sockets/sockets.c:1.60 php4/ext/sockets/sockets.c:1.61 --- php4/ext/sockets/sockets.c:1.60 Mon Aug 13 02:43:46 2001 +++ php4/ext/sockets/sockets.c Mon Aug 13 03:55:37 2001 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sockets.c,v 1.60 2001/08/13 06:43:46 rasmus Exp $ */ +/* $Id: sockets.c,v 1.61 2001/08/13 07:55:37 rasmus Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -397,8 +397,9 @@ { 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: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.384 php4/ext/standard/basic_functions.c:1.385 --- php4/ext/standard/basic_functions.c:1.384 Mon Aug 13 02:43:47 2001 +++ php4/ext/standard/basic_functions.c Mon Aug 13 03:55:37 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.384 2001/08/13 06:43:47 rasmus Exp $ */ +/* $Id: basic_functions.c,v 1.385 2001/08/13 07:55:37 rasmus Exp $ */ #include "php.h" #include "php_main.h" @@ -1316,8 +1316,9 @@ 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); } @@ -1342,7 +1343,6 @@ RETURN_STRING(value, 1); } /* }}} */ - /* {{{ proto bool set_magic_quotes_runtime(int new_setting) Set the current active configuration setting of magic_quotes_runtime and return previous */ Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.48 php4/ext/standard/head.c:1.49 --- php4/ext/standard/head.c:1.48 Sat Aug 11 13:03:37 2001 +++ php4/ext/standard/head.c Mon Aug 13 03:55:38 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.48 2001/08/11 17:03:37 zeev Exp $ */ +/* $Id: head.c,v 1.49 2001/08/13 07:55:38 rasmus Exp $ */ #include <stdio.h> #include "php.h" @@ -180,6 +180,10 @@ 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: php4/ext/standard/info.c diff -u php4/ext/standard/info.c:1.151 php4/ext/standard/info.c:1.152 --- php4/ext/standard/info.c:1.151 Mon Aug 13 03:28:57 2001 +++ php4/ext/standard/info.c Mon Aug 13 03:55:38 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.c,v 1.151 2001/08/13 07:28:57 rasmus Exp $ */ +/* $Id: info.c,v 1.152 2001/08/13 07:55:38 rasmus Exp $ */ #include "php.h" #include "php_ini.h" @@ -476,8 +476,9 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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: php4/ext/standard/rand.c diff -u php4/ext/standard/rand.c:1.30 php4/ext/standard/rand.c:1.31 --- php4/ext/standard/rand.c:1.30 Sat Aug 11 13:03:37 2001 +++ php4/ext/standard/rand.c Mon Aug 13 03:55:38 2001 @@ -19,7 +19,7 @@ | Based on code from: Shawn Cokus <Cokus@math.washington.edu> | +----------------------------------------------------------------------+ */ -/* $Id: rand.c,v 1.30 2001/08/11 17:03:37 zeev Exp $ */ +/* $Id: rand.c,v 1.31 2001/08/13 07:55:38 rasmus Exp $ */ #include <stdlib.h> @@ -329,6 +329,10 @@ 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 @@ 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