[GRASS-SVN] r33382 - grass/trunk/raster/wildfire/r.spread

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 10 08:27:17 EDT 2008


Author: hamish
Date: 2008-09-10 08:27:17 -0400 (Wed, 10 Sep 2008)
New Revision: 33382

Modified:
   grass/trunk/raster/wildfire/r.spread/cmd_line.h
   grass/trunk/raster/wildfire/r.spread/collect_ori.c
   grass/trunk/raster/wildfire/r.spread/main.c
   grass/trunk/raster/wildfire/r.spread/r.spread.html
Log:
cleanup

Modified: grass/trunk/raster/wildfire/r.spread/cmd_line.h
===================================================================
--- grass/trunk/raster/wildfire/r.spread/cmd_line.h	2008-09-10 12:18:05 UTC (rev 33381)
+++ grass/trunk/raster/wildfire/r.spread/cmd_line.h	2008-09-10 12:27:17 UTC (rev 33382)
@@ -28,7 +28,6 @@
 extern int least;
 extern int spotting;
 extern int time_lag;
-extern int verbose;
 extern int x_out;
 extern int y_out;
 #endif /* CMD_LINE_H */

Modified: grass/trunk/raster/wildfire/r.spread/collect_ori.c
===================================================================
--- grass/trunk/raster/wildfire/r.spread/collect_ori.c	2008-09-10 12:18:05 UTC (rev 33381)
+++ grass/trunk/raster/wildfire/r.spread/collect_ori.c	2008-09-10 12:27:17 UTC (rev 33382)
@@ -39,7 +39,6 @@
 int least;
 int spotting;
 int time_lag;
-int verbose;
 int x_out;
 int y_out;
 
@@ -57,18 +56,17 @@
     int row, col;
 
     for (row = 0; row < nrows; row++) {
-	if (verbose)
-	    G_percent(row, nrows, 2);
+	G_percent(row, nrows, 2);
+
 	if (G_get_map_row(start_fd, cell, row) < 0)
 	    exit(1);
+
 	for (col = 0; col < ncols; col++) {
 	    if (*(cell + col) > 0) {
 		/*Check if starting sources legally ? */
 		if (DATA(map_base, row, col) <= 0) {
-		    sprintf(buf,
-			    "can't start from a BARRIER at cell (%d,%d), request ignored\n",
+		    G_warning("Can't start from a BARRIER at cell (%d,%d), request ignored",
 			    col, row);
-		    G_warning(buf);
 		    continue;
 		}
 
@@ -76,6 +74,7 @@
 		insertHa((float)init_time, zero, row, col, heap, &heap_len);
 		/*mark it to avoid redundant computing */
 		DATA(map_visit, row, col) = 1;
+
 		if (x_out)
 		    DATA(map_x_out, row, col) = col;
 		if (y_out)
@@ -92,8 +91,9 @@
 	    }
 	}
     }
-    if (verbose)
-	G_percent(row, nrows, 2);
+
+    G_percent(row, nrows, 2);
+
 #ifdef DEBUG
     {
 	int i;

Modified: grass/trunk/raster/wildfire/r.spread/main.c
===================================================================
--- grass/trunk/raster/wildfire/r.spread/main.c	2008-09-10 12:18:05 UTC (rev 33381)
+++ grass/trunk/raster/wildfire/r.spread/main.c	2008-09-10 12:27:17 UTC (rev 33382)
@@ -88,7 +88,7 @@
     struct
     {
 	/* please, remove before GRASS 7 released */
-	struct Flag *display, *spotting, *verbose;
+	struct Flag *display, *spotting;
     } flag;
     struct GModule *module;
 
@@ -229,11 +229,6 @@
     parm.y_out->description =
 	_("Name of raster map to contain Y_BACK coordiates");
 
-    /* please, remove before GRASS 7 released */
-    flag.verbose = G_define_flag();
-    flag.verbose->key = 'v';
-    flag.verbose->description = _("Run VERBOSELY");
-
     flag.display = G_define_flag();
     flag.display->key = 'd';
 #if 0
@@ -253,13 +248,6 @@
 
     srand(getpid());
 
-    /* please, remove before GRASS 7 released */
-    if (flag.verbose->answer) {
-	putenv("GRASS_VERBOSE=0");
-	G_warning(_("The '-v' flag is superseded and will be removed "
-		    "in future. Please use '--verbose' instead."));
-    }
-
     display = flag.display->answer;
 #if 1
     if (display)
@@ -341,9 +329,8 @@
 
     /*  Get database window parameters  */
 
-    if (G_get_window(&window) < 0) {
+    if (G_get_window(&window) < 0)
 	G_fatal_error("can't read current window parameters");
-    }
 
     /*  find number of rows and columns in window    */
 
@@ -363,66 +350,57 @@
 
     /*  Check if input layers exists in data base  */
 
-    if (G_find_cell2(max_layer, "") == NULL) {
+    if (G_find_cell2(max_layer, "") == NULL)
 	G_fatal_error("Raster map <%s> not found", max_layer);
-    }
 
-    if (G_find_cell2(dir_layer, "") == NULL) {
+    if (G_find_cell2(dir_layer, "") == NULL)
 	G_fatal_error(_("Raster map <%s> not found"), dir_layer);
-    }
 
-    if (G_find_cell2(base_layer, "") == NULL) {
+    if (G_find_cell2(base_layer, "") == NULL)
 	G_fatal_error(_("Raster map <%s> not found"), base_layer);
-    }
 
-    if (G_find_cell2(start_layer, "") == NULL) {
+    if (G_find_cell2(start_layer, "") == NULL)
 	G_fatal_error(_("Raster map <%s> not found"), start_layer);
-    }
 
     if (spotting) {
-	if (G_find_cell2(spotdist_layer, "") == NULL) {
+	if (G_find_cell2(spotdist_layer, "") == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"), spotdist_layer);
-	}
-	if (G_find_cell2(velocity_layer, "") == NULL) {
+
+	if (G_find_cell2(velocity_layer, "") == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"), velocity_layer);
-	}
-	if (G_find_cell2(mois_layer, "") == NULL) {
+
+	if (G_find_cell2(mois_layer, "") == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"), mois_layer);
-	}
     }
 
     /*  Open input cell layers for reading  */
 
     max_fd = G_open_cell_old(max_layer, G_find_cell2(max_layer, ""));
-    if (max_fd < 0) {
+    if (max_fd < 0)
 	G_fatal_error(_("Unable to open raster map <%s>"), max_layer);
-    }
 
     dir_fd = G_open_cell_old(dir_layer, G_find_cell2(dir_layer, ""));
-    if (dir_fd < 0) {
+    if (dir_fd < 0)
 	G_fatal_error(_("Unable to open raster map <%s>"), dir_layer);
-    }
 
     base_fd = G_open_cell_old(base_layer, G_find_cell2(base_layer, ""));
-    if (base_fd < 0) {
+    if (base_fd < 0)
 	G_fatal_error(_("Unable to open raster map <%s>"), base_layer);
-    }
 
     if (spotting) {
 	spotdist_fd =
 	    G_open_cell_old(spotdist_layer, G_find_cell2(spotdist_layer, ""));
-	if (spotdist_fd < 0) {
+	if (spotdist_fd < 0)
 	    G_fatal_error(_("Unable to open raster map <%s>"), spotdist_layer);
-	}
+
 	velocity_fd =
 	    G_open_cell_old(velocity_layer, G_find_cell2(velocity_layer, ""));
-	if (velocity_fd < 0) {
+	if (velocity_fd < 0)
 	    G_fatal_error(_("Unable to open raster map <%s>"), velocity_layer);
-	}
+
 	mois_fd = G_open_cell_old(mois_layer, G_find_cell2(mois_layer, ""));
-	if (mois_fd < 0) {
+	if (mois_fd < 0)
 	    G_fatal_error(_("Unable to open raster map <%s>"), mois_layer);
-	}
     }
 
     /*  Allocate memories for a row  */
@@ -490,9 +468,8 @@
      */
 
     start_fd = G_open_cell_old(start_layer, G_find_cell2(start_layer, ""));
-    if (start_fd < 0) {
+    if (start_fd < 0)
 	G_fatal_error(_("Unable to open raster map <%s>"), start_layer);
-    }
 
     G_read_range(start_layer, G_find_file("cell", start_layer, ""), &range);
     G_get_range_min_max(&range, &range_min, &range_max);

Modified: grass/trunk/raster/wildfire/r.spread/r.spread.html
===================================================================
--- grass/trunk/raster/wildfire/r.spread/r.spread.html	2008-09-10 12:18:05 UTC (rev 33381)
+++ grass/trunk/raster/wildfire/r.spread/r.spread.html	2008-09-10 12:27:17 UTC (rev 33382)
@@ -38,10 +38,6 @@
 
 <H2>Flags:</H2>
 <DL>
- 
-<DT>-v
-<DD> Run verbosely, printing information about program progress to standard
-output.
 
 <DT>-d
 <DD> Display the "live" simulation on screen. A graphics window



More information about the grass-commit mailing list