From ac4cce98d01fbe19f88ac1e217e7895ec38fdbac Mon Sep 17 00:00:00 2001 From: das Date: Tue, 25 Mar 2003 17:55:07 +0000 Subject: Import new sources. The only material change in this update is to add locale support for hexadecimal floating point conversions. Noticed by: ache Reviewed by: mike (mentor) --- contrib/gdtoa/README | 5 +---- contrib/gdtoa/g__fmt.c | 6 +----- contrib/gdtoa/gethex.c | 21 +++++++++++++-------- contrib/gdtoa/strtod.c | 8 ++------ contrib/gdtoa/strtodg.c | 6 +----- contrib/gdtoa/xsum0.out | 10 +++++----- 6 files changed, 23 insertions(+), 33 deletions(-) (limited to 'contrib/gdtoa') diff --git a/contrib/gdtoa/README b/contrib/gdtoa/README index d1dcb26..6bece75 100644 --- a/contrib/gdtoa/README +++ b/contrib/gdtoa/README @@ -320,7 +320,4 @@ it is '.'. Please send comments to David M. Gay - Bell Labs, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-0636, U.S.A. - dmg@research.bell-labs.com + dmg@acm.org diff --git a/contrib/gdtoa/g__fmt.c b/contrib/gdtoa/g__fmt.c index 5edc492..6274681 100644 --- a/contrib/gdtoa/g__fmt.c +++ b/contrib/gdtoa/g__fmt.c @@ -28,11 +28,7 @@ THIS SOFTWARE. /* Please send bug reports to David M. Gay - Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-0636 - U.S.A. - dmg@bell-labs.com + dmg@acm.org */ #include "gdtoaimp.h" diff --git a/contrib/gdtoa/gethex.c b/contrib/gdtoa/gethex.c index 333f075..0f9ae33 100644 --- a/contrib/gdtoa/gethex.c +++ b/contrib/gdtoa/gethex.c @@ -28,15 +28,15 @@ THIS SOFTWARE. /* Please send bug reports to David M. Gay - Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-0636 - U.S.A. - dmg@bell-labs.com + dmg@acm.org */ #include "gdtoaimp.h" +#ifdef USE_LOCALE +#include "locale.h" +#endif + int #ifdef KR_headers gethex(sp, fpi, exp, bp, sign) @@ -50,6 +50,11 @@ gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign) int esign, havedig, irv, k, n, nbits, up; ULong L, lostbits, *x; Long e, e1; +#ifdef USE_LOCALE + char decimalpoint = *localeconv()->decimal_point; +#else +#define decimalpoint '.' +#endif if (!hexdig['0']) hexdig_init_D2A(); @@ -61,7 +66,7 @@ gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign) s = s0; decpt = 0; if (!hexdig[*s]) { - if (*s == '.') { + if (*s == decimalpoint) { decpt = ++s; if (!hexdig[*s]) goto ret0; @@ -80,7 +85,7 @@ gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign) } while(hexdig[*s]) s++; - if (*s == '.' && !decpt) { + if (*s == decimalpoint && !decpt) { decpt = ++s; while(hexdig[*s]) s++; @@ -120,7 +125,7 @@ gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign) n = 0; L = 0; while(s1 > s0) { - if (*--s1 == '.') + if (*--s1 == decimalpoint) continue; if (n == 32) { *x++ = L; diff --git a/contrib/gdtoa/strtod.c b/contrib/gdtoa/strtod.c index 0a559d5..f1a0c04 100644 --- a/contrib/gdtoa/strtod.c +++ b/contrib/gdtoa/strtod.c @@ -28,11 +28,7 @@ THIS SOFTWARE. /* Please send bug reports to David M. Gay - Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-0636 - U.S.A. - dmg@bell-labs.com + dmg@acm.org */ #include "gdtoaimp.h" @@ -118,7 +114,7 @@ strtod switch(s[1]) { case 'x': case 'X': - switch(gethex(&s, &fpi, &exp, &bb, sign)) { + switch(i = gethex(&s, &fpi, &exp, &bb, sign)) { case STRTOG_NoNumber: s = s00; sign = 0; diff --git a/contrib/gdtoa/strtodg.c b/contrib/gdtoa/strtodg.c index 5b8409b..bf30e33 100644 --- a/contrib/gdtoa/strtodg.c +++ b/contrib/gdtoa/strtodg.c @@ -28,11 +28,7 @@ THIS SOFTWARE. /* Please send bug reports to David M. Gay - Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-0636 - U.S.A. - dmg@bell-labs.com + dmg@acm.org */ #include "gdtoaimp.h" diff --git a/contrib/gdtoa/xsum0.out b/contrib/gdtoa/xsum0.out index f564f91..e5ec8f7 100644 --- a/contrib/gdtoa/xsum0.out +++ b/contrib/gdtoa/xsum0.out @@ -1,9 +1,9 @@ -README 7150e50 13249 +README c9c34c1 13153 arithchk.c e37b8a75 4070 dmisc.c e8d262b6 4712 dtoa.c f3c132b3 16905 g_Qfmt.c e5847e9 2870 -g__fmt.c e29d67f1 2534 +g__fmt.c ee5f9be0 2439 g_ddfmt.c fcf94527 3790 g_dfmt.c f30e55a9 2533 g_ffmt.c 7c4ea96 2459 @@ -12,7 +12,7 @@ g_xfmt.c c20a5e4 2795 gdtoa.c 364a0d2 17017 gdtoa.h 1eb440de 4810 gdtoaimp.h 6a955ba 19106 -gethex.c ff3c434d 4981 +gethex.c 1310d1b3 5066 gmisc.c e1a268ea 2114 hd_init.c cf9a94e 1827 hexnan.c f53be1da 2988 @@ -26,9 +26,9 @@ strtoIf.c eb75ac99 1905 strtoIg.c ec59c2fa 3484 strtoIx.c 8f8c9d 1990 strtoIxL.c 1313ff7f 1961 -strtod.c 1ad667 20076 +strtod.c fd6556c8 19985 strtodI.c e58338e0 4062 -strtodg.c 1caf3fa4 19553 +strtodg.c e04b9254 19458 strtof.c 1e7a787a 2202 strtopQ.c e232c542 2685 strtopd.c e865dc64 1701 -- cgit v1.1