summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend.h3
-rw-r--r--Zend/zend_operators.c28
-rw-r--r--Zend/zend_operators.h25
3 files changed, 2 insertions, 54 deletions
diff --git a/Zend/zend.h b/Zend/zend.h
index 17783caee4..3dd8b4bf76 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -395,9 +395,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define IS_CONSTANT 8
#define IS_CONSTANT_ARRAY 9
-/* Special data type to temporarily mark large numbers */
-#define FLAG_IS_BC 10 /* for parser internal use only */
-
/* Ugly hack to support constants as static array indices */
#define IS_CONSTANT_INDEX 0x80
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 66ffa1fce2..80a7730f10 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -118,11 +118,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
case IS_DOUBLE:
case IS_LONG:
break;
-#if 0 && HAVE_BCMATH
- case FLAG_IS_BC:
- op->type = IS_DOUBLE; /* may have lost significant digits */
- break;
-#endif
default:
op->value.lval = strtol(op->value.str.val, NULL, 10);
op->type = IS_LONG;
@@ -161,9 +156,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
case IS_DOUBLE: \
case IS_LONG: \
break; \
- case FLAG_IS_BC: \
- (holder).type = IS_DOUBLE; /* may have lost significant digits */ \
- break; \
default: \
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
(holder).type = IS_LONG; \
@@ -1654,10 +1646,6 @@ ZEND_API int increment_function(zval *op1)
op1->type = IS_DOUBLE;
efree(strval); /* should never be empty_string */
break;
-#if 0
- case FLAG_IS_BC:
- /* Not implemented */
-#endif
default:
/* Perl style string increment */
increment_string(op1);
@@ -1847,22 +1835,6 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1, 0)) &&
(ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) {
-#if 0&&HAVE_BCMATH
- if ((ret1==FLAG_IS_BC) || (ret2==FLAG_IS_BC)) {
- bc_num first, second;
-
- /* use the BC math library to compare the numbers */
- init_num(&first);
- init_num(&second);
- str2num(&first, s1->value.str.val, 100); /* this scale should do */
- str2num(&second, s2->value.str.val, 100); /* ditto */
- result->value.lval = bc_compare(first, second);
- result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
- result->type = IS_LONG;
- free_num(&first);
- free_num(&second);
- } else
-#endif
if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
if (ret1!=IS_DOUBLE) {
dval1 = strtod(s1->value.str.val, NULL);
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 6ec32b5dea..c6182ff6b6 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -98,9 +98,9 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
errno=0;
local_dval = strtod(str, &end_ptr_double);
- if (errno!=ERANGE) {
+ if (errno != ERANGE) {
if (end_ptr_double == str+length) { /* floating point string */
- if (! zend_finite(local_dval)) {
+ if (!zend_finite(local_dval)) {
/* "inf","nan" and maybe other weird ones */
return 0;
}
@@ -108,28 +108,7 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
if (dval) {
*dval = local_dval;
}
-#if 0&&HAVE_BCMATH
- if (length>16) {
- register char *ptr=str, *end=str+length;
-
- while (ptr<end) {
- switch (*ptr++) {
- case 'e':
- case 'E':
- /* scientific notation, not handled by the BC library */
- return IS_DOUBLE;
- break;
- default:
- break;
- }
- }
- return FLAG_IS_BC;
- } else {
- return IS_DOUBLE;
- }
-#else
return IS_DOUBLE;
-#endif
}
} else {
end_ptr_double=NULL;