[Genabel-commits] r1404 - pkg/filevector/fvlib

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 19 21:05:17 CET 2013


Author: maksim
Date: 2013-11-19 21:05:17 +0100 (Tue, 19 Nov 2013)
New Revision: 1404

Modified:
   pkg/filevector/fvlib/CastUtils.cpp
Log:
Added macros to distinguish between R and notR version of filevector during compilation. This is needed to make sure that flv will compile for ProbABEL without R library.

Modified: pkg/filevector/fvlib/CastUtils.cpp
===================================================================
--- pkg/filevector/fvlib/CastUtils.cpp	2013-11-19 20:02:33 UTC (rev 1403)
+++ pkg/filevector/fvlib/CastUtils.cpp	2013-11-19 20:05:17 UTC (rev 1404)
@@ -18,12 +18,13 @@
 
 int initConsts(){
   int i;
+  unsigned int ui;
   sscanf("32767","%hi",&SHORT_INT_NAN);
   sscanf("65535","%hu",&UNSIGNED_SHORT_INT_NAN);
   sscanf("2147483647","%i",&INT_NAN);
   sscanf("4294967295","%u",&UNSIGNED_INT_NAN);
   sscanf("127","%i",&i); CHAR_NAN = i;
-  sscanf("255","%u",&i); UNSIGNED_CHAR_NAN = i;
+  sscanf("255","%u",&ui); UNSIGNED_CHAR_NAN = ui;
 
   parseFormats[UNSIGNED_SHORT_INT] = "%hu";
   parseFormats[SHORT_INT] = "%hd";
@@ -184,9 +185,17 @@
     	case INT:
     	    return (*(int*) data) == INT_NAN;
     	case FLOAT:
-	  return ISNAN(*(float*) data);
+#ifdef _NOT_R_FILEVECTOR
+			return std::isnan(*(float*) data);
+#else
+			return ISNAN(*(float*) data);
+#endif
     	case DOUBLE:
+#ifdef _NOT_R_FILEVECTOR
+	  return std::isnan(*(double*)data);
+#else
 	  return ISNAN(*(double*)data);
+#endif
     	case UNSIGNED_CHAR:
     	    return (*(unsigned char*) data) == UNSIGNED_CHAR_NAN;
     	case SIGNED_CHAR:



More information about the Genabel-commits mailing list