From 4cc86259ddb76c02b871b9c4866561649d9c88e3 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Wed, 11 Jul 2001 11:35:11 +0000 Subject: Get rid of ZVAL_RESET... --- Zend/zend_operators.c | 11 ++++++----- Zend/zend_variables.h | 4 ---- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'Zend') diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 44f98938e1..32584ed23f 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -30,6 +30,7 @@ #include "zend_globals.h" #include "zend_list.h" #include "zend_fast_cache.h" +#include "zend_API.h" #if 0&&WITH_BCMATH #include "ext/bcmath/number.h" @@ -462,7 +463,7 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) break; default: zval_dtor(op); - ZVAL_RESET(op); + ZVAL_BOOL(op, 0); break; } op->type = IS_STRING; @@ -719,7 +720,7 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2) if ((op2->type == IS_LONG && op2->value.lval == 0) || (op2->type == IS_DOUBLE && op2->value.dval == 0.0)) { zend_error(E_WARNING, "Division by zero"); - ZVAL_RESET(result); + ZVAL_BOOL(result, 0); return FAILURE; /* division by zero */ } if (op1->type == IS_LONG && op2->type == IS_LONG) { @@ -758,7 +759,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2) zendi_convert_to_long(op2, op2_copy, result); if (op2->value.lval == 0) { - ZVAL_RESET(result); + ZVAL_BOOL(result, 0); return FAILURE; /* modulus by zero */ } @@ -1164,7 +1165,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2) return SUCCESS; } - ZVAL_RESET(result); + ZVAL_BOOL(result, 0); return FAILURE; } @@ -1231,7 +1232,7 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2) } break; default: - ZVAL_RESET(result); + ZVAL_BOOL(result, 0); return FAILURE; } return SUCCESS; diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index a0cd7fc357..48bb6afde3 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -54,10 +54,6 @@ ZEND_API void zval_add_ref(zval **p); #define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper #define ZVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper -#define ZVAL_RESET(var) \ - (var)->type = IS_BOOL; \ - (var)->value.lval = 0; - ZEND_API void var_uninit(zval *var); #endif -- cgit v1.2.1