]> granicus.if.org Git - php/commitdiff
- Change IS_UNSET -> IS_NULL
authorAndi Gutmans <andi@php.net>
Tue, 4 Jan 2000 13:22:58 +0000 (13:22 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 4 Jan 2000 13:22:58 +0000 (13:22 +0000)
13 files changed:
Zend/zend-parser.y
Zend/zend.c
Zend/zend.h
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_constants.c
Zend/zend_execute.c
Zend/zend_execute_API.c
Zend/zend_operators.c
Zend/zend_variables.c
ext/standard/array.c
ext/standard/var.c

index 246a988385311ae57f05d0cf0bf747fde91deed4..3c74e9bd9424fb7ad8ef219b1760aca7825f0e59 100644 (file)
@@ -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; }
index 5297d8ef9aa7303f1e402f971ececcee6518a988..1e83925874e7c99622ec06cf103f805e7d978c5a 100644 (file)
@@ -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;
index dff61e48d97c4433a7ebdad3aa4a49c644664c3c..c5dd865833d6d064812eb3662d2e982ebebd9abb 100644 (file)
@@ -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
index 6822e299b2f002b0dbe3052b348773ce60b60418..b34ddce28717ce3b03a09037c20d6bb228f81eeb 100644 (file)
@@ -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);
 }
index 1773ef8b134a6f671479d6ac76479f274088945f..ac0e4383bf87f7b241e63a2c3777d62680af7732 100644 (file)
@@ -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;                                                 \
        }
 
index 2303316450050895dfde8b77dda4aa97009a0ef1..2dbe69b91417dc54f7a31afdaaa398edb134450e 100644 (file)
@@ -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");
index 69d08c34281491595400652b4368c56d8f3a74e5..6ac7a25fbda4fe256bfad9696235a4baa500bfaa 100644 (file)
@@ -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);
        }
 }
index 0f8e602f6547104a97da45640f9fa738ce2033f3..087ee6a95de83809686edb09247ad04318e5f6e0 100644 (file)
@@ -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;
index 7bcd211e96ef0970c1d184053d4c4538fca73745..2cc1c70c0c8048c1d7f7638f7957bb279e97b8c3 100644 (file)
@@ -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:
index 7019014831b8aebf3945f066deadee0f77d79d3d..38c54a242d326ca0a6dd58f096cd57a91f486822 100644 (file)
@@ -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;
index 71a98613452ac9e75e133d2caa9f355917ad9044..ae795524cd73ec299db143ec470322fed6685a8b 100644 (file)
@@ -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) {
index ffcb483fc691aabf72582df4717085fedf971163..5f29f0546b71e6e94eea9cafba9cda94e1b44256 100644 (file)
@@ -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);
index 9123156134a6523b492a6a7246f99591b01811d8..eb81332d567fbf890157eaf630f5aeef5a50dbe8 100644 (file)
@@ -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;