[GRASS-SVN] r48397 - grass/trunk/lib/raster3d

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 21 13:54:06 EDT 2011


Author: huhabla
Date: 2011-09-21 10:54:06 -0700 (Wed, 21 Sep 2011)
New Revision: 48397

Modified:
   grass/trunk/lib/raster3d/close.c
Log:
Fixed wrong map name arguments in error messages. Fixed wrong return value validation when writing map history.


Modified: grass/trunk/lib/raster3d/close.c
===================================================================
--- grass/trunk/lib/raster3d/close.c	2011-09-21 16:20:28 UTC (rev 48396)
+++ grass/trunk/lib/raster3d/close.c	2011-09-21 17:54:06 UTC (rev 48397)
@@ -43,8 +43,8 @@
     Rast_command_history(&hist);
     /*Use the G3d function to write the history file,
      * otherwise the path is wrong */
-    if (!Rast3d_write_history(map->fileName, &hist)) {
-	G_warning(_("Unable to write history for 3D raster map <%s>"), map);
+    if (Rast3d_write_history(map->fileName, &hist) < 0) {
+	G_warning(_("Unable to write history for 3D raster map <%s>"), map->fileName);
     }
 
     Rast3d_range_write(map);
@@ -96,18 +96,18 @@
     }
 
     if (!Rast3d_write_ints(map->data_fd, map->useXdr, &(map->indexNbytesUsed), 1)) {
-	G_warning(_("Unable to write header for 3D raster map <%s>"), map);
+	G_warning(_("Unable to write header for 3D raster map <%s>"), map->fileName);
 	return 0;
     }
 
     Rast3d_long_encode(&(map->indexOffset), (unsigned char *)&ltmp, 1);
     if (write(map->data_fd, &ltmp, sizeof(long)) != sizeof(long)) {
-	G_warning(_("Unable to write header for 3D raster map <%s>"), map);
+	G_warning(_("Unable to write header for 3D raster map <%s>"), map->fileName);
 	return 0;
     }
 
     if (!close_new(map) != 0) {
-	G_warning(_("Unable to create 3D raster map <%s>"), map);
+	G_warning(_("Unable to create 3D raster map <%s>"), map->fileName);
 	return 0;
     }
 
@@ -117,7 +117,7 @@
 static int close_old(RASTER3D_Map * map)
 {
     if (close(map->data_fd) != 0) {
-	G_warning(_("Unable to close 3D raster map <%s>"), map);
+	G_warning(_("Unable to close 3D raster map <%s>"), map->fileName);
 	return 0;
     }
 
@@ -127,7 +127,7 @@
 static int close_cell_old(RASTER3D_Map * map)
 {
     if (!close_old(map) != 0) {
-	G_warning(_("Unable to close 3D raster map <%s>"), map);
+	G_warning(_("Unable to close 3D raster map <%s>"), map->fileName);
 	return 0;
     }
 
@@ -150,13 +150,13 @@
 {
     if (map->operation == RASTER3D_WRITE_DATA) {
 	if (!close_cell_new(map)) {
-	    G_warning(_("Unable to create 3D raster map <%s>"), map);
+	    G_warning(_("Unable to create 3D raster map <%s>"), map->fileName);
 	    return 0;
 	}
     }
     else {
 	if (!close_cell_old(map) != 0) {
-	    G_warning(_("Unable to close 3D raster map <%s>"), map);
+	    G_warning(_("Unable to close 3D raster map <%s>"), map->fileName);
 	    return 0;
 	}
     }
@@ -188,7 +188,7 @@
 			     map->compression, map->useRle, map->useLzw,
 			     map->precision, map->offset, map->useXdr,
 			     map->hasIndex, map->unit)) {
-	    G_warning(_("Unable to write header for 3D raster map <%s>"), map);
+	    G_warning(_("Unable to write header for 3D raster map <%s>"), map->fileName);
 	    return 0;
 	}
 



More information about the grass-commit mailing list