aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib/strtodg.c
AgeCommit message (Collapse)AuthorFilesLines
2018-09-06stdlib: Use __get_numeric_locale instead of __localeconv_l for decimal_pointKeith Packard1-3/+3
The string/float conversion functions need to get the locale decimal point. Instead of calling __localeconv_l (which copies locale data into lconv form from __get_numeric_locale), use __get_numeric_locale directly. Signed-off-by: Keith Packard <keithp@keithp.com>
2018-08-16Remove unused NaN's integer representation definitionsMasamichi Hosoda1-1/+0
By previous commit, strto{d|ld} ("nan") does not use the definition of NaN. There is no other function that uses the definitions. This commit remove the definitions.
2018-08-08newlib: fix various gcc warningsCorinna Vinschen1-5/+5
* unused variables * potentially used uninitialized * suggested bracketing * misleading indentation Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Implement strto[dflu]_l/wcsto[dflu]_lCorinna Vinschen1-65/+24
Implement GNU extensions strtod_l, strtof_l, strtol_l, strtold_l, strtoll_l, strtoul_l, strtoull_l, wcstod_l, wcstof_l, wcstol_l, wcstold_l, wcstoll_l, wcstoul_l, wcstoull_l. Export from Cygwin, fix posix.xml. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26Only build _strtodg_r on targets supporting a distinct long double typeCorinna Vinschen1-0/+4
* libc/stdlib/strtodg.c: Add ifdef to check _HAVE_LONG_DOUBLE and _LDBL_EQ_DBL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-21Handle multibyte decimapl point in strtold.Corinna Vinschen1-1/+8
* libc/stdlib/strtodg.c: Define USE_LOCALE. (_strtodg_r): Handle multibyte decimal point. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20Import correctly working strtold from David M. Gay.Corinna Vinschen1-0/+1136
* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add strtodg.c and strtorx.c. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/strtodg.c: New file implementing generic string to long double conversion. * libc/stdlib/strtorx.c: New file, implementing IEEE format string to long double conversion. * libc/stdlib/mprec.h (_strtodg_r): Declare. (_strtorx_r): Declare. * libc/stdlib/gdtoa.h (__UShort): Define. * libc/stdlib/strtold.c (__flt_rounds): Define for i386 and x86_64 target. (FLT_ROUNDS): Define, as 0 on platforms missing a __flt_rounds function. (_strtold_r): Converted from strtold. Call _strtorx_r on targets supporting distinct long doubles. (strtold): Just call _strtold_r. * libc/include/stdlib.h (_strtold_r): Declare. * libc/stdlib/ldtoa.c (_strtold): Comment out. Explain why. * libc/stdio/vfscanf.c (__SVFSCANF_R): Call _strtold_r instead of _strtold. * libc/machine/powerpc/vfscanf.c (__svfscanf_r): Ditto. * common.din (strtold): Drop redirection to _strtold. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>