mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- Nuke code which hasn't been in use for ages.
This commit is contained in:
parent
b04eb1d3da
commit
1c7cfe739d
3 changed files with 2 additions and 54 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue