Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2007-09-01 01:21:27 +0400
committerJeff Johnston <jjohnstn@redhat.com>2007-09-01 01:21:27 +0400
commit6ddf8bef40f93669cbff7df85f22318bfbfcdaa0 (patch)
treeb97fc8fd4e61bbbf250e751a5cc7647c8afdae1f /newlib/libc/stdlib/strtod.c
parent95500c2eff0773968c36922f68d877cf5e8833e4 (diff)
2007-08-31 Antony King <antony.king@st.com>
* libc/stdlib/mprec.h [_DOUBLE_IS_32BITS}: Define IEEE_Arith bits and redefine associated dword0 macro (rvalue issue). * libc/stdio/vfieeefp.h: Ditto. * libc/stdlib/strtod.c: Add checks for _DOUBLE_IS_32BITS to prevent setting dword1 which is an rvalue only.
Diffstat (limited to 'newlib/libc/stdlib/strtod.c')
-rw-r--r--newlib/libc/stdlib/strtod.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c
index 6323f0b74..e206d0587 100644
--- a/newlib/libc/stdlib/strtod.c
+++ b/newlib/libc/stdlib/strtod.c
@@ -386,7 +386,9 @@ _DEFUN (_strtod_r, (ptr, s00, se),
if (!match(&s,"inity"))
++s;
dword0(rv) = 0x7ff00000;
+#ifndef _DOUBLE_IS_32BITS
dword1(rv) = 0;
+#endif /*!_DOUBLE_IS_32BITS*/
goto ret;
}
break;
@@ -398,12 +400,16 @@ _DEFUN (_strtod_r, (ptr, s00, se),
&& hexnan(&s, &fpinan, bits)
== STRTOG_NaNbits) {
dword0(rv) = 0x7ff00000 | bits[1];
+#ifndef _DOUBLE_IS_32BITS
dword1(rv) = bits[0];
+#endif /*!_DOUBLE_IS_32BITS*/
}
else {
#endif
dword0(rv) = NAN_WORD0;
+#ifndef _DOUBLE_IS_32BITS
dword1(rv) = NAN_WORD1;
+#endif /*!_DOUBLE_IS_32BITS*/
#ifndef No_Hex_NaN
}
#endif
@@ -627,8 +633,8 @@ _DEFUN (_strtod_r, (ptr, s00, se),
#ifndef _DOUBLE_IS_32BITS
else
dword1(rv) &= 0xffffffff << j;
- }
#endif /*!_DOUBLE_IS_32BITS*/
+ }
#else
for(j = 0; e1 > 1; j++, e1 >>= 1)
if (e1 & 1)
@@ -1109,7 +1115,9 @@ _DEFUN (_strtod_r, (ptr, s00, se),
if (inexact) {
if (!oldinexact) {
dword0(rv0) = Exp_1 + (70 << Exp_shift);
+#ifndef _DOUBLE_IS_32BITS
dword1(rv0) = 0;
+#endif /*!_DOUBLE_IS_32BITS*/
dval(rv0) += 1.;
}
}
@@ -1119,7 +1127,9 @@ _DEFUN (_strtod_r, (ptr, s00, se),
#ifdef Avoid_Underflow
if (scale) {
dword0(rv0) = Exp_1 - 2*P*Exp_msk1;
+#ifndef _DOUBLE_IS_32BITS
dword1(rv0) = 0;
+#endif /*!_DOUBLE_IS_32BITS*/
dval(rv) *= dval(rv0);
#ifndef NO_ERRNO
/* try to avoid the bug of testing an 8087 register value */