[GRASS-SVN] r33752 - grass/branches/develbranch_6/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 8 04:18:44 EDT 2008


Author: neteler
Date: 2008-10-08 04:18:44 -0400 (Wed, 08 Oct 2008)
New Revision: 33752

Modified:
   grass/branches/develbranch_6/lib/gis/null_val.c
Log:
glynn: Make G_is_[fd]_null_value() check for any NaN, not just all-ones (merge from trunk, r33717)

Modified: grass/branches/develbranch_6/lib/gis/null_val.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/null_val.c	2008-10-08 08:18:33 UTC (rev 33751)
+++ grass/branches/develbranch_6/lib/gis/null_val.c	2008-10-08 08:18:44 UTC (rev 33752)
@@ -427,22 +427,7 @@
 
 int G_is_f_null_value(const FCELL * fcellVal)
 {
-    int i;			/* counter */
-
-    /* Check if the null patterns have been initialized */
-    if (!initialized) {
-	InitError();
-    }
-
-    /* Check if the FCELL value matches the null pattern */
-    for (i = 0; i < sizeof(FCELL); i++) {
-	if (((unsigned char *)fcellVal)[i] !=
-	    ((unsigned char *)&fcellNullPattern)[i]) {
-	    return FALSE;
-	}
-    }
-
-    return TRUE;
+    return *fcellVal != *fcellVal;
 }
 
 /****************************************************************************
@@ -467,22 +452,7 @@
 
 int G_is_d_null_value(const DCELL * dcellVal)
 {
-    int i;			/* counter */
-
-    /* Check if the null patterns have been initialized */
-    if (!initialized) {
-	InitError();
-    }
-
-    /* Check if the DCELL value matches the null pattern */
-    for (i = 0; i < sizeof(DCELL); i++) {
-	if (((unsigned char *)dcellVal)[i] !=
-	    ((unsigned char *)&dcellNullPattern)[i]) {
-	    return FALSE;
-	}
-    }
-
-    return TRUE;
+    return *dcellVal != *dcellVal;
 }
 
 /****************************************************************************



More information about the grass-commit mailing list