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/sqlite | |
| parent | ca4c55ad3a673257925bd9b458683c4f0e60e755 (diff) | |
| download | php-git-4b4d634cb956de1efc13c8ed9b243fe1a85f783b.tar.gz | |
MFH: Added macros for managing zval refcounts and is_ref statuses
Diffstat (limited to 'ext/sqlite')
| -rw-r--r-- | ext/sqlite/sqlite.c | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 6ead6c0302..eefab54cac 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -628,7 +628,7 @@ static void php_sqlite_agg_step_function_callback(sqlite_func *func, int argc, c  	if (*context_p == NULL) {  		MAKE_STD_ZVAL(*context_p); -		(*context_p)->is_ref = 1; +		Z_SET_ISREF_PP(context_p);  		Z_TYPE_PP(context_p) = IS_NULL;  	} @@ -899,8 +899,8 @@ static zval * sqlite_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)  	}  	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;  } @@ -1016,7 +1016,7 @@ zend_object_iterator *sqlite_get_iterator(zend_class_entry *ce, zval *object, in  	if (by_ref) {  		zend_error(E_RECOVERABLE_ERROR, "An iterator cannot be used with foreach by reference");  	} -	object->refcount++; +	Z_ADDREF_P(object);  	iterator->it.data = (void*)object;  	iterator->it.funcs = ce->iterator_funcs.funcs;  	iterator->res = obj->u.res; @@ -1858,7 +1858,7 @@ static void php_sqlite_fetch_array(struct php_sqlite_result *res, int mode, zend  		if (mode & PHPSQLITE_NUM) {  			if (mode & PHPSQLITE_ASSOC) {  				add_index_zval(return_value, j, decoded); -				ZVAL_ADDREF(decoded); +				Z_ADDREF_P(decoded);  				add_assoc_zval(return_value, (char*)colnames[j], decoded);  			} else {  				add_next_index_zval(return_value, decoded);  | 
