[GRASS-SVN] r50234 - grass/branches/develbranch_6/raster/r.null

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 17 07:53:03 EST 2012


Author: hamish
Date: 2012-01-17 04:53:03 -0800 (Tue, 17 Jan 2012)
New Revision: 50234

Modified:
   grass/branches/develbranch_6/raster/r.null/null.c
Log:
debug statement to help with #1276

Modified: grass/branches/develbranch_6/raster/r.null/null.c
===================================================================
--- grass/branches/develbranch_6/raster/r.null/null.c	2012-01-17 11:20:57 UTC (rev 50233)
+++ grass/branches/develbranch_6/raster/r.null/null.c	2012-01-17 12:53:03 UTC (rev 50234)
@@ -33,7 +33,7 @@
     int row, col, null_fd;
     unsigned char *null_bits;
     RASTER_MAP_TYPE map_type;
-    int change_null = 0, create, remove, only_int, only_fp, only_null;
+    int change_null = FALSE, create, remove, only_int, only_fp, only_null;
     int is_reclass;
 
     struct GModule *module;
@@ -131,7 +131,7 @@
     
     if (parms.null->answer) {
 	if (sscanf(parms.null->answer, "%lf", &new_null) == 1)
-	    change_null = 1;
+	    change_null = TRUE;
 	else
 	    G_fatal_error(_("%s is illegal entry for null"),
 			  parms.null->answer);
@@ -177,8 +177,7 @@
 
 	for (row = 0; row < cellhd.rows; row++) {
 	    G_percent(row, cellhd.rows, 1);
-	    if (G__write_null_bits(null_fd, null_bits, row, cellhd.cols, 0) <
-		0)
+	    if (G__write_null_bits(null_fd, null_bits, row, cellhd.cols, 0) < 0)
 		G_fatal_error(_("Error writing null row %d"), row);
 	}
 	G_percent(row, cellhd.rows, 1);
@@ -330,6 +329,9 @@
 
     rast = G_allocate_raster_buf(map_type);
 
+    if (change_null)
+	G_debug(5, "new null=%.15g", new_null);
+
     G_verbose_message(_("Writing new data for raster map <%s>..."), name);
 
     /* the null file is written automatically */



More information about the grass-commit mailing list