summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>1999-12-24 15:22:11 +0000
committerAndi Gutmans <andi@php.net>1999-12-24 15:22:11 +0000
commit62b2087a84018cf19e569b0256f2c3cbf4179470 (patch)
tree7afcdb49f6d58999e087be706391269d9bb90d32 /Zend/zend_API.c
parent946df29029be9eb9c4d09696e706dab99e7d8e50 (diff)
downloadphp-git-62b2087a84018cf19e569b0256f2c3cbf4179470.tar.gz
- Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use
them.
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index e0d51cf554..70f891835f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -58,7 +58,7 @@ ZEND_API int zend_get_parameters(int ht, int param_count,...)
if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) {
zval *new_tmp;
- new_tmp = (zval *) emalloc(sizeof(zval));
+ new_tmp = ALLOC_ZVAL();
*new_tmp = *param_ptr;
zval_copy_ctor(new_tmp);
INIT_PZVAL(new_tmp);
@@ -95,7 +95,7 @@ ZEND_API int zend_get_parameters_array(int ht, int param_count, zval **argument_
if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) {
zval *new_tmp;
- new_tmp = (zval *) emalloc(sizeof(zval));
+ new_tmp = ALLOC_ZVAL();
*new_tmp = *param_ptr;
zval_copy_ctor(new_tmp);
INIT_PZVAL(new_tmp);
@@ -230,7 +230,7 @@ ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)
ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_LONG;
tmp->value.lval = n;
@@ -241,7 +241,7 @@ ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
ZEND_API inline int add_assoc_bool(zval *arg, char *key, int b)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_BOOL;
tmp->value.lval = b;
@@ -252,7 +252,7 @@ ZEND_API inline int add_assoc_bool(zval *arg, char *key, int b)
ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
@@ -263,7 +263,7 @@ ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
@@ -274,7 +274,7 @@ ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
ZEND_API inline int add_assoc_string(zval *arg, char *key, char *str, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
@@ -290,7 +290,7 @@ ZEND_API inline int add_assoc_string(zval *arg, char *key, char *str, int duplic
ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = length;
@@ -306,7 +306,7 @@ ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint leng
ZEND_API inline int add_index_long(zval *arg, uint index, long n)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_LONG;
tmp->value.lval = n;
@@ -317,7 +317,7 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_BOOL;
tmp->value.lval = b;
@@ -328,7 +328,7 @@ ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
@@ -339,7 +339,7 @@ ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
ZEND_API inline int add_index_double(zval *arg, uint index, double d)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
@@ -350,7 +350,7 @@ ZEND_API inline int add_index_double(zval *arg, uint index, double d)
ZEND_API inline int add_index_string(zval *arg, uint index, char *str, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
@@ -366,7 +366,7 @@ ZEND_API inline int add_index_string(zval *arg, uint index, char *str, int dupli
ZEND_API inline int add_index_stringl(zval *arg, uint index, char *str, uint length, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = length;
@@ -382,7 +382,7 @@ ZEND_API inline int add_index_stringl(zval *arg, uint index, char *str, uint len
ZEND_API inline int add_next_index_long(zval *arg, long n)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_LONG;
tmp->value.lval = n;
@@ -393,7 +393,7 @@ ZEND_API inline int add_next_index_long(zval *arg, long n)
ZEND_API inline int add_next_index_bool(zval *arg, int b)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_BOOL;
tmp->value.lval = b;
@@ -404,7 +404,7 @@ ZEND_API inline int add_next_index_bool(zval *arg, int b)
ZEND_API inline int add_next_index_resource(zval *arg, int r)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
@@ -415,7 +415,7 @@ ZEND_API inline int add_next_index_resource(zval *arg, int r)
ZEND_API inline int add_next_index_double(zval *arg, double d)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
@@ -426,7 +426,7 @@ ZEND_API inline int add_next_index_double(zval *arg, double d)
ZEND_API inline int add_next_index_string(zval *arg, char *str, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
@@ -442,7 +442,7 @@ ZEND_API inline int add_next_index_string(zval *arg, char *str, int duplicate)
ZEND_API inline int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = length;
@@ -458,7 +458,7 @@ ZEND_API inline int add_next_index_stringl(zval *arg, char *str, uint length, in
ZEND_API inline int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
@@ -474,7 +474,7 @@ ZEND_API inline int add_get_assoc_string(zval *arg, char *key, char *str, void *
ZEND_API inline int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = length;
@@ -490,7 +490,7 @@ ZEND_API inline int add_get_assoc_stringl(zval *arg, char *key, char *str, uint
ZEND_API inline int add_get_index_long(zval *arg, uint index, long l, void **dest)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_LONG;
tmp->value.lval = l;
@@ -501,7 +501,7 @@ ZEND_API inline int add_get_index_long(zval *arg, uint index, long l, void **des
ZEND_API inline int add_get_index_double(zval *arg, uint index, double d, void **dest)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_DOUBLE;
tmp->value.dval= d;
@@ -512,7 +512,7 @@ ZEND_API inline int add_get_index_double(zval *arg, uint index, double d, void *
ZEND_API inline int add_get_index_string(zval *arg, uint index, char *str, void **dest, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
@@ -528,7 +528,7 @@ ZEND_API inline int add_get_index_string(zval *arg, uint index, char *str, void
ZEND_API inline int add_get_index_stringl(zval *arg, uint index, char *str, uint length, void **dest, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = length;
@@ -544,7 +544,7 @@ ZEND_API inline int add_get_index_stringl(zval *arg, uint index, char *str, uint
ZEND_API inline int add_property_long(zval *arg, char *key, long n)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_LONG;
tmp->value.lval = n;
@@ -554,7 +554,7 @@ ZEND_API inline int add_property_long(zval *arg, char *key, long n)
ZEND_API inline int add_property_resource(zval *arg, char *key, long n)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_RESOURCE;
tmp->value.lval = n;
@@ -565,7 +565,7 @@ ZEND_API inline int add_property_resource(zval *arg, char *key, long n)
ZEND_API inline int add_property_double(zval *arg, char *key, double d)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
@@ -576,7 +576,7 @@ ZEND_API inline int add_property_double(zval *arg, char *key, double d)
ZEND_API inline int add_property_string(zval *arg, char *key, char *str, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
@@ -592,7 +592,7 @@ ZEND_API inline int add_property_string(zval *arg, char *key, char *str, int dup
ZEND_API inline int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate)
{
- zval *tmp = (zval *) emalloc(sizeof(zval));
+ zval *tmp = ALLOC_ZVAL();
tmp->type = IS_STRING;
tmp->value.str.len = length;