cvs: php4 /ext/skeleton create_stubs
| From: | Rasmus Lerdorf | Date: | Mon, 13 Aug 2001 08:15:17 +0000 |
| Subject: | cvs: php4 /ext/skeleton create_stubs | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6775@lists.php.net to get a copy of this message | ||
rasmus Mon Aug 13 04:15:17 2001 EDT
Modified files:
/php4/ext/skeleton create_stubs
Log:
Faster wrong_param check for functions that take no parameters
Index: php4/ext/skeleton/create_stubs
diff -u php4/ext/skeleton/create_stubs:1.18 php4/ext/skeleton/create_stubs:1.19
--- php4/ext/skeleton/create_stubs:1.18 Sat Aug 11 23:46:25 2001
+++ php4/ext/skeleton/create_stubs Mon Aug 13 04:15:12 2001
@@ -178,13 +178,12 @@
" <funcprototype>\n" \
" <funcdef>" types[i] " <function>" funcs[i]
"</function></funcdef>\n"
- fetchargs = "\tif (zend_parse_parameters("
- if (spec_opts[i]) {
+ if (maxargs[i]>0) {
+ fetchargs = "\tif (zend_parse_parameters("
ints = ints "\tint argc = ZEND_NUM_ARGS();\n"
- fetchargs = fetchargs "argc"
+ fetchargs = fetchargs "argc, " specs[i]
} else
- fetchargs = fetchargs "ZEND_NUM_ARGS()"
- fetchargs = fetchargs ", " specs[i]
+ fetchargs = fetchargs "\tif (ZEND_NUM_ARGS() != 0) {\n\t\tWRONG_PARAM_COUNT;\n\t}"
for (j = 0; j < maxargs[i]; j++) {
@@ -219,7 +218,9 @@
}
proto = proto closeopts ")\n " fcomments[i] " */\nPHP_FUNCTION(" funcs[i]
")\n{"
- fetchargs = fetchargs ") == FAILURE)" closefetch " \n\t\treturn;\n"
+ if (maxargs[i]>0) {
+ fetchargs = fetchargs ") == FAILURE)" closefetch " \n\t\treturn;\n"
+ }
funcvals = strings ints longs doubles bools zvals
xmlstr = xmlstr xmlparams \
" </funcprototype>\n" \