Loading...
gdtoa/FreeBSD/_hdtoa.c.patch Libc-391.5.21 Libc-498
--- Libc/Libc-391.5.21/gdtoa/FreeBSD/_hdtoa.c.patch
+++ Libc/Libc-498/gdtoa/FreeBSD/_hdtoa.c.patch
@@ -1,6 +1,15 @@
---- _hdtoa.c.orig	2006-01-31 15:21:41.000000000 -0800
-+++ _hdtoa.c	2006-01-31 23:37:12.000000000 -0800
-@@ -223,6 +223,10 @@
+--- _hdtoa.c.orig	2006-08-14 16:12:46.000000000 -0700
++++ _hdtoa.c	2006-08-14 23:02:39.000000000 -0700
+@@ -55,7 +55,7 @@
+ 			*s = 1;
+ 			return (1);
+ 		}
+-		++*s;
++		*s = 0;
+ 	}
+ 	++*s;
+ 	return (0);
+@@ -223,12 +223,17 @@
  	union IEEEl2bits u;
  	char *s, *s0;
  	int bufsize;
@@ -11,7 +20,14 @@
  
  	u.e = e;
  	*sign = u.bits.sign;
-@@ -270,6 +274,19 @@
+ 
+ 	switch (fpclassify(e)) {
+ 	case FP_NORMAL:
++	case FP_SUPERNORMAL:
+ 		*decpt = u.bits.exp - LDBL_ADJ;
+ 		break;
+ 	case FP_ZERO:
+@@ -270,6 +275,19 @@
  	 */
  	for (s = s0 + bufsize - 1; s > s0 + sigfigs - 1; s--)
  		*s = 0;
@@ -31,7 +47,7 @@
  	for (; s > s0 + sigfigs - (LDBL_MANL_SIZE / 4) - 1 && s > s0; s--) {
  		*s = u.bits.manl & 0xf;
  		u.bits.manl >>= 4;
-@@ -278,6 +295,7 @@
+@@ -278,6 +296,7 @@
  		*s = u.bits.manh & 0xf;
  		u.bits.manh >>= 4;
  	}
@@ -39,7 +55,7 @@
  
  	/*
  	 * At this point, we have snarfed all the bits in the
-@@ -285,7 +303,11 @@
+@@ -285,7 +304,11 @@
  	 * (partial) nibble, which is dealt with by the next
  	 * statement.  We also tack on the implicit normalization bit.
  	 */