com php-src: Remove old zend_string_to_double function : Zend/zend_operators.c Zend/zend_operators.h
| From: | Nikita Popov | Date: | Fri, 05 Sep 2014 09:20:06 +0000 |
| Subject: | com php-src: Remove old zend_string_to_double function : Zend/zend_operators.c Zend/zend_operators.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81436@lists.php.net to get a copy of this message | ||
Commit: f915b44070a45013ced78da6df34d84552a2228a
Author: Nikita Popov <nikic@php.net> Fri, 5 Sep 2014 01:03:29 +0200
Parents: c48a126ba462e71d0b7b524064991121243f5459
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f915b44070a45013ced78da6df34d84552a2228a
Log:
Remove old zend_string_to_double function
Changed paths:
M Zend/zend_operators.c
M Zend/zend_operators.h
Diff:
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 617e6bd..a4ca871 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 c308777..41342de 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);