@@ -10326,16 +10326,7 @@ intrinsic: function_udf
}
if( $1 == NUMVAL_F ) {
if( is_literal($r1->field) ) {
- _Float128 output __attribute__ ((__unused__));
- auto input = $r1->field->data.initial;
- auto local = xstrdup(input), pend = local;
- std::replace(local, local + strlen(local), ',', '.');
- std::remove_if(local, local + strlen(local), isspace);
- output = strtof128(local, &pend);
- // bad if strtof128 could not convert input
- if( *pend != '\0' ) {
- error_msg(@r1, "'%s' is not a numeric string", input);
- }
+ // we assume $r1->field->data.initial parses as float
}
}
if( ! intrinsic_call_1($$, $1, $r1, @r1)) YYERROR;
@@ -12065,20 +12056,18 @@ static REAL_VALUE_TYPE
numstr2i( const char input[], radix_t radix ) {
REAL_VALUE_TYPE output;
size_t integer = 0;
- int erc=0, n=0;
+ int erc=0;
switch( radix ) {
case decimal_e: { // Use decimal point for comma, just in case.
- auto local = xstrdup(input), pend = local;
+ auto local = xstrdup(input);
if( !local ) { erc = -1; break; }
std::replace(local, local + strlen(local), ',', '.');
real_from_string3 (&output, local, TYPE_MODE (float128_type_node));
- strtof128(local, &pend);
- n = pend - local;
}
break;
case hexadecimal_e:
- erc = sscanf(input, "%zx%n", &integer, &n);
+ erc = sscanf(input, "%zx", &integer);
real_from_integer (&output, VOIDmode, integer, UNSIGNED);
break;
case boolean_e:
@@ -12101,7 +12090,7 @@ numstr2i( const char input[], radix_t radix ) {
real_from_integer (&output, VOIDmode, integer, UNSIGNED);
return output;
}
- if( erc == -1 || n < int(strlen(input)) ) {
+ if( erc == -1 ) {
yywarn("'%s' was accepted as %lld", input, output);
}
return output;
@@ -48,17 +48,6 @@
#define PICTURE_MAX 64
-#if ! (__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT))
-static_assert( sizeof(output) == sizeof(long double), "long doubles?" );
-
-// ??? This is still used for verificataion that __nptr parses as
-// float number via setting *__endptr.
-static inline _Float128
-strtof128 (const char *__restrict __nptr, char **__restrict __endptr) {
- return strtold(nptr, endptr);
-}
-#endif
-
extern const char *numed_message;
enum cbl_dialect_t {
@@ -352,15 +341,6 @@ struct cbl_field_data_t {
std::replace(input.begin(), input.end(), ',', '.');
}
- char *pend = NULL;
-
- strtof128(input.c_str(), &pend);
-
- if( pend != input.c_str() + len ) {
- dbgmsg("%s: error: could not interpret '%s' of '%s' as a number",
- __func__, pend, initial);
- }
-
REAL_VALUE_TYPE r;
real_from_string (&r, input.c_str());
r = real_value_truncate (TYPE_MODE (float128_type_node), r);