[Kst] kdeextragear-2/kst/kst

Adriaan de Groot groot at kde.org
Sun Jul 4 12:23:14 CEST 2004


CVS commit by adridg: 

0/0 warnings-- by defining nan explicitly


  M +18 -0     kstvector.cpp   1.69


--- kdeextragear-2/kst/kst/kstvector.cpp  #1.68:1.69
@@ -35,4 +35,22 @@
 
 /*
+** For systems without NAN, this is a NAN in IEEE double format.
+** Code lifted from kde screensavers.
+*/
+#if !defined(NAN)
+static inline double ::nan__()
+{
+  static const unsigned int one = 1;
+  static const bool BigEndian = (*((unsigned char *) &one) == 0);
+
+  static const unsigned char be_nan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
+  static const unsigned char le_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
+
+  return *( ( const double * )( BigEndian ? be_nan_bytes : le_nan_bytes ) );
+}
+#   define NAN (::nan__())
+#endif
+
+/*
 ** Both Solaris and FreeBSD-current do weird things with the
 ** isnan() defined in math.h - in particular on FreeBSD it





More information about the Kst mailing list