[GRASS-SVN] r59418 - grass/trunk/raster/r.stream.extract

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Mar 27 07:13:51 PDT 2014


Author: martinl
Date: 2014-03-27 07:13:50 -0700 (Thu, 27 Mar 2014)
New Revision: 59418

Modified:
   grass/trunk/raster/r.stream.extract/bseg.c
   grass/trunk/raster/r.stream.extract/close.c
   grass/trunk/raster/r.stream.extract/cseg.c
   grass/trunk/raster/r.stream.extract/del_streams.c
   grass/trunk/raster/r.stream.extract/do_astar.c
   grass/trunk/raster/r.stream.extract/dseg.c
   grass/trunk/raster/r.stream.extract/init_search.c
   grass/trunk/raster/r.stream.extract/load.c
   grass/trunk/raster/r.stream.extract/main.c
   grass/trunk/raster/r.stream.extract/seg.c
   grass/trunk/raster/r.stream.extract/streams.c
Log:
r.stream.extract: messages consolidation


Modified: grass/trunk/raster/r.stream.extract/bseg.c
===================================================================
--- grass/trunk/raster/r.stream.extract/bseg.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/bseg.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -16,7 +16,7 @@
 
     filename = G_tempfile();
     if (-1 == (fd = creat(filename, 0666))) {
-	G_warning(_("bseg_open(): unable to create segment file"));
+	G_warning(_("Unable to create segment file"));
 	return -2;
     }
     if (0 > (errflag = segment_format(fd, Rast_window_rows(),
@@ -25,29 +25,29 @@
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("bseg_open(): could not write segment file"));
+	    G_warning(_("Unable to write segment file"));
 	    return -1;
 	}
 	else {
-	    G_warning(_("bseg_open(): illegal configuration parameter(s)"));
+	    G_warning(_("Illegal configuration parameter(s)"));
 	    return -3;
 	}
     }
     close(fd);
     if (-1 == (fd = open(filename, 2))) {
 	unlink(filename);
-	G_warning(_("bseg_open(): unable to re-open segment file"));
+	G_warning(_("Unable to re-open segment file"));
 	return -4;
     }
     if (0 > (errflag = segment_init(&(bseg->seg), fd, nsegs_in_memory))) {
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("bseg_open(): could not read segment file"));
+	    G_warning(_("Unable to read segment file"));
 	    return -5;
 	}
 	else {
-	    G_warning(_("bseg_open(): out of memory"));
+	    G_warning(_("Out of memory"));
 	    return -6;
 	}
     }
@@ -75,7 +75,7 @@
 int bseg_put(BSEG *bseg, char *value, int row, int col)
 {
     if (segment_put(&(bseg->seg), value, row, col) < 0) {
-	G_warning(_("bseg_put(): could not write segment file"));
+	G_warning(_("Unable to write segment file"));
 	return -1;
     }
     return 0;
@@ -84,7 +84,7 @@
 int bseg_put_row(BSEG *bseg, char *value, int row)
 {
     if (segment_put_row(&(bseg->seg), value, row) < 0) {
-	G_warning(_("bseg_put_row(): could not write segment file"));
+	G_warning(_("Unable to write segment file"));
 	return -1;
     }
     return 0;
@@ -93,7 +93,7 @@
 int bseg_get(BSEG *bseg, char *value, int row, int col)
 {
     if (segment_get(&(bseg->seg), value, row, col) < 0) {
-	G_warning(_("bseg_get(): could not read segment file"));
+	G_warning(_("Unable to read segment file"));
 	return -1;
     }
     return 0;

Modified: grass/trunk/raster/r.stream.extract/close.c
===================================================================
--- grass/trunk/raster/r.stream.extract/close.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/close.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -33,10 +33,8 @@
 
     G_message(_("Writing vector map <%s>..."), stream_vect);
 
-    if (0 > Vect_open_new(&Out, stream_vect, 0)) {
-	G_fatal_error(_("Unable to create vector map <%s>"), stream_vect);
-    }
-
+    Vect_open_new(&Out, stream_vect, 0);
+    
     nodestack = (struct sstack *)G_malloc(stack_step * sizeof(struct sstack));
 
     Points = Vect_new_line_struct();
@@ -115,7 +113,8 @@
 
 		cseg_get(&stream, &stream_nbr, r_nbr, c_nbr);
 		if (stream_nbr <= 0)
-		    G_fatal_error("stream id %d not set, top is %d, parent is %d", stream_id, top, nodestack[top - 1].stream_id);
+                    G_fatal_error(_("Stream id %d not set, top is %d, parent is %d"),
+                                  stream_id, top, nodestack[top - 1].stream_id);
 
 		Vect_cat_set(Cats, 1, stream_id);
 		if (stream_node[stream_id].n_trib == 0)
@@ -135,7 +134,7 @@
 		    
 		    cseg_get(&stream, &stream_nbr, r_nbr, c_nbr);
 		    if (stream_nbr <= 0)
-			G_fatal_error("stream id not set while tracing");
+			G_fatal_error(_("Stream id not set while tracing"));
 
 		    Vect_append_point(Points, west_offset + c_nbr * ew_res,
 				      north_offset - r_nbr * ns_res, 0);
@@ -154,7 +153,7 @@
     }
     G_percent(n_outlets, n_outlets, 1);	/* finish it */
 
-    G_message(_("Write vector attribute table"));
+    G_message(_("Writing attribute data..."));
 
     /* Prepeare strings for use in db_* calls */
     db_init_string(&dbsql);
@@ -184,15 +183,15 @@
     if (db_execute_immediate(driver, &dbsql) != DB_OK) {
 	db_close_database(driver);
 	db_shutdown_driver(driver);
-	G_fatal_error(_("Cannot create table: %s"), db_get_string(&dbsql));
+	G_fatal_error(_("Unable to create table: '%s'"), db_get_string(&dbsql));
     }
 
     if (db_create_index2(driver, Fi->table, cat_col_name) != DB_OK)
-	G_warning(_("Cannot create index"));
+	G_warning(_("Unable to create index on table <%s>"), Fi->table);
 
     if (db_grant_on_table(driver, Fi->table, DB_PRIV_SELECT,
 			  DB_GROUP | DB_PUBLIC) != DB_OK)
-	G_fatal_error(_("Cannot grant privileges on table %s"), Fi->table);
+	G_fatal_error(_("Unable to grant privileges on table <%s>"), Fi->table);
 
     db_begin_transaction(driver);
 
@@ -209,7 +208,7 @@
 	if (db_execute_immediate(driver, &dbsql) != DB_OK) {
 	    db_close_database(driver);
 	    db_shutdown_driver(driver);
-	    G_fatal_error(_("Cannot insert new row: %s"),
+	    G_fatal_error(_("Unable to insert new row: '%s'"),
 			  db_get_string(&dbsql));
 	}
     }
@@ -244,9 +243,8 @@
     stream_fd = dir_fd = -1;
     cell_buf1 = cell_buf2 = NULL;
 
-    G_message(_("Writing raster %s"),
-              (stream_rast != NULL) + (dir_rast != NULL) > 1 ? "maps" : "map");
-
+    G_message(_("Writing output raster maps..."));
+    
     /* write requested output rasters */
     if (stream_rast) {
 	stream_fd = Rast_open_new(stream_rast, CELL_TYPE);

Modified: grass/trunk/raster/r.stream.extract/cseg.c
===================================================================
--- grass/trunk/raster/r.stream.extract/cseg.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/cseg.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -16,7 +16,7 @@
 
     filename = G_tempfile();
     if (-1 == (fd = creat(filename, 0666))) {
-	G_warning(_("cseg_open(): unable to create segment file"));
+	G_warning(_("Unable to create segment file"));
 	return -2;
     }
     if (0 >
@@ -26,29 +26,29 @@
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("cseg_open(): could not write segment file"));
+	    G_warning(_("Unable to write segment file"));
 	    return -1;
 	}
 	else {
-	    G_warning(_("cseg_open(): illegal configuration parameter(s)"));
+	    G_warning(_("Illegal configuration parameter(s)"));
 	    return -3;
 	}
     }
     close(fd);
     if (-1 == (fd = open(filename, 2))) {
 	unlink(filename);
-	G_warning(_("cseg_open(): unable to re-open segment file"));
+	G_warning(_("Unable to re-open segment file"));
 	return -4;
     }
     if (0 > (errflag = segment_init(&(cseg->seg), fd, nsegs_in_memory))) {
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("cseg_open(): could not read segment file"));
+	    G_warning(_("Unable to read segment file"));
 	    return -5;
 	}
 	else {
-	    G_warning(_("cseg_open(): out of memory"));
+	    G_warning(_("Out of memory"));
 	    return -6;
 	}
     }
@@ -76,7 +76,7 @@
 int cseg_put(CSEG *cseg, CELL *value, int row, int col)
 {
     if (segment_put(&(cseg->seg), value, row, col) < 0) {
-	G_warning(_("cseg_put(): could not write segment file"));
+	G_warning(_("Unable to write segment file"));
 	return -1;
     }
     return 0;
@@ -85,7 +85,7 @@
 int cseg_put_row(CSEG *cseg, CELL *value, int row)
 {
     if (segment_put_row(&(cseg->seg), value, row) < 0) {
-	G_warning(_("cseg_put_row(): could not write segment file"));
+	G_warning(_("Unable to write segment file"));
 	return -1;
     }
     return 0;
@@ -94,7 +94,7 @@
 int cseg_get(CSEG *cseg, CELL *value, int row, int col)
 {
     if (segment_get(&(cseg->seg), value, row, col) < 0) {
-	G_warning(_("cseg_get(): could not read segment file"));
+	G_warning(_("Unabel to read segment file"));
 	return -1;
     }
     return 0;
@@ -117,9 +117,9 @@
 	if (segment_put_row(&(cseg->seg), buffer, row) < 0) {
 	    G_free(buffer);
 	    Rast_close(map_fd);
-	    G_warning(_("cseg_read_cell(): unable to segment put row for <%s> in <%s>"),
-		    map_name, mapset);
-	    return (-1);
+	    G_warning(_("Unable to segment put row %d for raster map <%s>"),
+                      row, map_name);
+	    return -1;
 	}
     }
 

Modified: grass/trunk/raster/r.stream.extract/del_streams.c
===================================================================
--- grass/trunk/raster/r.stream.extract/del_streams.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/del_streams.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -60,7 +60,7 @@
     c = stream_node[stream_id].c;
     cseg_get(&stream, &curr_stream, r, c);
     if (curr_stream != stream_id)
-	G_fatal_error("update downstream id: curr_stream != stream_id");
+	G_fatal_error("Update downstream id: curr_stream != stream_id");
     cseg_put(&stream, &new_stream, r, c);
     curr_stream = stream_id;
 
@@ -128,8 +128,8 @@
     int slength;
 
     G_message(_n("Deleting stream segments shorter than %d cell...",
-        "Deleting stream segments shorter than %d cells...", min_length),
-        min_length);
+                 "Deleting stream segments shorter than %d cells...", min_length),
+              min_length);
 
     /* TODO: proceed from stream heads to outlets
      *       -> use depth first post order traversal */
@@ -191,7 +191,7 @@
     }
 
     G_verbose_message(_n("%d stream segment deleted", 
-        "%d stream segments deleted", n_deleted), n_deleted);
+                         "%d stream segments deleted", n_deleted), n_deleted);
 
     return n_deleted;
 }

Modified: grass/trunk/raster/r.stream.extract/do_astar.c
===================================================================
--- grass/trunk/raster/r.stream.extract/do_astar.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/do_astar.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -59,12 +59,12 @@
     while (heap_size > 0) {
 	G_percent(count++, n_points, 1);
 	if (count > n_points)
-	    G_fatal_error(_("BUG in A* Search: %lld surplus points"),
+	    G_fatal_error(_("%lld surplus points"),
 	                  heap_size);
 
 	if (heap_size > n_points)
 	    G_fatal_error
-		(_("BUG in A* Search: too many points in heap %lld, should be %lld"),
+		(_("Too many points in heap %lld, should be %lld"),
 		 heap_size, n_points);
 
 	heap_p = heap_drop();

Modified: grass/trunk/raster/r.stream.extract/dseg.c
===================================================================
--- grass/trunk/raster/r.stream.extract/dseg.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/dseg.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -26,29 +26,29 @@
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("dseg_open(): could not write segment file"));
+	    G_warning(_("Unable to write segment file"));
 	    return -1;
 	}
 	else {
-	    G_warning(_("dseg_open(): illegal configuration parameter(s)"));
+	    G_warning(_("Iillegal configuration parameter(s)"));
 	    return -3;
 	}
     }
     close(fd);
     if (-1 == (fd = open(filename, 2))) {
 	unlink(filename);
-	G_warning(_("dseg_open(): unable to re-open segment file"));
+	G_warning(_("Unable to re-open segment file"));
 	return -4;
     }
     if (0 > (errflag = segment_init(&(dseg->seg), fd, nsegs_in_memory))) {
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("dseg_open(): could not read segment file"));
+	    G_warning(_("Unable to read segment file"));
 	    return -5;
 	}
 	else {
-	    G_warning(_("dseg_open(): out of memory"));
+	    G_warning(_("Out of memory"));
 	    return -6;
 	}
     }
@@ -76,7 +76,7 @@
 int dseg_put(DSEG *dseg, DCELL *value, int row, int col)
 {
     if (segment_put(&(dseg->seg), (DCELL *) value, row, col) < 0) {
-	G_warning(_("dseg_put(): could not write segment file"));
+	G_warning(_("Unable to write segment file"));
 	return -1;
     }
     return 0;
@@ -85,7 +85,7 @@
 int dseg_put_row(DSEG *dseg, DCELL *value, int row)
 {
     if (segment_put_row(&(dseg->seg), (DCELL *) value, row) < 0) {
-	G_warning(_("dseg_put(): could not write segment file"));
+	G_warning(_("Unable to write segment file"));
 	return -1;
     }
     return 0;
@@ -94,7 +94,7 @@
 int dseg_get(DSEG *dseg, DCELL *value, int row, int col)
 {
     if (segment_get(&(dseg->seg), (DCELL *) value, row, col) < 0) {
-	G_warning(_("dseg_get(): could not read segment file"));
+	G_warning(_("Unable to read segment file"));
 	return -1;
     }
     return 0;
@@ -117,9 +117,9 @@
 	if (segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) {
 	    G_free(dbuffer);
 	    Rast_close(map_fd);
-	    G_warning(_("dseg_read_raster(): unable to segment put row for <%s> in <%s>"),
-		    map_name, mapset);
-	    return (-1);
+	    G_warning(_("Inable to segment put row %d for raster <%s>"),
+                      row, map_name);
+	    return -1;
 	}
     }
 

Modified: grass/trunk/raster/r.stream.extract/init_search.c
===================================================================
--- grass/trunk/raster/r.stream.extract/init_search.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/init_search.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -21,7 +21,7 @@
     else
 	depr_buf = NULL;
 
-    G_message(_("Initializing A* Search..."));
+    G_message(_("Initializing A* search..."));
     for (r = 0; r < nrows; r++) {
 	G_percent(r, nrows, 2);
 

Modified: grass/trunk/raster/r.stream.extract/load.c
===================================================================
--- grass/trunk/raster/r.stream.extract/load.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/load.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -30,9 +30,9 @@
     ASP_FLAG *afbuf;
 
     if (acc_fd < 0)
-	G_message(_("Loading elevation map..."));
+	G_message(_("Loading elevation raster map..."));
     else
-	G_message(_("Loading input maps..."));
+	G_message(_("Loading input raster maps..."));
 
     n_search_points = n_points = 0;
 
@@ -41,7 +41,7 @@
     ele_buf = Rast_allocate_buf(ele_map_type);
 
     if (ele_buf == NULL) {
-	G_warning(_("Could not allocate memory"));
+	G_warning(_("Unable to allocate memory"));
 	return -1;
     }
 
@@ -50,7 +50,7 @@
 	acc_size = Rast_cell_size(acc_map_type);
 	acc_buf = Rast_allocate_buf(acc_map_type);
 	if (acc_buf == NULL) {
-	    G_warning(_("Could not allocate memory"));
+	    G_warning(_("Unable to allocate memory"));
 	    return -1;
 	}
     }
@@ -92,7 +92,7 @@
 		/* flow accumulation */
 		if (acc_fd >= 0) {
 		    if (!Rast_is_null_value(acc_ptr, acc_map_type))
-			G_fatal_error(_("Elevation map is NULL but accumulation map is not NULL!"));
+			G_fatal_error(_("Elevation raster map is NULL but accumulation map is not NULL"));
 		}
 		Rast_set_d_null_value(&acc_value, 1);
 	    }
@@ -117,7 +117,7 @@
 		else {
 		    if (Rast_is_null_value(acc_ptr, acc_map_type)) {
 			/* can this be ok after weighing ? */
-			G_fatal_error(_("Accumulation map is NULL but elevation map is not NULL!"));
+			G_fatal_error(_("Accumulation raster map is NULL but elevation map is not NULL"));
 		    }
 
 		    switch (acc_map_type) {

Modified: grass/trunk/raster/r.stream.extract/main.c
===================================================================
--- grass/trunk/raster/r.stream.extract/main.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/main.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -86,15 +86,15 @@
     input.acc->required = NO;
     input.acc->description =
 	_("Stream extraction will use provided accumulation instead of calculating it anew");
-    input.acc->guisection = _("Input options");
+    input.acc->guisection = _("Input maps");
 
     input.depression = G_define_standard_option(G_OPT_R_INPUT);
     input.depression->key = "depression";
-    input.depression->label = _("Name of raster map with real depressions");
+    input.depression->label = _("Name of input raster map with real depressions");
     input.depression->required = NO;
     input.depression->description =
 	_("Streams will not be routed out of real depressions");
-    input.depression->guisection = _("Input options");
+    input.depression->guisection = _("Input maps");
 
     input.threshold = G_define_option();
     input.threshold->key = "threshold";
@@ -121,7 +121,7 @@
     input.mont_exp->label =
 	_("Montgomery exponent for slope, disabled with 0");
     input.mont_exp->description =
-	_("Montgomery: accumulation is multiplied with pow(slope,mexp) and then compared with threshold.");
+	_("Montgomery: accumulation is multiplied with pow(slope,mexp) and then compared with threshold");
 
     input.min_stream_length = G_define_option();
     input.min_stream_length->key = "stream_length";
@@ -129,9 +129,9 @@
     input.min_stream_length->required = NO;
     input.min_stream_length->answer = "0";
     input.min_stream_length->label =
-	_("Delete stream segments shorter than stream_length cells.");
+	_("Delete stream segments shorter than stream_length cells");
     input.min_stream_length->description =
-	_("Applies only to first-order stream segments (springs/stream heads).");
+	_("Applies only to first-order stream segments (springs/stream heads)");
 
     input.memory = G_define_option();
     input.memory->key = "memory";
@@ -145,27 +145,27 @@
     output.stream_rast->description =
 	_("Name for output raster map with unique stream ids");
     output.stream_rast->required = NO;
-    output.stream_rast->guisection = _("Output options");
+    output.stream_rast->guisection = _("Output maps");
 
     output.stream_vect = G_define_standard_option(G_OPT_V_OUTPUT);
     output.stream_vect->key = "stream_vect";
     output.stream_vect->description =
 	_("Name for output vector map with unique stream ids");
     output.stream_vect->required = NO;
-    output.stream_vect->guisection = _("Output options");
+    output.stream_vect->guisection = _("Output maps");
 
     output.dir_rast = G_define_standard_option(G_OPT_R_OUTPUT);
     output.dir_rast->key = "direction";
     output.dir_rast->description =
 	_("Name for output raster map with flow direction");
     output.dir_rast->required = NO;
-    output.dir_rast->guisection = _("Output options");
+    output.dir_rast->guisection = _("Output maps");
 
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     /***********************/
-    /*    check options    */
+    /*    check options   */
     /***********************/
 
     /* input maps exist ? */
@@ -237,7 +237,7 @@
     if ((output.stream_rast->answer == NULL)
 	&& (output.stream_vect->answer == NULL)
 	&& (output.dir_rast->answer == NULL)) {
-	G_fatal_error(_("Sorry, you must choose at least one output map."));
+	G_fatal_error(_("At least one output raster maps must be specified"));
     }
 
     /*********************/
@@ -247,15 +247,10 @@
     /* open input maps */
     mapset = G_find_raster2(input.ele->answer, "");
     ele_fd = Rast_open_old(input.ele->answer, mapset);
-    if (ele_fd < 0)
-	G_fatal_error(_("Could not open input map %s"), input.ele->answer);
 
     if (input.acc->answer) {
 	mapset = G_find_raster2(input.acc->answer, "");
 	acc_fd = Rast_open_old(input.acc->answer, mapset);
-	if (acc_fd < 0)
-	    G_fatal_error(_("Could not open input map %s"),
-			  input.acc->answer);
     }
     else
 	acc_fd = -1;
@@ -263,9 +258,6 @@
     if (input.depression->answer) {
 	mapset = G_find_raster2(input.depression->answer, "");
 	depr_fd = Rast_open_old(input.depression->answer, mapset);
-	if (depr_fd < 0)
-	    G_fatal_error(_("Could not open input map %s"),
-			  input.depression->answer);
     }
     else
 	depr_fd = -1;
@@ -349,9 +341,9 @@
 
     /* load maps */
     if (load_maps(ele_fd, acc_fd) < 0)
-	G_fatal_error(_("Could not load input map(s)"));
+	G_fatal_error(_("Unable to load input raster map(s)"));
     else if (!n_points)
-	G_fatal_error(_("No non-NULL cells in input map(s)"));
+	G_fatal_error(_("No non-NULL cells in input raster map(s)"));
 
     G_debug(1, "open segments for A* points");
     /* columns per segment */
@@ -402,40 +394,40 @@
 
     /* initialize A* search */
     if (init_search(depr_fd) < 0)
-	G_fatal_error(_("Could not initialize search"));
+	G_fatal_error(_("Unable to initialize search"));
 
     /* sort elevation and get initial stream direction */
     if (do_astar() < 0)
-	G_fatal_error(_("Could not sort elevation map"));
+	G_fatal_error(_("Unable to sort elevation raster map values"));
     seg_close(&search_heap);
 
     if (acc_fd < 0) {
 	/* accumulate surface flow */
 	if (do_accum(d8cut) < 0)
-	    G_fatal_error(_("Could not calculate flow accumulation"));
+	    G_fatal_error(_("Unable to calculate flow accumulation"));
     }
 
     /* extract streams */
     if (extract_streams(threshold, mont_exp, acc_fd < 0) < 0)
-	G_fatal_error(_("Could not extract streams"));
+	G_fatal_error(_("Unable to extract streams"));
 
     seg_close(&astar_pts);
     seg_close(&watalt);
 
     /* thin streams */
     if (thin_streams() < 0)
-	G_fatal_error(_("Could not thin streams"));
+	G_fatal_error(_("Unable to thin streams"));
 
     /* delete short streams */
     if (min_stream_length) {
 	if (del_streams(min_stream_length) < 0)
-	    G_fatal_error(_("Could not delete short stream segments"));
+	    G_fatal_error(_("Unable to delete short stream segments"));
     }
 
     /* write output maps */
     if (close_maps(output.stream_rast->answer, output.stream_vect->answer,
 		   output.dir_rast->answer) < 0)
-	G_fatal_error(_("Could not write output maps"));
+	G_fatal_error(_("Unable to write output raster maps"));
 
     cseg_close(&stream);
     seg_close(&aspflag);

Modified: grass/trunk/raster/r.stream.extract/seg.c
===================================================================
--- grass/trunk/raster/r.stream.extract/seg.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/seg.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -16,7 +16,7 @@
 
     filename = G_tempfile();
     if (-1 == (fd = creat(filename, 0666))) {
-	G_warning(_("seg_open(): unable to create segment file"));
+	G_warning(_("Unable to create segment file"));
 	return -2;
     }
     if (fill)
@@ -30,29 +30,29 @@
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("seg_open(): could not write segment file"));
+	    G_warning(_("Unable to write segment file"));
 	    return -1;
 	}
 	else {
-	    G_warning(_("seg_open(): illegal configuration parameter(s)"));
+	    G_warning(_("Illegal configuration parameter(s)"));
 	    return -3;
 	}
     }
     close(fd);
     if (-1 == (fd = open(filename, 2))) {
 	unlink(filename);
-	G_warning(_("seg_open(): unable to re-open segment file"));
+	G_warning(_("Unable to re-open file '%s'"), filename);
 	return -4;
     }
     if (0 > (errflag = segment_init(&(sseg->seg), fd, nsegs_in_memory))) {
 	close(fd);
 	unlink(filename);
 	if (errflag == -1) {
-	    G_warning(_("seg_open(): could not read segment file"));
+	    G_warning(_("Unable to read segment file"));
 	    return -5;
 	}
 	else {
-	    G_warning(_("seg_open(): out of memory"));
+	    G_warning(_("Out of memory"));
 	    return -6;
 	}
     }
@@ -72,7 +72,7 @@
 int seg_put(SSEG *sseg, char *value, int row, int col)
 {
     if (segment_put(&(sseg->seg), value, row, col) < 0) {
-	G_warning(_("seg_put(): could not write segment file"));
+	G_warning(_("Unable to write segment file"));
 	return -1;
     }
     return 0;
@@ -90,7 +90,7 @@
 int seg_get(SSEG *sseg, char *value, int row, int col)
 {
     if (segment_get(&(sseg->seg), value, row, col) < 0) {
-	G_warning(_("seg_get(): could not read segment file"));
+	G_warning(_("Unable to read segment file"));
 	return -1;
     }
     return 0;
@@ -99,7 +99,7 @@
 int seg_get_row(SSEG *sseg, char *value, int row)
 {
     if (segment_get_row(&(sseg->seg), value, row) < 0) {
-	G_warning(_("seg_get_row(): could not read segment file"));
+	G_warning(_("Unable to read segment file"));
 	return -1;
     }
     return 0;

Modified: grass/trunk/raster/r.stream.extract/streams.c
===================================================================
--- grass/trunk/raster/r.stream.extract/streams.c	2014-03-27 14:08:45 UTC (rev 59417)
+++ grass/trunk/raster/r.stream.extract/streams.c	2014-03-27 14:13:50 UTC (rev 59418)
@@ -69,7 +69,7 @@
 
 	/* debug */
 	if (n_stream_nodes != *stream_no)
-	    G_warning(_("BUG: stream_no %d and n_stream_nodes %lld out of sync"),
+	    G_warning(_("Stream_no %d and n_stream_nodes %lld out of sync"),
 		      *stream_no, n_stream_nodes);
 
 	stream_node[*stream_no].n_alloc += 2;
@@ -665,7 +665,7 @@
 
 	    /* debug */
 	    if (n_stream_nodes != stream_no)
-		G_warning(_("BUG: stream_no %d and n_stream_nodes %lld out of sync"),
+		G_warning(_("Stream_no %d and n_stream_nodes %lld out of sync"),
 			  stream_no, n_stream_nodes);
 	}
 



More information about the grass-commit mailing list