[GRASS-SVN] r32661 - grass/trunk/raster/r.mapcalc
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Aug 9 22:53:17 EDT 2008
Author: glynn
Date: 2008-08-09 22:53:17 -0400 (Sat, 09 Aug 2008)
New Revision: 32661
Modified:
grass/trunk/raster/r.mapcalc/evaluate.c
grass/trunk/raster/r.mapcalc/expression.c
Log:
Delay initialisation of expr_data_func.argv until initialize_function()
Modified: grass/trunk/raster/r.mapcalc/evaluate.c
===================================================================
--- grass/trunk/raster/r.mapcalc/evaluate.c 2008-08-10 01:01:13 UTC (rev 32660)
+++ grass/trunk/raster/r.mapcalc/evaluate.c 2008-08-10 02:53:17 UTC (rev 32661)
@@ -55,6 +55,7 @@
allocate_buf(e);
+ e->data.func.argv = G_malloc((e->data.func.argc + 1) * sizeof(void *));
e->data.func.argv[0] = e->buf;
for (i = 1; i <= e->data.func.argc; i++) {
Modified: grass/trunk/raster/r.mapcalc/expression.c
===================================================================
--- grass/trunk/raster/r.mapcalc/expression.c 2008-08-10 01:01:13 UTC (rev 32660)
+++ grass/trunk/raster/r.mapcalc/expression.c 2008-08-10 02:53:17 UTC (rev 32661)
@@ -53,7 +53,6 @@
expression *e = allocate(expr_type_function, CELL_TYPE);
expression **args = G_malloc(2 * sizeof(expression *));
int *argt = G_malloc(2 * sizeof(int));
- void **argv = G_malloc(2 * sizeof(void *));
argt[0] = CELL_TYPE;
@@ -66,7 +65,7 @@
e->data.func.argc = 1;
e->data.func.args = args;
e->data.func.argt = argt;
- e->data.func.argv = argv;
+ e->data.func.argv = NULL;
return e;
}
@@ -75,7 +74,6 @@
expression *e = allocate(expr_type_function, FCELL_TYPE);
expression **args = G_malloc(2 * sizeof(expression *));
int *argt = G_malloc(2 * sizeof(int));
- void **argv = G_malloc(2 * sizeof(void *));
argt[0] = FCELL_TYPE;
@@ -88,7 +86,7 @@
e->data.func.argc = 1;
e->data.func.args = args;
e->data.func.argt = argt;
- e->data.func.argv = argv;
+ e->data.func.argv = NULL;
return e;
}
@@ -97,7 +95,6 @@
expression *e = allocate(expr_type_function, DCELL_TYPE);
expression **args = G_malloc(2 * sizeof(expression *));
int *argt = G_malloc(2 * sizeof(int));
- void **argv = G_malloc(2 * sizeof(void *));
argt[0] = DCELL_TYPE;
@@ -110,7 +107,7 @@
e->data.func.argc = 1;
e->data.func.args = args;
e->data.func.argt = argt;
- e->data.func.argv = argv;
+ e->data.func.argv = NULL;
return e;
}
@@ -243,7 +240,6 @@
int argc = list_length(arglist);
expression **args = G_malloc((argc + 1) * sizeof(expression *));
int *argt = G_malloc((argc + 1) * sizeof(int));
- void **argv = G_malloc((argc + 1) * sizeof(void *));
expression *e;
expr_list *l;
int i;
@@ -296,7 +292,7 @@
e->data.func.argc = argc;
e->data.func.args = args;
e->data.func.argt = argt;
- e->data.func.argv = argv;
+ e->data.func.argv = NULL;
return e;
}
More information about the grass-commit
mailing list