[GRASS-SVN] r34079 - grass/branches/develbranch_6/raster/r.terraflow

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 29 23:42:33 EDT 2008


Author: hamish
Date: 2008-10-29 23:42:33 -0400 (Wed, 29 Oct 2008)
New Revision: 34079

Modified:
   grass/branches/develbranch_6/raster/r.terraflow/main.cc
Log:
some G_message

Modified: grass/branches/develbranch_6/raster/r.terraflow/main.cc
===================================================================
--- grass/branches/develbranch_6/raster/r.terraflow/main.cc	2008-10-30 03:28:52 UTC (rev 34078)
+++ grass/branches/develbranch_6/raster/r.terraflow/main.cc	2008-10-30 03:42:33 UTC (rev 34079)
@@ -230,7 +230,7 @@
     RASTER_MAP_TYPE data_type;
 	data_type = G_raster_map_type(opt->elev_grid, mapset);
 #ifdef ELEV_SHORT
-	G_message(_("elevation stored as SHORT (%dB)"),
+	G_verbose_message(_("Elevation stored as SHORT (%dB)"),
 		sizeof(elevation_type));
 	if (data_type == FCELL_TYPE) {
 	  G_warning(_("raster %s is of type FCELL_TYPE "
@@ -242,7 +242,7 @@
 	}
 #endif 
 #ifdef ELEV_FLOAT
-	G_message( _("elevation stored as FLOAT (%dB)"), 
+	G_verbose_message( _("Elevation stored as FLOAT (%dB)"), 
 			sizeof(elevation_type));
 	if (data_type == CELL_TYPE) {
 	  G_warning(_("raster %s is of type CELL_TYPE "
@@ -339,7 +339,7 @@
   size_t mm_size = opt->mem  << 20; /* (in bytes) */
   char tmp[100];
   formatNumber(tmp, mm_size);
-  sprintf(buf,"memory size: %s bytes", tmp);
+  sprintf(buf, "Memory size: %s bytes", tmp);
   stats->comment(buf);
 }
 
@@ -421,18 +421,19 @@
   long long maxneed = (fillmaxsize > flowmaxsize) ? fillmaxsize: flowmaxsize;
   maxneed =  2*maxneed; /* need 2*N to sort */
 
-  fprintf(stderr, "total elements=%ld, nodata elements=%ld\n", (long)nrows*ncols, nodata_count);
-  fprintf(stderr, "largest temporary files: \n");
-  fprintf(stderr, "\t\t FILL: %s [%d elements, %dB each]\n",
+  G_message( "total elements=%ld, nodata elements=%ld",
+		(long)nrows*ncols, nodata_count);
+  G_message( "largest temporary files: ");
+  G_message( "\t\t FILL: %s [%d elements, %dB each]",
 		  formatNumber(buf, fillmaxsize),
 		  nrows * ncols, sizeof(waterWindowType));
-  fprintf(stderr, "\t\t FLOW: %s [%ld elements, %dB each]\n",
+  G_message( "\t\t FLOW: %s [%ld elements, %dB each]",
 		  formatNumber(buf, flowmaxsize),
 		  (long)(nrows * ncols - nodata_count), sizeof(sweepItem));
-  fprintf(stderr, "Will need at least %s space available in %s\n",
-		  formatNumber(buf, maxneed),  		  /* need 2*N to sort */
+  G_message( "Will need at least %s space available in %s",
+		  formatNumber(buf, maxneed),  	  /* need 2*N to sort */
 		  getenv(STREAM_TMPDIR));
- 
+
 #ifdef HAVE_STATVFS_H
   fprintf(stderr, "Checking current space in %s: ", getenv(STREAM_TMPDIR));
   struct statvfs statbuf;
@@ -445,7 +446,7 @@
 	fprintf(stderr, ". OK.\n");
   } else {
 	fprintf(stderr, ". Not enough space available.\n");
-	exit(1);
+	exit(EXIT_FAILURE);
   }
 #endif
 }
@@ -459,11 +460,6 @@
   Rtimer rtTotal;    
   char buf[BUFSIZ];
 
-/* this disturbs the parser
-  fprintf(stderr, "r.terraflow December 2003\n");
-  fflush(stderr);
-*/
-
   /* initialize GIS library */
   G_gisinit(argv[0]);
 
@@ -499,8 +495,7 @@
   parse_args(argc, argv);
   check_args();
 
-  fprintf(stderr, "region size is %d x %d\n", nrows, ncols);
-  fflush(stderr);
+  G_verbose_message( _("Region size is %d x %d"), nrows, ncols);
  
   /* check STREAM path (the place where intermediate STREAMs are placed) */
   sprintf(buf, "%s=%s",STREAM_TMPDIR, opt->streamdir);



More information about the grass-commit mailing list