diff options
author | Yiduo (David) Wang <davidw@php.net> | 2007-10-07 05:22:07 +0000 |
---|---|---|
committer | Yiduo (David) Wang <davidw@php.net> | 2007-10-07 05:22:07 +0000 |
commit | 4b4d634cb956de1efc13c8ed9b243fe1a85f783b (patch) | |
tree | eaa8d691de244aff3ee68fd3c23f769f02fa4446 /ext/reflection/php_reflection.c | |
parent | ca4c55ad3a673257925bd9b458683c4f0e60e755 (diff) | |
download | php-git-4b4d634cb956de1efc13c8ed9b243fe1a85f783b.tar.gz |
MFH: Added macros for managing zval refcounts and is_ref statuses
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 7319926844..139e60b9d4 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -278,8 +278,8 @@ static zval * reflection_instantiate(zend_class_entry *pce, zval *object TSRMLS_ } Z_TYPE_P(object) = IS_OBJECT; object_init_ex(object, pce); - object->refcount = 1; - object->is_ref = 1; + Z_SET_REFCOUNT_P(object, 1); + Z_SET_ISREF_P(object); return object; } @@ -2788,13 +2788,13 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue) "Class %s does not have a property named %s", ce->name, name); return; } - refcount = (*variable_ptr)->refcount; - is_ref = (*variable_ptr)->is_ref; + refcount = Z_REFCOUNT_PP(variable_ptr); + is_ref = Z_ISREF_PP(variable_ptr); zval_dtor(*variable_ptr); **variable_ptr = *value; zval_copy_ctor(*variable_ptr); - (*variable_ptr)->refcount = refcount; - (*variable_ptr)->is_ref = is_ref; + Z_SET_REFCOUNT_PP(variable_ptr, refcount); + Z_SET_ISREF_TO_PP(variable_ptr, is_ref); } /* }}} */ @@ -4031,7 +4031,7 @@ ZEND_METHOD(reflection_property, setValue) zval_dtor(*variable_ptr); (*variable_ptr)->type = value->type; (*variable_ptr)->value = value->value; - if (value->refcount > 0) { + if (Z_REFCOUNT_P(value) > 0) { zval_copy_ctor(*variable_ptr); } setter_done = 1; @@ -4040,7 +4040,7 @@ ZEND_METHOD(reflection_property, setValue) if (!setter_done) { zval **foo; - value->refcount++; + Z_ADDREF_P(value); if (PZVAL_IS_REF(value)) { SEPARATE_ZVAL(&value); } |