From: Christoph Mallon Date: Thu, 14 Apr 2011 11:53:37 +0000 (+0200) Subject: Reduce code duplication in the (long)-double-int-union-hack. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=d390c25c1fd92b9568a974aacea018c6a9b0865a;p=libfirm Reduce code duplication in the (long)-double-int-union-hack. --- diff --git a/ir/tv/fltcalc.c b/ir/tv/fltcalc.c index 3230541c7..452782c27 100644 --- a/ir/tv/fltcalc.c +++ b/ir/tv/fltcalc.c @@ -62,45 +62,28 @@ static inline int isinf(double x) typedef uint32_t UINT32; -#ifdef HAVE_LONG_DOUBLE -#ifdef WORDS_BIGENDIAN typedef union { struct { +#ifdef WORDS_BIGENDIAN UINT32 high; - UINT32 mid; - UINT32 low; - } val; - volatile long double d; -} value_t; #else -typedef union { - struct { UINT32 low; +#endif +#ifdef HAVE_LONG_DOUBLE UINT32 mid; - UINT32 high; - } val; - volatile long double d; -} value_t; #endif -#else #ifdef WORDS_BIGENDIAN -typedef union { - struct { - UINT32 high; UINT32 low; - } val; - volatile double d; -} value_t; #else -typedef union { - struct { - UINT32 low; UINT32 high; +#endif } val; +#ifdef HAVE_LONG_DOUBLE + volatile long double d; +#else volatile double d; -} value_t; -#endif #endif +} value_t; #define CLEAR_BUFFER(buffer) memset(buffer, 0, calc_buffer_size)