diff options
| author | Marcus Boerger <helly@php.net> | 2003-12-10 10:21:24 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-12-10 10:21:24 +0000 |
| commit | 47012601af708a714db28055fdbab26695ae0d7f (patch) | |
| tree | 3d6c728b534b6883a222dbc18f692bde2943dc98 /ext | |
| parent | c212ddd5ec5f85597e2c861ce82aa84cc233336a (diff) | |
| download | php-git-47012601af708a714db28055fdbab26695ae0d7f.tar.gz | |
Make these inline
Diffstat (limited to 'ext')
| -rwxr-xr-x | ext/spl/spl_engine.c | 30 | ||||
| -rwxr-xr-x | ext/spl/spl_engine.h | 23 |
2 files changed, 21 insertions, 32 deletions
diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c index ec43c6fdd9..5c29872454 100755 --- a/ext/spl/spl_engine.c +++ b/ext/spl/spl_engine.c @@ -43,36 +43,6 @@ void spl_instantiate(zend_class_entry *pce, zval **object, int alloc TSRMLS_DC) } /* }}} */ -/* {{{ spl_instantiate_arg_ex1 */ -int spl_instantiate_arg_ex1(zend_class_entry *pce, zval **retval, int alloc, zval *arg1 TSRMLS_DC) -{ - zval *tmp; - - spl_instantiate(pce, retval, alloc TSRMLS_CC); - - zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), &tmp, 1, arg1, NULL TSRMLS_CC); - if (tmp) { - zval_ptr_dtor(&tmp); - } - return 0; -} -/* }}} */ - -/* {{{ spl_instantiate_arg_ex2 */ -int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval, int alloc, zval *arg1, zval *arg2 TSRMLS_DC) -{ - zval *tmp; - - spl_instantiate(pce, retval, alloc TSRMLS_CC); - - zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), &tmp, 2, arg1, arg2 TSRMLS_CC); - if (tmp) { - zval_ptr_dtor(&tmp); - } - return 0; -} -/* }}} */ - /* {{{ spl_is_instance_of */ int spl_is_instance_of(zval **obj, zend_class_entry *ce TSRMLS_DC) { diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index 40e887e6b0..ece2297af1 100755 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -21,6 +21,7 @@ #include "php.h" #include "php_spl.h" +#include "zend_interfaces.h" /* {{{ zend_class_entry */ static inline zend_class_entry *spl_get_class_entry(zval *obj TSRMLS_DC) @@ -34,8 +35,26 @@ static inline zend_class_entry *spl_get_class_entry(zval *obj TSRMLS_DC) /* }}} */ void spl_instantiate(zend_class_entry *pce, zval **object, int alloc TSRMLS_DC); -int spl_instantiate_arg_ex1(zend_class_entry *pce, zval **retval, int alloc, zval *arg1 TSRMLS_DC); -int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval, int alloc, zval *arg1, zval *arg2 TSRMLS_DC); + +/* {{{ spl_instantiate_arg_ex1 */ +static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval **retval, int alloc, zval *arg1 TSRMLS_DC) +{ + spl_instantiate(pce, retval, alloc TSRMLS_CC); + + zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 1, arg1, NULL TSRMLS_CC); + return 0; +} +/* }}} */ + +/* {{{ spl_instantiate_arg_ex2 */ +static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval, int alloc, zval *arg1, zval *arg2 TSRMLS_DC) +{ + spl_instantiate(pce, retval, alloc TSRMLS_CC); + + zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 2, arg1, arg2 TSRMLS_CC); + return 0; +} +/* }}} */ int spl_is_instance_of(zval **obj, zend_class_entry *ce TSRMLS_DC); |
