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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 8 20:39:57 PST 2014


Author: hamish
Date: 2014-02-08 20:39:56 -0800 (Sat, 08 Feb 2014)
New Revision: 58959

Modified:
   grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
Log:
move G_get_window() out of loop since it doesn't change

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-09 01:55:26 UTC (rev 58958)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c	2014-02-09 04:39:56 UTC (rev 58959)
@@ -382,7 +382,6 @@
 
 	    if (rel_sa_x == -1.0 && rel_sa_y == -1.0) {
 		/* runtime disposition */
-
 		int sa_rl, sa_cl;
 
 		sa_rl = (int)rint(cellhd.rows * rel_sa_rl);
@@ -419,7 +418,6 @@
 		 strcmp(token, "SAMPLEAREA") == 0);
 
 	close(setup);
-
 	return toReturn;
     }
     else if (strcmp("MASKEDSAMPLEAREA", token) == 0) {
@@ -433,6 +431,7 @@
 	    rel_sa_rl = atof(strtok(NULL, "|"));
 	    rel_sa_cl = atof(strtok(NULL, "|"));
 	    strcpy(maskname, strtok(NULL, "\n"));
+
 	    if (rel_sa_x == -1 && rel_sa_y == -1) {
 		/* runtime disposition */
 		int sa_rl, sa_cl;
@@ -464,8 +463,10 @@
 		insertNode(l, m);
 	    }
 	}
+
 	while ((token = strtok(NULL, " ")) != NULL &&
 	       strcmp(token, "MASKEDSAMPLEAREA") == 0);
+
 	close(setup);
 	return NORMAL;
     }
@@ -473,8 +474,13 @@
 	double sa_n, sa_s, sa_w, sa_e;
 	int aid = 1;
 	char maskname[GNAME_MAX] = {'\0'};
+	struct Cell_head window;
 	msg m;
 
+	/* Get the window setting. g.region rast=<input raster> */
+	/*   ? same as cellhd above ? */
+	G_get_window(&window);
+
 	do {
 	    strcpy(maskname, strtok(NULL, "|"));
 	    sa_n = atof(strtok(NULL, "|"));
@@ -484,11 +490,6 @@
 
 	    m.type = MASKEDAREA;
 
-	    struct Cell_head window;
-
-	    /* Get the window setting. g.region rast=<input raster> */
-	    G_get_window(&window);
-
 	    /* Each input overlay area from input vector are converted to raster
 	       via v.to.rast. See r.li.setup/sample_area_vector.sh. This is to used 
 	       only for reading the region (NS, EW). */



More information about the grass-commit mailing list