[GRASS-SVN] r59040 - grass/trunk/raster/r.li/r.li.daemon
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 14 02:26:23 PST 2014
Author: mmetz
Date: 2014-02-14 02:26:22 -0800 (Fri, 14 Feb 2014)
New Revision: 59040
Modified:
grass/trunk/raster/r.li/r.li.daemon/daemon.c
grass/trunk/raster/r.li/r.li.daemon/list.c
grass/trunk/raster/r.li/r.li.daemon/worker.c
Log:
r.li.daemon: fix parseSetup, memory management, mask
Modified: grass/trunk/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/trunk/raster/r.li/r.li.daemon/daemon.c 2014-02-14 09:46:54 UTC (rev 59039)
+++ grass/trunk/raster/r.li/r.li.daemon/daemon.c 2014-02-14 10:26:22 UTC (rev 59040)
@@ -365,7 +365,7 @@
/* Get start x and y position of masked overlay raster with
respect to input raster region from window.
sa_n, sa_e are read from configuration file. */
- m.f.f_ma.x = (int)Rast_easting_to_col(sa_e, &window);
+ m.f.f_ma.x = (int)Rast_easting_to_col(sa_w, &window);
m.f.f_ma.y = (int)Rast_northing_to_row(sa_n, &window);
/* Get row count and column count of overlay raster */
Modified: grass/trunk/raster/r.li/r.li.daemon/list.c
===================================================================
--- grass/trunk/raster/r.li/r.li.daemon/list.c 2014-02-14 09:46:54 UTC (rev 59039)
+++ grass/trunk/raster/r.li/r.li.daemon/list.c 2014-02-14 10:26:22 UTC (rev 59040)
@@ -65,7 +65,8 @@
struct node *tmp = l->head;
l->head = NULL;
- free(tmp);
+ G_free(tmp->m);
+ G_free(tmp);
l->size--;
}
else {
@@ -73,7 +74,8 @@
l->head = l->head->next;
l->head->prev = NULL;
- free(tmp);
+ G_free(tmp->m);
+ G_free(tmp);
l->size--;
}
}
Modified: grass/trunk/raster/r.li/r.li.daemon/worker.c
===================================================================
--- grass/trunk/raster/r.li/r.li.daemon/worker.c 2014-02-14 09:46:54 UTC (rev 59039)
+++ grass/trunk/raster/r.li/r.li.daemon/worker.c 2014-02-14 10:26:22 UTC (rev 59040)
@@ -138,11 +138,7 @@
if (strcmp(m->f.f_ma.mask, ad->mask_name) != 0)
/* temporary mask created */
erease_mask = 1;
- ad->mask = open(ad->mask_name, O_WRONLY, 0755);
- if (ad->mask == -1) {
- G_message(_("unable to open <%s> mask ... continuing without!"),
- m->f.f_ma.mask);
- }
+ ad->mask = 1;
}
break;
default:
@@ -159,18 +155,21 @@
case CELL_TYPE:{
for (i = 0; i < (ad->rc - used); i++) {
cm->cache[used + i] = Rast_allocate_c_buf();
+ cm->contents[used + i] = -1;
}
}
break;
case DCELL_TYPE:{
for (i = 0; i < ad->rc - used; i++) {
dm->cache[used + i] = Rast_allocate_d_buf();
+ dm->contents[used + i] = -1;
}
}
break;
case FCELL_TYPE:{
for (i = 0; i < ad->rc - used; i++) {
fm->cache[used + i] = Rast_allocate_f_buf();
+ fm->contents[used + i] = -1;
}
}
break;
@@ -252,6 +251,7 @@
}
close(mask_fd);
+ Rast_close(old_fd);
G_free(buf);
G_free(old);
More information about the grass-commit
mailing list