Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
d012a76d
Commit
d012a76d
authored
Dec 10, 2013
by
Matthias Braun
Browse files
libfirm requires C99 now so we can just use strtold
parent
0500fe61
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/tv/fltcalc.c
View file @
d012a76d
...
...
@@ -24,15 +24,6 @@
#include
"xmalloc.h"
static
long
double
string_to_long_double
(
const
char
*
str
)
{
#if __STDC_VERSION__ >= 199901L || _POSIX_C_SOURCE >= 200112L
return
strtold
(
str
,
NULL
);
#else
return
strtod
(
str
,
NULL
);
#endif
}
/** The number of extra precision rounding bits */
#define ROUNDING_BITS 2
...
...
@@ -647,7 +638,7 @@ void *fc_val_from_str(const char *str, size_t len, void *result)
char
*
buffer
=
alloca
(
len
+
1
);
memcpy
(
buffer
,
str
,
len
);
buffer
[
len
]
=
'\0'
;
long
double
val
=
str
ing_to_long_double
(
buffer
);
long
double
val
=
str
told
(
buffer
,
NULL
);
return
fc_val_from_ieee754
(
val
,
result
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment