summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorYiduo (David) Wang <davidw@php.net>2007-10-07 05:15:07 +0000
committerYiduo (David) Wang <davidw@php.net>2007-10-07 05:15:07 +0000
commit95da0dc5700ee9d41f1e5664c8167cd37023dbd3 (patch)
treee4c6288af1a3f260bbd705c83c397741233d60ea /ext/mysqli/mysqli.c
parentd20f6ecac8e2db5b0595c4fdef4cae221594ab88 (diff)
downloadphp-git-95da0dc5700ee9d41f1e5664c8167cd37023dbd3.tar.gz
Added macros for managing zval refcounts and is_ref statuses
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 5a0b3ec427..fd8b7f8244 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -354,7 +354,7 @@ zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC)
ret = hnd->read_func(obj, &retval TSRMLS_CC);
if (ret == SUCCESS) {
/* ensure we're creating a temporary variable */
- retval->refcount = 0;
+ Z_SET_REFCOUNT_P(retval, 0);
} else {
retval = EG(uninitialized_zval_ptr);
}
@@ -394,8 +394,8 @@ void mysqli_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
}
if (ret == SUCCESS) {
hnd->write_func(obj, value TSRMLS_CC);
- if (! PZVAL_IS_REF(value) && value->refcount == 0) {
- value->refcount++;
+ if (! PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) {
+ Z_ADDREF_P(value);
zval_ptr_dtor(&value);
}
} else {
@@ -1108,7 +1108,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
if (fetchtype & MYSQLI_ASSOC) {
if (fetchtype & MYSQLI_NUM) {
- ZVAL_ADDREF(res);
+ Z_ADDREF_P(res);
}
if (UG(unicode)) {
UChar *ustr;