diff options
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_operators.c | 20 | ||||
-rw-r--r-- | Zend/zend_operators.h | 2 |
2 files changed, 3 insertions, 19 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 012e95d3b2..562a0f6d54 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -605,20 +605,6 @@ try_again: } /* }}} */ -ZEND_API void ZEND_FASTCALL _convert_to_cstring(zval *op) /* {{{ */ -{ - if (Z_TYPE_P(op) == IS_DOUBLE) { - zend_string *str; - double dval = Z_DVAL_P(op); - - str = zend_strpprintf_unchecked(0, "%.*H", (int) EG(precision), dval); - ZVAL_NEW_STR(op, str); - } else { - _convert_to_string(op); - } -} -/* }}} */ - ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op) /* {{{ */ { try_again: @@ -648,8 +634,8 @@ try_again: zend_string *str; double dval = Z_DVAL_P(op); - str = zend_strpprintf(0, "%.*G", (int) EG(precision), dval); - /* %G already handles removing trailing zeros from the fractional part, yay */ + str = zend_strpprintf_unchecked(0, "%.*H", (int) EG(precision), dval); + ZVAL_NEW_STR(op, str); break; } @@ -953,7 +939,7 @@ try_again: return zend_long_to_str(Z_LVAL_P(op)); } case IS_DOUBLE: { - return zend_strpprintf(0, "%.*G", (int) EG(precision), Z_DVAL_P(op)); + return zend_strpprintf_unchecked(0, "%.*H", (int) EG(precision), Z_DVAL_P(op)); } case IS_ARRAY: zend_error(E_WARNING, "Array to string conversion"); diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 13f236bbaa..2c3766fd38 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -257,7 +257,6 @@ ZEND_API int ZEND_FASTCALL increment_function(zval *op1); ZEND_API int ZEND_FASTCALL decrement_function(zval *op2); ZEND_API void ZEND_FASTCALL convert_scalar_to_number(zval *op); -ZEND_API void ZEND_FASTCALL _convert_to_cstring(zval *op); ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op); ZEND_API void ZEND_FASTCALL convert_to_long(zval *op); ZEND_API void ZEND_FASTCALL convert_to_double(zval *op); @@ -340,7 +339,6 @@ static zend_always_inline zend_bool try_convert_to_string(zval *op) { #define _zval_get_double_func(op) zval_get_double_func(op) #define _zval_get_string_func(op) zval_get_string_func(op) -#define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op)); } #define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op)); } |