[GRASS-SVN] r63858 - in grass/trunk/lib: gis raster
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 29 11:34:48 PST 2014
Author: martinl
Date: 2014-12-29 11:34:48 -0800 (Mon, 29 Dec 2014)
New Revision: 63858
Modified:
grass/trunk/lib/gis/parser_interface.c
grass/trunk/lib/raster/get_row.c
grass/trunk/lib/raster/get_row_colr.c
grass/trunk/lib/raster/put_row.c
Log:
libgis: G__alloca() -> G_alloca()
Modified: grass/trunk/lib/gis/parser_interface.c
===================================================================
--- grass/trunk/lib/gis/parser_interface.c 2014-12-29 19:31:48 UTC (rev 63857)
+++ grass/trunk/lib/gis/parser_interface.c 2014-12-29 19:34:48 UTC (rev 63858)
@@ -59,7 +59,7 @@
char *src = (char *) str;
size_t srclen = strlen(src);
size_t dstlen = srclen * 4 + 1;
- char *dst = G__alloca(dstlen);
+ char *dst = G_alloca(dstlen);
size_t ret;
enc = dst;
@@ -90,7 +90,7 @@
#ifdef HAVE_ICONV_H
if (enc)
- G__freea(enc);
+ G_freea(enc);
if (conv != (iconv_t) -1)
iconv_close(conv);
Modified: grass/trunk/lib/raster/get_row.c
===================================================================
--- grass/trunk/lib/raster/get_row.c 2014-12-29 19:31:48 UTC (rev 63857)
+++ grass/trunk/lib/raster/get_row.c 2014-12-29 19:34:48 UTC (rev 63858)
@@ -135,10 +135,10 @@
G_fatal_error(_("Error reading raster data for row %d of <%s>"),
row, fcb->name);
- cmp = G__alloca(readamount);
+ cmp = G_alloca(readamount);
if (read(fcb->data_fd, cmp, readamount) != readamount) {
- G__freea(cmp);
+ G_freea(cmp);
G_fatal_error(_("Error reading raster data for row %d of <%s>"),
row, fcb->name);
}
@@ -162,7 +162,7 @@
else
memcpy(data_buf, cmp, readamount);
- G__freea(cmp);
+ G_freea(cmp);
}
static void read_data_uncompressed(int fd, int row, unsigned char *data_buf,
@@ -195,7 +195,7 @@
if (fcb->gdal->vflip)
row = fcb->cellhd.rows - 1 - row;
- buf = fcb->gdal->hflip ? G__alloca(fcb->cellhd.cols * fcb->cur_nbytes)
+ buf = fcb->gdal->hflip ? G_alloca(fcb->cellhd.cols * fcb->cur_nbytes)
: data_buf;
err =
@@ -210,7 +210,7 @@
memcpy(data_buf + i * fcb->cur_nbytes,
buf + (fcb->cellhd.cols - 1 - i) * fcb->cur_nbytes,
fcb->cur_nbytes);
- G__freea(buf);
+ G_freea(buf);
}
if (err != CE_None)
@@ -454,7 +454,7 @@
static void transfer_to_cell_fi(int fd, void *cell)
{
struct fileinfo *fcb = &R__.fileinfo[fd];
- FCELL *work_buf = G__alloca(R__.rd_window.cols * sizeof(FCELL));
+ FCELL *work_buf = G_alloca(R__.rd_window.cols * sizeof(FCELL));
int i;
transfer_to_cell_XX(fd, work_buf);
@@ -463,13 +463,13 @@
((CELL *) cell)[i] = (fcb->col_map[i] == 0)
? 0 : Rast_quant_get_cell_value(&fcb->quant, work_buf[i]);
- G__freea(work_buf);
+ G_freea(work_buf);
}
static void transfer_to_cell_di(int fd, void *cell)
{
struct fileinfo *fcb = &R__.fileinfo[fd];
- DCELL *work_buf = G__alloca(R__.rd_window.cols * sizeof(DCELL));
+ DCELL *work_buf = G_alloca(R__.rd_window.cols * sizeof(DCELL));
int i;
transfer_to_cell_XX(fd, work_buf);
@@ -478,12 +478,12 @@
((CELL *) cell)[i] = (fcb->col_map[i] == 0)
? 0 : Rast_quant_get_cell_value(&fcb->quant, work_buf[i]);
- G__freea(work_buf);
+ G_freea(work_buf);
}
static void transfer_to_cell_if(int fd, void *cell)
{
- CELL *work_buf = G__alloca(R__.rd_window.cols * sizeof(CELL));
+ CELL *work_buf = G_alloca(R__.rd_window.cols * sizeof(CELL));
int i;
transfer_to_cell_XX(fd, work_buf);
@@ -491,12 +491,12 @@
for (i = 0; i < R__.rd_window.cols; i++)
((FCELL *) cell)[i] = work_buf[i];
- G__freea(work_buf);
+ G_freea(work_buf);
}
static void transfer_to_cell_df(int fd, void *cell)
{
- DCELL *work_buf = G__alloca(R__.rd_window.cols * sizeof(DCELL));
+ DCELL *work_buf = G_alloca(R__.rd_window.cols * sizeof(DCELL));
int i;
transfer_to_cell_XX(fd, work_buf);
@@ -504,12 +504,12 @@
for (i = 0; i < R__.rd_window.cols; i++)
((FCELL *) cell)[i] = work_buf[i];
- G__freea(work_buf);
+ G_freea(work_buf);
}
static void transfer_to_cell_id(int fd, void *cell)
{
- CELL *work_buf = G__alloca(R__.rd_window.cols * sizeof(CELL));
+ CELL *work_buf = G_alloca(R__.rd_window.cols * sizeof(CELL));
int i;
transfer_to_cell_XX(fd, work_buf);
@@ -517,12 +517,12 @@
for (i = 0; i < R__.rd_window.cols; i++)
((DCELL *) cell)[i] = work_buf[i];
- G__freea(work_buf);
+ G_freea(work_buf);
}
static void transfer_to_cell_fd(int fd, void *cell)
{
- FCELL *work_buf = G__alloca(R__.rd_window.cols * sizeof(FCELL));
+ FCELL *work_buf = G_alloca(R__.rd_window.cols * sizeof(FCELL));
int i;
transfer_to_cell_XX(fd, work_buf);
@@ -530,7 +530,7 @@
for (i = 0; i < R__.rd_window.cols; i++)
((DCELL *) cell)[i] = work_buf[i];
- G__freea(work_buf);
+ G_freea(work_buf);
}
/*
@@ -588,7 +588,7 @@
int i;
if (fcb->reclass_flag && data_type != CELL_TYPE) {
- temp_buf = G__alloca(R__.rd_window.cols * sizeof(CELL));
+ temp_buf = G_alloca(R__.rd_window.cols * sizeof(CELL));
buf = temp_buf;
type = CELL_TYPE;
}
@@ -615,7 +615,7 @@
rast = G_incr_void_ptr(rast, size);
}
- G__freea(temp_buf);
+ G_freea(temp_buf);
}
/*!
@@ -854,13 +854,13 @@
fcb->null_cur_row = -1;
if (fcb->map_type == CELL_TYPE) {
/* If can't read null row, assume that all map 0's are nulls */
- CELL *mask_buf = G__alloca(R__.rd_window.cols * sizeof(CELL));
+ CELL *mask_buf = G_alloca(R__.rd_window.cols * sizeof(CELL));
get_map_row_nomask(fd, mask_buf, row, CELL_TYPE);
for (j = 0; j < R__.rd_window.cols; j++)
flags[j] = (mask_buf[j] == 0);
- G__freea(mask_buf);
+ G_freea(mask_buf);
}
else { /* fp map */
/* if can't read null row, assume that all data is valid */
@@ -915,14 +915,14 @@
static void embed_mask(char *flags, int row)
{
- CELL *mask_buf = G__alloca(R__.rd_window.cols * sizeof(CELL));
+ CELL *mask_buf = G_alloca(R__.rd_window.cols * sizeof(CELL));
int i;
if (R__.auto_mask <= 0)
return;
if (get_map_row_nomask(R__.mask_fd, mask_buf, row, CELL_TYPE) < 0) {
- G__freea(mask_buf);
+ G_freea(mask_buf);
return;
}
@@ -935,7 +935,7 @@
if (mask_buf[i] == 0 || Rast_is_c_null_value(&mask_buf[i]))
flags[i] = 1;
- G__freea(mask_buf);
+ G_freea(mask_buf);
}
static void get_null_value_row(int fd, char *flags, int row, int with_mask)
@@ -967,7 +967,7 @@
&& (R__.auto_mask <= 0 || !with_mask))
return;
- null_buf = G__alloca(R__.rd_window.cols);
+ null_buf = G_alloca(R__.rd_window.cols);
get_null_value_row(fd, null_buf, row, with_mask);
@@ -982,7 +982,7 @@
buf = G_incr_void_ptr(buf, size);
}
- G__freea(null_buf);
+ G_freea(null_buf);
}
/*!
@@ -1009,13 +1009,13 @@
if (!fcb->reclass_flag)
get_null_value_row(fd, flags, row, 1);
else {
- CELL *buf = G__alloca(R__.rd_window.cols * sizeof(CELL));
+ CELL *buf = G_alloca(R__.rd_window.cols * sizeof(CELL));
int i;
Rast_get_c_row(fd, buf, row);
for (i = 0; i < R__.rd_window.cols; i++)
flags[i] = Rast_is_c_null_value(&buf[i]) ? 1 : 0;
- G__freea(buf);
+ G_freea(buf);
}
}
Modified: grass/trunk/lib/raster/get_row_colr.c
===================================================================
--- grass/trunk/lib/raster/get_row_colr.c 2014-12-29 19:31:48 UTC (rev 63857)
+++ grass/trunk/lib/raster/get_row_colr.c 2014-12-29 19:34:48 UTC (rev 63858)
@@ -48,7 +48,7 @@
void *p;
int i;
- array = G__alloca(cols * size);
+ array = G_alloca(cols * size);
Rast_get_row(fd, array, row, type);
@@ -56,10 +56,10 @@
for (i = 0, p = array; i < cols; i++, p = G_incr_void_ptr(p, size))
nul[i] = Rast_is_null_value(p, type);
- set = G__alloca(cols);
+ set = G_alloca(cols);
Rast_lookup_colors(array, red, grn, blu, set, cols, colors, type);
- G__freea(array);
- G__freea(set);
+ G_freea(array);
+ G_freea(set);
}
Modified: grass/trunk/lib/raster/put_row.c
===================================================================
--- grass/trunk/lib/raster/put_row.c 2014-12-29 19:31:48 UTC (rev 63857)
+++ grass/trunk/lib/raster/put_row.c 2014-12-29 19:34:48 UTC (rev 63858)
@@ -193,7 +193,7 @@
if (n <= 0)
return;
- work_buf = G__alloca(size + 1);
+ work_buf = G_alloca(size + 1);
if (compressed)
set_file_pointer(fd, row);
@@ -208,7 +208,7 @@
else
write_data(fd, row, work_buf, n);
- G__freea(work_buf);
+ G_freea(work_buf);
}
static void convert_int(unsigned char *wk, char *null_buf, const CELL * rast,
@@ -348,7 +348,7 @@
if (n <= 0)
return;
- work_buf = G__alloca(fcb->cellhd.cols * sizeof(CELL) + 1);
+ work_buf = G_alloca(fcb->cellhd.cols * sizeof(CELL) + 1);
wk = work_buf;
if (compressed)
@@ -373,7 +373,7 @@
trim_bytes(wk, n, len, len - nbytes);
total = nbytes * n;
- compressed_buf = G__alloca(total + 1);
+ compressed_buf = G_alloca(total + 1);
compressed_buf[0] = work_buf[0] = nbytes;
@@ -396,7 +396,7 @@
row, fcb->name);
}
- G__freea(compressed_buf);
+ G_freea(compressed_buf);
}
else {
nwrite = fcb->nbytes * n;
@@ -406,7 +406,7 @@
row, fcb->name);
}
- G__freea(work_buf);
+ G_freea(work_buf);
}
static void put_data_gdal(int fd, const void *rast, int row, int n,
@@ -428,7 +428,7 @@
if (n <= 0)
return;
- work_buf = G__alloca(n * size);
+ work_buf = G_alloca(n * size);
switch (map_type) {
case CELL_TYPE:
@@ -458,7 +458,7 @@
err = Rast_gdal_raster_IO(fcb->gdal->band, GF_Write, 0, row, n, 1,
work_buf, n, 1, datatype, 0, 0);
- G__freea(work_buf);
+ G_freea(work_buf);
if (err != CE_None)
G_fatal_error(_("Error writing data via GDAL for row %d of <%s>"),
@@ -696,7 +696,7 @@
return;
}
- null_buf = G__alloca(fcb->cellhd.cols);
+ null_buf = G_alloca(fcb->cellhd.cols);
G_zero(null_buf, fcb->cellhd.cols);
put_raster_data(fd, null_buf, buf, fcb->cur_row, fcb->cellhd.cols,
@@ -719,5 +719,5 @@
if (!fcb->gdal)
put_null_value_row(fd, null_buf);
- G__freea(null_buf);
+ G_freea(null_buf);
}
More information about the grass-commit
mailing list