]> granicus.if.org Git - php/commitdiff
- Nuke code which hasn't been in use for ages.
authorAndi Gutmans <andi@php.net>
Sat, 3 Apr 2004 11:09:39 +0000 (11:09 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 3 Apr 2004 11:09:39 +0000 (11:09 +0000)
Zend/zend.h
Zend/zend_operators.c
Zend/zend_operators.h

index 17783caee4a1c3f98a5c53acab1a0bd25647d170..3dd8b4bf76c7e369a3b6516d320be522eedcd410 100644 (file)
@@ -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
 
index 66ffa1fce24802e7102fa3605e27984f3e2d6722..80a7730f10dc91be9d9b1777d669dd4c2c668c29 100644 (file)
@@ -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);
index 6ec32b5deade0611280aeb6c49bdf4ae9ee17a46..c6182ff6b6504557dfdb3620ffe3352be17d10c3 100644 (file)
@@ -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;