Blame SOURCES/qt-x11-free-3.3.8b-qlocale-aliasing.patch

106311
diff -ur qt-x11-free-3.3.8b/src/tools/qlocale.cpp qt-x11-free-3.3.8b-qlocale-aliasing/src/tools/qlocale.cpp
106311
--- qt-x11-free-3.3.8b/src/tools/qlocale.cpp	2008-01-15 20:09:13.000000000 +0100
106311
+++ qt-x11-free-3.3.8b-qlocale-aliasing/src/tools/qlocale.cpp	2011-11-04 02:38:59.000000000 +0100
106311
@@ -101,37 +101,37 @@
106311
 #endif
106311
 
106311
 #if !defined(INFINITY)
106311
-static const unsigned char be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
106311
-static const unsigned char le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
106311
+static const union { unsigned char c[8]; double d; } be_inf_bytes = {{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }};
106311
+static const union { unsigned char c[8]; double d; } le_inf_bytes = {{ 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }};
106311
 static inline double inf()
106311
 {
106311
     return (ByteOrder == BigEndian ?
106311
-            *((const double *) be_inf_bytes) :
106311
-            *((const double *) le_inf_bytes));
106311
+            be_inf_bytes.d :
106311
+            le_inf_bytes.d);
106311
 }
106311
 #   define INFINITY (::inf())
106311
 #endif
106311
 
106311
 #if !defined(NAN)
106311
-static const unsigned char be_nan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
106311
-static const unsigned char le_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
106311
+static const union { unsigned char c[8]; double d; } be_nan_bytes = {{ 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }};
106311
+static const union { unsigned char c[8]; double d; } le_nan_bytes = {{ 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }};
106311
 static inline double nan()
106311
 {
106311
     return (ByteOrder == BigEndian ?
106311
-            *((const double *) be_nan_bytes) :
106311
-            *((const double *) le_nan_bytes));
106311
+            be_nan_bytes.d :
106311
+            le_nan_bytes.d);
106311
 }
106311
 #   define NAN (::nan())
106311
 #endif
106311
 
106311
 // We can't rely on -NAN, since all operations on a NAN should return a NAN.
106311
-static const unsigned char be_neg_nan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 };
106311
-static const unsigned char le_neg_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff };
106311
+static const union { unsigned char c[8]; double d; } be_neg_nan_bytes = {{ 0xff, 0xf8, 0, 0, 0, 0, 0, 0 }};
106311
+static const union { unsigned char c[8]; double d; } le_neg_nan_bytes = {{ 0, 0, 0, 0, 0, 0, 0xf8, 0xff }};
106311
 static inline double negNan()
106311
 {
106311
     return (ByteOrder == BigEndian ?
106311
-            *((const double *) be_neg_nan_bytes) :
106311
-            *((const double *) le_neg_nan_bytes));
106311
+            be_neg_nan_bytes.d :
106311
+            le_neg_nan_bytes.d);
106311
 }
106311
 
106311
 // Sizes as defined by the ISO C99 standard - fallback