summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/src/tools/tqlocale.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-23 17:13:36 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-23 17:13:36 -0500
commitd3f7a9d6f1b8f6e24fb49aaa8caeaa7623ae48b5 (patch)
treebaeeba639393f46abab749f4700a250091c3cc16 /tqtinterface/qt4/src/tools/tqlocale.cpp
parentd7be1694839bacae31e500ea9e36b3c13257ce28 (diff)
downloadexperimental-d3f7a9d6f1b8f6e24fb49aaa8caeaa7623ae48b5.tar.gz
experimental-d3f7a9d6f1b8f6e24fb49aaa8caeaa7623ae48b5.zip
Apply all Qt3.3.8d patches
NOTE: This will *likely* break compilation of TQt4 Please wait a few days for fixes to be committed as needed!
Diffstat (limited to 'tqtinterface/qt4/src/tools/tqlocale.cpp')
-rw-r--r--tqtinterface/qt4/src/tools/tqlocale.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/tqtinterface/qt4/src/tools/tqlocale.cpp b/tqtinterface/qt4/src/tools/tqlocale.cpp
index 26a3230..69c8c39 100644
--- a/tqtinterface/qt4/src/tools/tqlocale.cpp
+++ b/tqtinterface/qt4/src/tools/tqlocale.cpp
@@ -125,13 +125,24 @@ static inline double nan()
#endif
// We can't rely on -NAN, since all operations on a NAN should return a NAN.
+static double be_neg_nan;
+static double le_neg_nan;
static const unsigned char be_neg_nan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 };
static const unsigned char le_neg_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff };
+static bool neg_nan_init = false;
+
static inline double negNan()
{
+ if (!neg_nan_init)
+ {
+ memcpy(&be_neg_nan,be_neg_nan_bytes,sizeof(be_neg_nan_bytes));
+ memcpy(&le_neg_nan,le_neg_nan_bytes,sizeof(le_neg_nan_bytes));
+ neg_nan_init = true;
+ }
return (ByteOrder == BigEndian ?
- *((const double *) be_neg_nan_bytes) :
- *((const double *) le_neg_nan_bytes));
+ be_neg_nan :
+ le_neg_nan);
+
}
// Sizes as defined by the ISO C99 standard - fallback