From: Andi Gutmans Date: Tue, 4 Jan 2000 13:22:58 +0000 (+0000) Subject: - Change IS_UNSET -> IS_NULL X-Git-Tag: BEFORE_PRE_SHUTDOWN_REVERSE_PATCH~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdefd5da154ec567941c71d71c11b385bdd95182;p=php - Change IS_UNSET -> IS_NULL --- diff --git a/Zend/zend-parser.y b/Zend/zend-parser.y index 246a988385..3c74e9bd94 100644 --- a/Zend/zend-parser.y +++ b/Zend/zend-parser.y @@ -442,7 +442,7 @@ expr_without_variable: | T_ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); } | T_OBJECT_CAST expr { do_cast(&$$, &$2, IS_OBJECT CLS_CC); } | T_BOOL_CAST expr { do_cast(&$$, &$2, IS_BOOL CLS_CC); } - | T_UNSET_CAST expr { do_cast(&$$, &$2, IS_UNSET CLS_CC); } + | T_UNSET_CAST expr { do_cast(&$$, &$2, IS_NULL CLS_CC); } | T_EXIT exit_expr { do_exit(&$$, &$2 CLS_CC); } | '@' { do_begin_silence(&$1 CLS_CC); } expr { do_end_silence(&$1 CLS_CC); $$ = $3; } | scalar { $$ = $1; } diff --git a/Zend/zend.c b/Zend/zend.c index 5297d8ef9a..1e83925874 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -117,7 +117,7 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop return; } switch (expr->type) { - case IS_UNSET: + case IS_NULL: expr_copy->value.str.len = 0; expr_copy->value.str.val = empty_string; case IS_BOOL: @@ -339,7 +339,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /* This zval can be used to initialize allocate zval's to an uninit'ed value */ zval_used_for_init.is_ref = 0; zval_used_for_init.refcount = 1; - zval_used_for_init.type = IS_UNSET; + zval_used_for_init.type = IS_NULL; #ifdef ZTS global_constants_table = NULL; diff --git a/Zend/zend.h b/Zend/zend.h index dff61e48d9..c5dd865833 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -204,7 +204,7 @@ typedef struct _zend_utility_values { /* data types */ -#define IS_UNSET 0 +#define IS_NULL 0 #define IS_LONG 1 #define IS_DOUBLE 2 #define IS_STRING 3 diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 6822e299b2..b34ddce287 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -247,7 +247,7 @@ ZEND_API inline int add_assoc_unset(zval *arg, char *key) zval *tmp; ALLOC_ZVAL(tmp); - tmp->type = IS_UNSET; + tmp->type = IS_NULL; INIT_PZVAL(tmp); return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL); } @@ -339,7 +339,7 @@ ZEND_API inline int add_index_unset(zval *arg, uint index) zval *tmp; ALLOC_ZVAL(tmp); - tmp->type = IS_UNSET; + tmp->type = IS_NULL; INIT_PZVAL(tmp); return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *), NULL); } @@ -432,7 +432,7 @@ ZEND_API inline int add_next_index_unset(zval *arg) zval *tmp; ALLOC_ZVAL(tmp); - tmp->type = IS_UNSET; + tmp->type = IS_NULL; INIT_PZVAL(tmp); return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL); } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 1773ef8b13..ac0e4383bf 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -151,7 +151,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, return_value->value.lval = b; \ } #define RETVAL_NULL() { \ - return_value->type = IS_UNSET; \ + return_value->type = IS_NULL; \ } #define RETVAL_LONG(l) { \ return_value->type = IS_LONG; \ @@ -190,7 +190,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, } #define RETURN_NULL() { \ - return_value->type = IS_UNSET; \ + return_value->type = IS_NULL; \ return; \ } diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 2303316450..2dbe69b914 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -325,7 +325,7 @@ ZEND_FUNCTION(define) case IS_STRING: case IS_BOOL: case IS_RESOURCE: - case IS_UNSET: + case IS_NULL: break; default: zend_error(E_WARNING,"Constants may only evaluate to scalar values"); diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 69d08c3428..6ac7a25fbd 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -132,7 +132,7 @@ void zend_register_standard_constants(ELS_D) c.name = zend_strndup(ZEND_STRL("NULL")); c.name_len = sizeof("NULL"); - c.value.type = IS_UNSET; + c.value.type = IS_NULL; zend_register_constant(&c ELS_CC); } } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 0f8e602f65..087ee6a95d 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -538,7 +538,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, znode *op int offset_key_length; switch (dim->type) { - case IS_UNSET: + case IS_NULL: offset_key = ""; offset_key_length = 0; goto fetch_string_dim; @@ -665,7 +665,7 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode return; } - if (container->type == IS_UNSET) { + if (container->type == IS_NULL) { switch (type) { case BP_VAR_RW: case BP_VAR_W: @@ -704,7 +704,7 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode SEPARATE_ON_READ_OBJECT(*retval, type); SELECTIVE_PZVAL_LOCK(**retval, result); break; - case IS_UNSET: + case IS_NULL: /* for read-mode only */ get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R); *retval = &EG(uninitialized_zval_ptr); @@ -1956,7 +1956,7 @@ send_by_ref: zendi_zval_copy_ctor(*result); } switch (opline->op2.u.constant.type) { - case IS_UNSET: + case IS_NULL: convert_to_unset(result); break; case IS_BOOL: @@ -2171,7 +2171,7 @@ send_by_ref: isset = 1; } } else if (*var==EG(uninitialized_zval_ptr) - || ((*var)->type == IS_UNSET)) { + || ((*var)->type == IS_NULL)) { isset = 0; } else { isset = 1; diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 7bcd211e96..2cc1c70c0c 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -225,7 +225,7 @@ ZEND_API inline int i_zend_is_true(zval *op) int result; switch (op->type) { - case IS_UNSET: + case IS_NULL: result = 0; break; case IS_LONG: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 7019014831..38c54a242d 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -60,7 +60,7 @@ ZEND_API void convert_scalar_to_number(zval *op) STR_FREE(strval); } else if (op->type==IS_BOOL || op->type==IS_RESOURCE) { op->type = IS_LONG; - } else if (op->type==IS_UNSET) { + } else if (op->type==IS_NULL) { op->type = IS_LONG; op->value.lval = 0; } @@ -87,7 +87,7 @@ ZEND_API void convert_scalar_to_number(zval *op) (holder).value.lval = (op)->value.lval; \ (holder).type = IS_LONG; \ (op) = &(holder); \ - } else if ((op)->type==IS_UNSET) { \ + } else if ((op)->type==IS_NULL) { \ (holder).value.lval = 0; \ (holder).type = IS_LONG; \ (op) = &(holder); \ @@ -104,7 +104,7 @@ ZEND_API void convert_scalar_to_number(zval *op) (op) = &(holder); \ } else if ((op)->type != IS_LONG) { \ switch ((op)->type) { \ - case IS_UNSET: \ + case IS_NULL: \ (holder).value.lval = 0; \ break; \ case IS_DOUBLE: \ @@ -134,7 +134,7 @@ ZEND_API void convert_scalar_to_number(zval *op) convert_to_boolean(op); \ } else if ((op)->type != IS_BOOL) { \ switch ((op)->type) { \ - case IS_UNSET: \ + case IS_NULL: \ (holder).value.lval = 0; \ break; \ case IS_RESOURCE: \ @@ -179,7 +179,7 @@ ZEND_API void convert_to_long_base(zval *op, int base) long tmp; switch (op->type) { - case IS_UNSET: + case IS_NULL: op->value.lval = 0; break; case IS_RESOURCE: @@ -221,7 +221,7 @@ ZEND_API void convert_to_double(zval *op) double tmp; switch (op->type) { - case IS_UNSET: + case IS_NULL: op->value.dval = 0.0; break; case IS_RESOURCE: @@ -260,7 +260,7 @@ ZEND_API void convert_to_double(zval *op) ZEND_API void convert_to_unset(zval *op) { zval_dtor(op); - op->type = IS_UNSET; + op->type = IS_NULL; } @@ -272,7 +272,7 @@ ZEND_API void convert_to_boolean(zval *op) switch (op->type) { case IS_BOOL: break; - case IS_UNSET: + case IS_NULL: op->value.lval = 0; break; case IS_RESOURCE: @@ -319,7 +319,7 @@ ZEND_API void convert_to_string(zval *op) ELS_FETCH(); switch (op->type) { - case IS_UNSET: + case IS_NULL: op->value.str.val = empty_string; op->value.str.len = 0; break; @@ -915,7 +915,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2) } if (op1->type == IS_BOOL || op2->type == IS_BOOL - || op1->type == IS_UNSET || op2->type == IS_UNSET) { + || op1->type == IS_NULL || op2->type == IS_NULL) { zendi_convert_to_boolean(op1, op1_copy, result); zendi_convert_to_boolean(op2, op2_copy, result); result->type = IS_LONG; @@ -954,8 +954,8 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2) return SUCCESS; } switch (op1->type) { - case IS_UNSET: - result->value.lval = (op2->type==IS_UNSET); + case IS_NULL: + result->value.lval = (op2->type==IS_NULL); return SUCCESS; break; case IS_BOOL: @@ -1154,7 +1154,7 @@ ZEND_API int increment_function(zval *op1) case IS_DOUBLE: op1->value.dval = op1->value.dval + 1; break; - case IS_UNSET: + case IS_NULL: op1->value.lval = 1; op1->type = IS_LONG; break; diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 71a9861345..ae795524cd 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -48,7 +48,7 @@ ZEND_API inline void var_reset(zval *var) ZEND_API inline void var_uninit(zval *var) { - var->type = IS_UNSET; + var->type = IS_NULL; } @@ -82,7 +82,7 @@ ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC) case IS_LONG: case IS_DOUBLE: case IS_BOOL: - case IS_UNSET: + case IS_NULL: default: return 1; break; @@ -115,7 +115,7 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) break; case IS_BOOL: case IS_LONG: - case IS_UNSET: + case IS_NULL: break; case IS_STRING: if (zvalue->value.str.val) { diff --git a/ext/standard/array.c b/ext/standard/array.c index ffcb483fc6..5f29f0546b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -246,7 +246,7 @@ PHP_FUNCTION(count) } target_hash = HASH_OF(*array); if (!target_hash) { - if ((*array)->type == IS_UNSET) { + if ((*array)->type == IS_NULL) { RETURN_LONG(0); } else { RETURN_LONG(1); diff --git a/ext/standard/var.c b/ext/standard/var.c index 9123156134..eb81332d56 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -48,7 +48,7 @@ void php_var_dump(pval **struc, int level) PHPWRITE(&buf[1], i - 1); break; - case IS_UNSET: + case IS_NULL: i = sprintf(buf, "%*cNULL\n", level, ' '); PHPWRITE(&buf[1], i - 1); break; @@ -203,7 +203,7 @@ void php_var_serialize(pval *buf, pval **struc) STR_CAT(buf, s, slen); return; - case IS_UNSET: + case IS_NULL: STR_CAT(buf, "N;", 2); return; @@ -311,7 +311,7 @@ int php_var_unserialize(pval **rval, const char **p, const char *max) } (*p)++; INIT_PZVAL(*rval); - (*rval)->type = IS_UNSET; + (*rval)->type = IS_NULL; (*p)++; return 1;