summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c53
1 files changed, 16 insertions, 37 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index d1f2d553fc..29b2ed79b8 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -285,7 +285,7 @@ static zend_always_inline zend_result zendi_try_convert_scalar_to_number(zval *o
}
/* }}} */
-static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, zend_bool *failed) /* {{{ */
+static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, bool *failed) /* {{{ */
{
*failed = 0;
switch (Z_TYPE_P(op)) {
@@ -377,7 +377,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, ze
#define convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, opcode, sigil) \
do { \
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { \
- zend_bool failed; \
+ bool failed; \
if (Z_ISREF_P(op1)) { \
op1 = Z_REFVAL_P(op1); \
if (Z_TYPE_P(op1) == IS_LONG) { \
@@ -400,7 +400,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, ze
} while (0); \
do { \
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { \
- zend_bool failed; \
+ bool failed; \
if (Z_ISREF_P(op2)) { \
op2 = Z_REFVAL_P(op2); \
if (Z_TYPE_P(op2) == IS_LONG) { \
@@ -424,14 +424,6 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, ze
ZEND_API void ZEND_FASTCALL convert_to_long(zval *op) /* {{{ */
{
- if (Z_TYPE_P(op) != IS_LONG) {
- convert_to_long_base(op, 10);
- }
-}
-/* }}} */
-
-ZEND_API void ZEND_FASTCALL convert_to_long_base(zval *op, int base) /* {{{ */
-{
zend_long tmp;
try_again:
@@ -456,11 +448,7 @@ try_again:
case IS_STRING:
{
zend_string *str = Z_STR_P(op);
- if (base == 10) {
- ZVAL_LONG(op, zval_get_long(op));
- } else {
- ZVAL_LONG(op, ZEND_STRTOL(ZSTR_VAL(str), NULL, base));
- }
+ ZVAL_LONG(op, zval_get_long(op));
zend_string_release_ex(str, 0);
}
break;
@@ -683,7 +671,7 @@ try_again:
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL _try_convert_to_string(zval *op) /* {{{ */
+ZEND_API bool ZEND_FASTCALL _try_convert_to_string(zval *op) /* {{{ */
{
zend_string *str;
@@ -882,7 +870,7 @@ try_again:
}
/* }}} */
-static zend_always_inline zend_string* __zval_get_string_func(zval *op, zend_bool try) /* {{{ */
+static zend_always_inline zend_string* __zval_get_string_func(zval *op, bool try) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op)) {
@@ -1530,7 +1518,7 @@ ZEND_API zend_result ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1,
}
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_OR);
op1_lval = zendi_try_get_long(op1, &failed);
if (UNEXPECTED(failed)) {
@@ -1544,7 +1532,7 @@ ZEND_API zend_result ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1,
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_OR);
op2_lval = zendi_try_get_long(op2, &failed);
if (UNEXPECTED(failed)) {
@@ -1612,7 +1600,7 @@ ZEND_API zend_result ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1,
}
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_AND);
op1_lval = zendi_try_get_long(op1, &failed);
if (UNEXPECTED(failed)) {
@@ -1626,7 +1614,7 @@ ZEND_API zend_result ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1,
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_AND);
op2_lval = zendi_try_get_long(op2, &failed);
if (UNEXPECTED(failed)) {
@@ -1694,7 +1682,7 @@ ZEND_API zend_result ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1,
}
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_XOR);
op1_lval = zendi_try_get_long(op1, &failed);
if (UNEXPECTED(failed)) {
@@ -1708,7 +1696,7 @@ ZEND_API zend_result ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1,
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_XOR);
op2_lval = zendi_try_get_long(op2, &failed);
if (UNEXPECTED(failed)) {
@@ -1910,7 +1898,7 @@ ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval
}
/* }}} */
-ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, zend_bool case_insensitive) /* {{{ */
+ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, bool case_insensitive) /* {{{ */
{
zend_string *tmp_str1, *tmp_str2;
zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1);
@@ -2194,7 +2182,7 @@ static int hash_zval_identical_function(zval *z1, zval *z2) /* {{{ */
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */
+ZEND_API bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */
{
if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
return 0;
@@ -2265,7 +2253,7 @@ ZEND_API zend_result ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zv
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) /* {{{ */
+ZEND_API bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) /* {{{ */
{
uint32_t i;
ZEND_ASSERT(!(class_ce->ce_flags & ZEND_ACC_INTERFACE));
@@ -2283,7 +2271,7 @@ ZEND_API zend_bool ZEND_FASTCALL zend_class_implements_interface(const zend_clas
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce) /* {{{ */
+ZEND_API bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce) /* {{{ */
{
ZEND_ASSERT(instance_ce != ce && "Should have been checked already");
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
@@ -2954,15 +2942,6 @@ ZEND_API int ZEND_FASTCALL zend_compare_objects(zval *o1, zval *o2) /* {{{ */
}
/* }}} */
-ZEND_API void ZEND_FASTCALL zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) /* {{{ */
-{
- zend_string *str;
-
- str = zend_strpprintf(0, "%.*G", (int) EG(precision), (double)Z_DVAL_P(op));
- ZVAL_NEW_STR(op, str);
-}
-/* }}} */
-
ZEND_API zend_string* ZEND_FASTCALL zend_long_to_str(zend_long num) /* {{{ */
{
if ((zend_ulong)num <= 9) {