[GRASS-SVN] r58896 - grass/branches/develbranch_6/raster/r.li/r.li.daemon

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 5 18:20:00 PST 2014


Author: hamish
Date: 2014-02-05 18:20:00 -0800 (Wed, 05 Feb 2014)
New Revision: 58896

Modified:
   grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
Log:
more readable variable name, define variables at start of function, percent done approach needs refinement

Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c	2014-02-06 02:08:40 UTC (rev 58895)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c	2014-02-06 02:20:00 UTC (rev 58896)
@@ -56,12 +56,10 @@
 
     wd child[num_workers];
 
-    /*int mv_rows, mv_cols; */
+    /* int mv_rows, mv_cols; */
     list l;
     msg m, doneJob;
 
-    int perc=0;
-
     g = (g_areas) G_malloc(sizeof(struct generatore));
     g->maskname = NULL;
     l = (list) G_malloc(sizeof(struct lista));
@@ -255,12 +253,10 @@
 	if (!(WIFEXITED(status)))
 	    G_warning(_("r.li.worker (pid %i) exited with abnormal status: %i"),
 		      donePid, status);
-	else {
+	else
 	    G_verbose_message(_("r.li.worker (pid %i) terminated successfully"),
 			      donePid);
-	    perc++;
-	    G_percent (perc, num_workers, 1);
-        }
+
 	/* remove pipe */
 	if (close(child[j].channel) != 0)
 	    G_message(_("Cannot close %s file (PIPE)"), child[j].pipe);
@@ -320,7 +316,7 @@
 {
     struct stat s;
     struct Cell_head cellhd;
-    char *buf, *token, *mapset;
+    char *buf, *token, *raster_fqn, *mapset;
     int setup;
     int letti;
     double rel_x, rel_y, rel_rl, rel_cl;
@@ -353,7 +349,7 @@
 
     /* find raster map */
     mapset = G_find_cell(raster, "");
-    char * raster_ = G_fully_qualified_name(raster, mapset);
+    raster_fqn = G_fully_qualified_name(raster, mapset);
    
     if (G_get_cellhd(raster, mapset, &cellhd) == -1)
 	G_fatal_error(_("Cannot read raster header file"));
@@ -475,7 +471,7 @@
     else if (strcmp("MASKEDOVERLAYAREA", token) == 0) {
 	double sa_n, sa_s, sa_w, sa_e;
 	int aid = 1;
-	char maskname[GNAME_MAX] = { '\0' };
+	char maskname[GNAME_MAX] = {'\0'};
 	msg m;
 
 	do {
@@ -516,9 +512,10 @@
 	    G_fatal_error(_("Irregular maskedoverlay areas definition"));
 
 	token = strtok(NULL, "\n");
-	if (strcmp(token, raster_) != 0)
-	    G_fatal_error(_("The configuration file can be used only with \
-			%s rasterfile and not with %s "), token, raster_);
+	if (strcmp(token, raster_fqn) != 0)
+	    G_fatal_error(_("The configuration file can be used only with "
+			"rasterfile <%s> and not with <%s>"), token, raster_fqn);
+
 	close(setup);
 	return NORMAL;
     }



More information about the grass-commit mailing list