diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-04-30 18:32:42 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-04-30 18:32:42 +0400 |
commit | 17d027ed47c1f07b397a611431d28ad0e0107146 (patch) | |
tree | da6cadcd3ca0cad02dd4ff39f027575070873cbd /Zend/zend_API.c | |
parent | 6a911e833f6b6dcac669a60808e96dc2c4f391d3 (diff) | |
download | php-git-17d027ed47c1f07b397a611431d28ad0e0107146.tar.gz |
Split IS_BOOL into IS_FALSE and IS_TRUE
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 60ef092bb1..6c023f474d 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -201,7 +201,8 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D) /* {{{ */ ZEND_API char *zend_get_type_by_const(int type) /* {{{ */ { switch(type) { - case IS_BOOL: + case IS_FALSE: + case IS_TRUE: return "boolean"; case IS_LONG: return "integer"; @@ -408,8 +409,9 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons } } case IS_NULL: + case IS_FALSE: + case IS_TRUE: case IS_LONG: - case IS_BOOL: convert_to_long_ex(arg); *p = Z_LVAL_P(arg); break; @@ -447,9 +449,10 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons break; case IS_NULL: + case IS_FALSE: + case IS_TRUE: case IS_LONG: case IS_DOUBLE: - case IS_BOOL: convert_to_double_ex(arg); *p = Z_DVAL_P(arg); break; @@ -480,7 +483,8 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons case IS_STRING: case IS_LONG: case IS_DOUBLE: - case IS_BOOL: + case IS_FALSE: + case IS_TRUE: convert_to_string_ex(arg); if (UNEXPECTED(Z_ISREF_P(arg))) { /* it's dangerous to return pointers to string @@ -525,7 +529,8 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons case IS_STRING: case IS_LONG: case IS_DOUBLE: - case IS_BOOL: + case IS_FALSE: + case IS_TRUE: convert_to_string_ex(arg); if (UNEXPECTED(Z_ISREF_P(arg))) { /* it's dangerous to return pointers to string @@ -563,9 +568,10 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons case IS_STRING: case IS_LONG: case IS_DOUBLE: - case IS_BOOL: + case IS_FALSE: + case IS_TRUE: convert_to_boolean_ex(arg); - *p = Z_BVAL_P(arg); + *p = Z_TYPE_P(arg) == IS_TRUE; break; case IS_ARRAY: @@ -1641,7 +1647,12 @@ ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC) zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_RES_HANDLE_P(key), Z_RES_HANDLE_P(key)); result = zend_hash_index_update(ht, Z_RES_HANDLE_P(key), value); break; - case IS_BOOL: + case IS_FALSE: + result = zend_hash_index_update(ht, 0, value); + break; + case IS_TRUE: + result = zend_hash_index_update(ht, 1, value); + break; case IS_LONG: result = zend_hash_index_update(ht, Z_LVAL_P(key), value); break; @@ -3954,8 +3965,9 @@ static int same_zval(zval *zv1, zval *zv2) /* {{{ */ switch (Z_TYPE_P(zv1)) { case IS_UNDEF: case IS_NULL: + case IS_FALSE: + case IS_TRUE: return 1; - case IS_BOOL: case IS_LONG: return Z_LVAL_P(zv1) == Z_LVAL_P(zv2); case IS_DOUBLE: |