From f915b44070a45013ced78da6df34d84552a2228a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 5 Sep 2014 01:03:29 +0200 Subject: [PATCH] Remove old zend_string_to_double function --- Zend/zend_operators.c | 46 ------------------------------------------- Zend/zend_operators.h | 2 -- 2 files changed, 48 deletions(-) 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); -- 2.40.0