aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2003-03-25 17:55:07 +0000
committerDavid Schultz <das@FreeBSD.org>2003-03-25 17:55:07 +0000
commit8f7c2af4362c19c9fd305aa0dbd175d57c9275b0 (patch)
treecd193b11cc426b2df4cb276c23214cfa9b598050
parent84781d47e632a511cfe34f924bf173d899c796ff (diff)
downloadsrc-8f7c2af4362c19c9fd305aa0dbd175d57c9275b0.tar.gz
src-8f7c2af4362c19c9fd305aa0dbd175d57c9275b0.zip
Import new sources. The only material change in this update is tovendor/gdtoa/20030324
add locale support for hexadecimal floating point conversions. Noticed by: ache Reviewed by: mike (mentor)
Notes
Notes: svn path=/vendor/gdtoa/dist/; revision=112620 svn path=/vendor/gdtoa/20030324/; revision=112622; tag=vendor/gdtoa/20030324
-rw-r--r--contrib/gdtoa/README5
-rw-r--r--contrib/gdtoa/g__fmt.c6
-rw-r--r--contrib/gdtoa/gethex.c21
-rw-r--r--contrib/gdtoa/strtod.c8
-rw-r--r--contrib/gdtoa/strtodg.c6
-rw-r--r--contrib/gdtoa/xsum0.out10
6 files changed, 23 insertions, 33 deletions
diff --git a/contrib/gdtoa/README b/contrib/gdtoa/README
index d1dcb2624c18..6bece758de30 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 5edc492b7231..6274681308f4 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 333f075932c9..0f9ae3348c6b 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 0a559d529e06..f1a0c0495786 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 5b8409bec2b1..bf30e33ecf57 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 f564f913a1ca..e5ec8f782275 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