From f3f282f3c613f2a5ecb4aefcdc3a278b3ffc8ad4 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 1 Apr 2008 00:51:50 +0000 Subject: [PATCH] Fix hack from 2008-01-20 that broke on ARM. --- ChangeLog | 8 ++++++++ src/float/dfloat/conv/cl_DF_from_double.cc | 9 +++------ src/float/ffloat/conv/cl_FF_from_float.cc | 9 +++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 561eb11..3e170fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-31 Bruno Haible + + Fix hack from 2008-01-20 that broke on ARM. + * src/float/ffloat/conv/cl_FF_from_float.cc (FAST_FLOAT): Remove. + (cl_float_to_FF_pointer): Use anonymous union for conversion. + * src/float/dfloat/conv/cl_DF_from_double.cc (FAST_DOUBLE): Remove. + (cl_double_to_DF_pointer): Use anonymous union for conversion. + 2008-03-24 Richard B. Kreckel * Version 1.2.1 released. diff --git a/src/float/dfloat/conv/cl_DF_from_double.cc b/src/float/dfloat/conv/cl_DF_from_double.cc index ce145e7..e4ada06 100644 --- a/src/float/dfloat/conv/cl_DF_from_double.cc +++ b/src/float/dfloat/conv/cl_DF_from_double.cc @@ -1,8 +1,5 @@ // cl_double_to_DF_pointer(). -// Ensure that union dfloatjanus has a 'double' alternative. -#define FAST_DOUBLE - // General includes. #include "cl_sysdep.h" @@ -16,9 +13,9 @@ namespace cln { cl_heap_dfloat* cl_double_to_DF_pointer (const double x) { - var union dfloatjanus val_; - val_.machine_double = x; - var dfloat val = val_.eksplicit; + var union { dfloat eksplicit; double machine_double; } u; + u.machine_double = x; + var dfloat val = u.eksplicit; #if (cl_word_size==64) var uintL exp = (val >> DF_mant_len) & (bit(DF_exp_len)-1); // e if (exp == 0) // e=0 ? diff --git a/src/float/ffloat/conv/cl_FF_from_float.cc b/src/float/ffloat/conv/cl_FF_from_float.cc index da7e9a3..7181c97 100644 --- a/src/float/ffloat/conv/cl_FF_from_float.cc +++ b/src/float/ffloat/conv/cl_FF_from_float.cc @@ -1,8 +1,5 @@ // cl_float_to_FF_pointer(). -// Ensure that union ffloatjanus has a 'float' alternative. -#define FAST_FLOAT - // General includes. #include "cl_sysdep.h" @@ -15,9 +12,9 @@ namespace cln { cl_private_thing cl_float_to_FF_pointer (const float x) { - var union ffloatjanus val_; - val_.machine_float = x; - var ffloat val = val_.eksplicit; + var union { ffloat eksplicit; float machine_float; } u; + u.machine_float = x; + var ffloat val = u.eksplicit; var uintL exp = (val >> FF_mant_len) & (bit(FF_exp_len)-1); // e if (exp == 0) // e=0 ? // vorzeichenbehaftete 0.0 oder subnormale Zahl