]> git.saurik.com Git - apple/libc.git/blobdiff - gdtoa/FreeBSD/gdtoa-strtof.c.patch
Libc-594.1.4.tar.gz
[apple/libc.git] / gdtoa / FreeBSD / gdtoa-strtof.c.patch
index 33db13a9279650ae290d758350db698abf347407..6e316202ff72bf354cc25f613fd725aede6d878e 100644 (file)
@@ -1,6 +1,6 @@
---- gdtoa-strtof.c.orig        2007-04-03 12:19:28.000000000 -0700
-+++ gdtoa-strtof.c     2007-04-06 12:52:45.000000000 -0700
-@@ -29,24 +29,41 @@
+--- gdtoa-strtof.c.orig        2008-10-28 12:35:19.000000000 -0700
++++ gdtoa-strtof.c     2008-10-28 13:19:34.000000000 -0700
+@@ -29,13 +29,15 @@ THIS SOFTWARE.
  /* Please send bug reports to David M. Gay (dmg at acm dot org,
   * with " at " changed at "@" and " dot " changed to ".").    */
  
 +strtof_l(CONST char *s, char **sp, locale_t loc)
  #endif
  {
--      static FPI fpi = { 24, 1-127-24+1,  254-127-24+1, 1, SI };
-+      static FPI fpi0 = { 24, 1-127-24+1,  254-127-24+1, 1, SI };
-       ULong bits[1];
-       Long exp;
-       int k;
-       union { ULong L[1]; float f; } u;
-+      FPI *fpi = &fpi0, fpi1;
-+#ifdef Honor_FLT_ROUNDS
-+      int rounding = Flt_Rounds;
-+#endif
+       static FPI fpi0 = { 24, 1-127-24+1,  254-127-24+1, 1, SI };
+@@ -49,9 +51,13 @@ strtof(CONST char *s, char **sp)
+ #define fpi &fpi0
+ #endif
  
--      k = strtodg(s, sp, &fpi, &exp, bits);
+-      k = strtodg(s, sp, fpi, &exp, bits);
 +      NORMALIZE_LOCALE(loc);
-+#ifdef Honor_FLT_ROUNDS
-+      if (rounding != fpi0.rounding) {
-+              fpi1 = fpi0; /* for thread safety */
-+              fpi1.rounding = rounding;
-+              fpi = &fpi1;
-+              }
-+#endif /* Honor_FLT_ROUNDS */
 +      k = strtodg(s, sp, fpi, &exp, bits, loc);
        switch(k & STRTOG_Retmask) {
          case STRTOG_NoNumber:
@@ -46,7 +33,7 @@
          case STRTOG_Zero:
                u.L[0] = 0;
                break;
-@@ -71,3 +88,13 @@
+@@ -76,3 +82,13 @@ strtof(CONST char *s, char **sp)
                u.L[0] |= 0x80000000L;
        return u.f;
        }