summaryrefslogtreecommitdiff
path: root/libquadmath/gdtoa/strtopQ.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-16 16:55:27 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-16 16:55:27 +0000
commitff44adf2e118be6db337584d627d3e9637b876d3 (patch)
tree252065baee12c4b6545a47616cc3a36114d3be22 /libquadmath/gdtoa/strtopQ.c
parenta6c9569e6a465cd066543232b4d45f700e82addb (diff)
downloadlinaro-gcc-ff44adf2e118be6db337584d627d3e9637b876d3.tar.gz
linaro-gcc-ff44adf2e118be6db337584d627d3e9637b876d3.tar.bz2
linaro-gcc-ff44adf2e118be6db337584d627d3e9637b876d3.zip
PR fortran/46625
* quadmath.map (QUADMATH_1.0): Remove quadmath_strtopQ and quadmath_dtoaq. Add strtoflt128 and quadmath_flt128tostr. * quadmath_weak.h (quadmath_strtopQ, quadmath_dtoaq): Remove. (strtoflt128, quadmath_flt128tostr): Add. * gdtoa/strtopQ.c (quadmath_strtopQ): Rename to... (strtoflt128): ... this. Return __float128, instead of writing to memory pointed by last argument. * quadmath.h: Use C style comments instead of C++ style. (quadmath_strtopQ, quadmath_dtoaq): Remove prototypes. (strtoflt128, quadmath_flt128tostr): Add prototypes. * libquadmath.texi (quadmath_dtoaq): Rename to quadmath_flt128tostr. (quadmath_strtopQ): Rename to strtoflt128. Adjust prototype, adjust examples. * quadmath_io.c (quadmath_dtoaq): Rename to... (quadmath_flt128tostr): ... this. libgfortran/ * io/write_float.def (DTOAQ): Use quadmath_flt128tostr instead of quadmath_dtoa. * io/transfer128.c (tmp1, tmp2): New variables, bring in strtoflt128 and quadmath_flt128tostr. (transfer_real128, transfer_real128_write, transfer_complex128, transfer_complex128_write): Remove tmp1/tmp2 variables. * io/read.c (convert_real): Use strtoflt128 instead of quadmath_strtopQ, adjust for the changed arguments and return value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168856 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libquadmath/gdtoa/strtopQ.c')
-rw-r--r--libquadmath/gdtoa/strtopQ.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libquadmath/gdtoa/strtopQ.c b/libquadmath/gdtoa/strtopQ.c
index ed7fb9c8632..0d34c1c0454 100644
--- a/libquadmath/gdtoa/strtopQ.c
+++ b/libquadmath/gdtoa/strtopQ.c
@@ -49,18 +49,15 @@ THIS SOFTWARE.
#define _3 0
#endif
- int
-#ifdef KR_headers
-quadmath_strtopQ(s, sp, V) CONST char *s; char **sp; void *V;
-#else
-quadmath_strtopQ(CONST char *s, char **sp, void *V)
-#endif
+__float128
+strtoflt128(CONST char *s, char **sp)
{
static FPI fpi0 = { 113, 1-16383-113+1, 32766 - 16383 - 113 + 1, 1, SI };
ULong bits[4];
Long exp;
int k;
- ULong *L = (ULong*)V;
+ union { __float128 f; ULong L[4]; } u;
+ ULong *L = &u.L[0];
#ifdef Honor_FLT_ROUNDS
#include "gdtoa_fltrnds.h"
#else
@@ -102,5 +99,5 @@ quadmath_strtopQ(CONST char *s, char **sp, void *V)
}
if (k & STRTOG_Neg)
L[_0] |= 0x80000000L;
- return k;
- }
+ return u.f;
+}