about summary refs log tree commit diff
path: root/stdlib/strtod.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-03-20 02:20:57 +0000
committerUlrich Drepper <drepper@redhat.com>1997-03-20 02:20:57 +0000
commitc57abfa73560ac665e126a66081e1549bcd4645b (patch)
treeba69ca2329ef60f22093769ad45a227dd90dad7c /stdlib/strtod.c
parente61abf83986463e263de965d487fac5cb083839a (diff)
downloadglibc-c57abfa73560ac665e126a66081e1549bcd4645b.tar.gz
glibc-c57abfa73560ac665e126a66081e1549bcd4645b.tar.xz
glibc-c57abfa73560ac665e126a66081e1549bcd4645b.zip
1997-03-20 01:49  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/libm-ieee754/s_tanhl.c (__tanhl): Correct handling of
	-inf.

	* Makeconfig: (rpath-link): Add math/ directory.
	(math-objdir): New variable.
	(link-extra-lib): Define to special version when
	$(common-objpfx)!=$(objpfx) to allow libraries outside
	$(common-objpfx) be linked to the application.

	* math/Makefile: Add rules to build and run test programs.
	* math/libm-test.c (_GNU_SOURCE): Define only if still undefined.
	(check_equal): Correct check for error.
	(ceil_test): Fix typo.
	(log_test): Fix typo.
	(floor_test): Fix typo.
	(pow_test): Fix typos.
	(log10_test): Allow slight incorrectness for `log10(e)'.
	(modf_test): New functions to test `modf' et.al.
	(hypot_test): Rewrite test completely.
	Patch partly by Andreas Jaeger.
	* math/test-double.h (__NO_MATH_INLINES): Define only if not
	already defined.
	* math/test-float.h: Likewise.
	* math/test-logdouble.h: Likewise.

	* setjmp/setjmp.h: Change references of ANSI C to ISO C.
	* setjmp/tst-setjmp.c: Correct and extend test suite.
	* sysdeps/i386/__longjmp.S: Update copyright.
	* sysdeps/i386/bsd-_setjmp.S: Correct fatal bug in jump to
	`__sigsetjmp' in PIC code.
	* sysdeps/i386/bsd-setjmp.S: Likewise.

	* sysdeps/libm-i387/e_pow.S: Correct recognition of mantissa
	overflow.
	* sysdeps/libm-i387/e_powf.S: Likewise.
	* sysdeps/libm-i387/s_expm1.S: Handle x == +-0 as a special
	case since expm1(-0) == -0.
	* sysdeps/libm-i387/s_expm1f.S: Likewise.
	* sysdeps/libm-i387/s_expm1l.S: Likewise.
	* sysdeps/libm-ieee754/s_modf.c: Optimize code by avoiding unneeded
	access to FP number.
	* sysdeps/libm-ieee754/s_modff.c: Likewise.
	* sysdeps/libm-ieee754/s_modfl.c: Correct former completely bogus
	code.  It never worked correctly.
	* sysdeps/libm-ieee754/s_tanh.c: Handle x == +-0 as a special
	case since tanh(-0) == -0.
	* sysdeps/libm-ieee754/s_tanhf.c: Likewise.

1997-03-19 21:13  Ulrich Drepper  <drepper@cygnus.com>

	* stdlib/strtod.c (STRTOL): Use wchar_t as type for `decimal' and
	`thousands' to support systems with sizeof(wchar_t) !=
	sizeof(wint_t).  Blargh.

	* sysdeps/unix/sysv/linux/socketbits.h: Remove definition of
	SOL_IP, SOL_TCP, SOL_UDP, and SOL_IPX as they are defined in
	appropriate headers.

	* sysdeps/unix/sysv/linux/writev.c: Don't use MAX_IOVEC.  Test for
	UIO_FASTIOV and set to 8 if not available.
	* sysdeps/unix/sysv/linux/readv.c: Likewise.
	Patch by HJ Lu.

	* sysdeps/unix/sysv/linux/xstat.c: Include <kernel_stat.h>, not
	"kernel_stat.h".
	* sysdeps/unix/sysv/linux/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/fxstat.c: Likewise.
	Reported by fabsoft@fabsoft2.zarm.uni-bremen.de.
Diffstat (limited to 'stdlib/strtod.c')
-rw-r--r--stdlib/strtod.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/stdlib/strtod.c b/stdlib/strtod.c
index 5d892b94cb..cff75bd4ad 100644
--- a/stdlib/strtod.c
+++ b/stdlib/strtod.c
@@ -383,15 +383,13 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   typedef unsigned int wint_t;
 #endif
   /* The radix character of the current locale.  */
-  wint_t decimal;
+  wchar_t decimal;
   /* The thousands character of the current locale.  */
-  wint_t thousands;
+  wchar_t thousands;
   /* The numeric grouping specification of the current locale,
      in the format described in <locale.h>.  */
   const char *grouping;
 
-  assert (sizeof (wchar_t) == sizeof (wint_t));
-
   if (group)
     {
       grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
@@ -400,10 +398,9 @@ INTERNAL (STRTOF) (nptr, endptr, group)
       else
 	{
 	  /* Figure out the thousands separator character.  */
-	  if (mbtowc ((wchar_t *) &thousands,
-		      _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP),
+	  if (mbtowc (&thousands, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP),
 		      strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0)
-	    thousands = (wint_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
+	    thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
 	  if (thousands == L'\0')
 	    grouping = NULL;
 	}
@@ -417,7 +414,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   /* Find the locale's decimal point character.  */
   if (mbtowc ((wchar_t *) &decimal, _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT),
 	      strlen (_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT))) <= 0)
-    decimal = (wint_t) *_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
+    decimal = (wchar_t) *_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
   assert (decimal != L'\0');
 
   /* Prepare number representation.  */
@@ -445,7 +442,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   /* Return 0.0 if no legal string is found.
      No character is used even if a sign was found.  */
   if ((c < L_('0') || c > L_('9'))
-      && ((wint_t) c != decimal || cp[1] < L_('0') || cp[1] > L_('9')))
+      && ((wchar_t) c != decimal || cp[1] < L_('0') || cp[1] > L_('9')))
     {
       int matched = 0;
       /* Check for `INF' or `INFINITY'.  */
@@ -511,14 +508,14 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   start_of_digits = startp = cp;
 
   /* Ignore leading zeroes.  This helps us to avoid useless computations.  */
-  while (c == L_('0') || (thousands != L'\0' && (wint_t) c == thousands))
+  while (c == L_('0') || (thousands != L'\0' && (wchar_t) c == thousands))
     c = *++cp;
 
   /* If no other digit but a '0' is found the result is 0.0.
      Return current read pointer.  */
   if ((c < L_('0') || c > L_('9')) &&
       (base == 16 && (c < TOLOWER (L_('a')) || c > TOLOWER (L_('f')))) &&
-      (wint_t) c != decimal &&
+      (wchar_t) c != decimal &&
       (base == 16 && (cp == start_of_digits || TOLOWER (c) != L_('p'))) &&
       (base != 16 && TOLOWER (c) != L_('e')))
     {
@@ -540,7 +537,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
       if ((c >= L_('0') && c <= L_('9'))
 	  || (base == 16 && TOLOWER (c) >= L_('a') && TOLOWER (c) <= L_('f')))
 	++dig_no;
-      else if (thousands == L'\0' || (wint_t) c != thousands)
+      else if (thousands == L'\0' || (wchar_t) c != thousands)
 	/* Not a digit or separator: end of the integer part.  */
 	break;
       c = *++cp;
@@ -590,7 +587,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
 
   /* Read the fractional digits.  A special case are the 'american style'
      numbers like `16.' i.e. with decimal but without trailing digits.  */
-  if ((wint_t) c == decimal)
+  if ((wchar_t) c == decimal)
     {
       c = *++cp;
       while (c >= L_('0') && c <= L_('9') ||
@@ -693,7 +690,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   if (lead_zero)
     {
       /* Find the decimal point */
-      while ((wint_t) *startp != decimal)
+      while ((wchar_t) *startp != decimal)
 	++startp;
       startp += lead_zero + 1;
       exponent -= base == 16 ? 4 * lead_zero : lead_zero;