From: Nikita Popov Date: Thu, 4 Sep 2014 23:03:29 +0000 (+0200) Subject: Remove old zend_string_to_double function X-Git-Tag: PRE_PHP7_REMOVALS~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f915b44070a45013ced78da6df34d84552a2228a;p=php Remove old zend_string_to_double function --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 617e6bd216..a4ca8713b8 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -135,52 +135,6 @@ ZEND_API zend_long zend_atol(const char *str, int str_len) /* {{{ */ } /* }}} */ -ZEND_API double zend_string_to_double(const char *number, uint32_t length) /* {{{ */ -{ - double divisor = 10.0; - double result = 0.0; - double exponent; - const char *end = number+length; - const char *digit = number; - - if (!length) { - return result; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result *= 10; - result += *digit - '0'; - } else if (*digit == '.') { - digit++; - break; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result += (*digit - '0') / divisor; - divisor *= 10; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - return result; -} -/* }}} */ - ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) /* {{{ */ { try_again: diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index c308777e95..41342de020 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -367,8 +367,6 @@ ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2 #define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); } #define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); } -ZEND_API double zend_string_to_double(const char *number, uint32_t length); - ZEND_API int zval_is_true(zval *op); ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);