]> granicus.if.org Git - php/commitdiff
Added new macro for check void parameters.
authorFelipe Pena <felipe@php.net>
Thu, 28 Feb 2008 13:30:43 +0000 (13:30 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 28 Feb 2008 13:30:43 +0000 (13:30 +0000)
(deprecating ZEND_WRONG_PARAM_COUNT for this cases)

Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_exceptions.c

index 7d0c8895a375f68bf5d6016395fd97b06ac2df4f..fc6d0638b2b83111fe84267b04aaefca32429cce 100644 (file)
@@ -194,6 +194,8 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
        _zend_get_parameters_array(ht, param_count, argument_array TSRMLS_CC)
 #define zend_get_parameters_array_ex(param_count, argument_array)                      \
        _zend_get_parameters_array_ex(param_count, argument_array TSRMLS_CC)
+#define zend_parse_parameters_none()                                                                           \
+       zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
 
 
 /* Parameter parsing API -- andrei */
index 0967a89d91cdae67cc5e8e619084d9d24f08dc1d..3e3ebec1f6c264b46c3a8bc28ca239b89e07a1e8 100644 (file)
@@ -1188,8 +1188,8 @@ ZEND_FUNCTION(get_included_files)
        unsigned int len;
        int ustr_len;
 
-       if (ZEND_NUM_ARGS() != 0) {
-               ZEND_WRONG_PARAM_COUNT();
+       if (zend_parse_parameters_none() == FAILURE) {
+               return;
        }
 
        array_init(return_value);
@@ -1402,8 +1402,8 @@ ZEND_FUNCTION(get_declared_classes)
        zend_uint mask = ZEND_ACC_INTERFACE;
        zend_uint comply = 0;
 
-       if (ZEND_NUM_ARGS() != 0) {
-               ZEND_WRONG_PARAM_COUNT();
+       if (zend_parse_parameters_none() == FAILURE) {
+               return;
        }
 
        array_init(return_value);
@@ -1418,8 +1418,8 @@ ZEND_FUNCTION(get_declared_interfaces)
        zend_uint mask = ZEND_ACC_INTERFACE;
        zend_uint comply = 1;
 
-       if (ZEND_NUM_ARGS() != 0) {
-               ZEND_WRONG_PARAM_COUNT();
+       if (zend_parse_parameters_none() == FAILURE) {
+               return;
        }
 
        array_init(return_value);
@@ -1463,8 +1463,8 @@ ZEND_FUNCTION(get_defined_functions)
        zval *internal;
        zval *user;
 
-       if (ZEND_NUM_ARGS() != 0) {
-               ZEND_WRONG_PARAM_COUNT();
+       if (zend_parse_parameters_none() == FAILURE) {
+               return;
        }
 
        MAKE_STD_ZVAL(internal);
index ba99b3bc6a47191d934a4fec9e0000380b38154a..ffcf9c6cd1e898eb023d953f1c8f121f353dc5e0 100644 (file)
@@ -197,8 +197,8 @@ ZEND_METHOD(error_exception, __construct)
 /* }}} */
 
 #define DEFAULT_0_PARAMS \
-       if (ZEND_NUM_ARGS() > 0) { \
-               ZEND_WRONG_PARAM_COUNT(); \
+       if (zend_parse_parameters_none() == FAILURE) { \
+               return; \
        }
 
 static void _default_exception_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) /* {{{ */