Commit Graph

16 Commits

Author SHA1 Message Date
Masamichi Hosoda 4c8fa88e4d Remove unused NaN's integer representation definitions
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-16 13:17:44 +02:00
Yaakov Selkowitz 70ee6b17df ansification: remove _EXFUN, _EXFUN_NOTHROW
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:29 -06:00
Yaakov Selkowitz 0bda30e1ff ansification: remove _CONST
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:08 -06:00
Corinna Vinschen 238455adfa Implement strto[dflu]_l/wcsto[dflu]_l
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>
2016-08-15 17:35:21 +02:00
Corinna Vinschen fbace81684 Import correctly working strtold from David M. Gay.
* 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>
2015-11-20 18:14:58 +01:00
Corinna Vinschen 51bf1b81f3 Make match function globally available to stdlib functions.
* libc/stdlib/strtod.c (match): Move from here...
	* libc/stdlib/gdtoa-hexnan.c (match): ...to here.
	* libc/stdlib/mprec.h (match): Declare and add __match define.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20 18:03:05 +01:00
Corinna Vinschen e9c0122ec0 * libc/stdlib/gdtoa-gethex.c (__hexdig): Constify.
(hexdig_init): Remove.
	(__hexdig_fun): New function.
	hexdig_init, added __hexdig_fun
	(gethex): Call __get_hexdig macro rather than hexdig.
	* libc/stdlib/gdtoa-hexnan.c (hexnan): Constify fpi argument.
	Call __get_hexdig macro rather than hexdig.
	* libc/stdlib/ldtoa.c: Throughout constify functions arguments where
	required by constifying the following arrays.
	(ezero): Constify.
	(eone): Constify.
	(ermsg): Constify.
	(etens): Constify.
	(emtens): Constify.
	(nan113): Constify.
	(nan64): Constify.
	(nan53): Constify.
	(nan24): Constify.
	* libc/stdlib/mprec.h (__get_hexdig): Define.
	(gethex): Constify args in declaration where appropriate.
	(hexnan): Ditto.
	(hexdig_init): Remove declaration.
	(__hexdig_fun): Declare.
	* libc/stdlib/strtod.c (fpi): Constify.
	(fpinan): Constify.
2013-06-10 15:27:43 +00:00
Corinna Vinschen ba35b8303c * libc/stdlib/mprec.h (Storeinc): Add parenthesis to avoid compiler
warning.
2012-08-07 17:52:51 +00:00
Hans-Peter Nilsson 5592f939b4 Fix strict-aliasing issues with _strtod_r and Storeinc.
* libc/stdlib/strtod.c (_strtod_r): Change local variables aadj,
	rv, rv0 from double to type U.  Use accessor macros dval, dword0
	and dword1 for all accesses except for the ULtod call, where rv.i
	replaces the pointer cast.
	* libc/stdlib/mprec.h (U): Rename member L to i for easier re-use
	of access macros.  Tweak comment.
	Remove #ifdef'd YES_ALIAS code.
	(dword0, dword1, dval): Define in terms of uncast union member
	access.  Ditto for _DOUBLE_IS_32BITS variants.
	(Storeinc): Replace aliasing-flawed microoptimized definition with
	alternative suggested in comment.  Remove now stale comment.
2008-06-25 01:45:02 +00:00
Jeff Johnston 6ddf8bef40 2007-08-31 Antony King <antony.king@st.com>
* libc/stdlib/mprec.h [_DOUBLE_IS_32BITS}: Define IEEE_Arith
        bits and redefine associated dword0 macro (rvalue issue).
        * libc/stdio/vfieeefp.h: Ditto.
        * libc/stdlib/strtod.c: Add checks for _DOUBLE_IS_32BITS
        to prevent setting dword1 which is an rvalue only.
2007-08-31 21:21:27 +00:00
Jeff Johnston 1eeaeab855 2007-06-06 Christian Groessler <chris@groessler.org>
* libc/stdlib/ldtoa (_ldcheck): Make sure the setting of
        rnd is done after the last local variable declaration.

2007-06-06  Jeff Johnston  <jjohnstn@redhat.com>

        * libc/stdlib/mprec.h[Just_16]: Make sure that Pack_16 is defined.
2007-06-06 19:24:28 +00:00
Jeff Johnston b0b9243869 2006-07-05 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdlib/mprec.h [_DOUBLE_IS_32BITS]: Turn off C99 hex
        floating-point format support.  Also redefine
        dword0 and dword1 macros.
        * libc/stdlib/strtod.c: Add checks for _DOUBLE_IS_32BITS
        to prevent setting dword1 which is an rvalue only.
2006-07-05 16:18:30 +00:00
Jeff Johnston f489b5943c 2006-06-22 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdlib/Makefile.am: Add new gdtoa routines.
        * libc/stdlib/Makefile.in: Regenerated.
        * libc/stdlib/gd_qnan.h: New file.
        * libc/stdlib/gdtoa-gethex.c: Ditto.
        * libc/stdlib/gdtoa-hexnan.c: Ditto.
        * libc/stdlib/gdtoa.h: Ditto.
        * libc/stdlib/mprec.c: Add new helper routines needed by
        the new gdtoa code.
        * libc/stdlib/mprec.h: Integrate some defines and prototypes
        used by gdtoa routines here.
        * libc/stdlib/strtod.c: Rebased on David M. Gay's gdtoa-strtod.c
        which adds C99 support such as nan, inf, and hexadecimal input
        format.
2006-06-22 17:59:52 +00:00
Jeff Johnston a70486d790 2002-06-24 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h: Remove <sys/types.h>.
        (__dmath): Use __ULong instead of _uint32_t.
        * libc/include/sys/reent.h: If long or int is not 32-bits,
        include <sys/types.h> to get definitions for _int32_t and _uint32_t.
        * libc/stdlib/mprec.h: Include <sys/types.h> to get integer defs.
        * libm/common/fdlibm.h: Ditto.
2002-06-24 20:03:38 +00:00
Nick Clifton 2b6b730c98 Handle ARMs with big endian IEEE words but little endian IEEE bytes 2001-06-28 10:40:09 +00:00
Christopher Faylor 8a0efa53e4 import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00