[GRASS-SVN] r63860 - in grass/branches/releasebranch_7_0: . lib/gis lib/raster raster/r.mapcalc
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 29 11:36:13 PST 2014
Author: martinl
Date: 2014-12-29 11:36:13 -0800 (Mon, 29 Dec 2014)
New Revision: 63860
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/lib/gis/parser_interface.c
grass/branches/releasebranch_7_0/lib/raster/get_row.c
grass/branches/releasebranch_7_0/lib/raster/get_row_colr.c
grass/branches/releasebranch_7_0/lib/raster/put_row.c
grass/branches/releasebranch_7_0/raster/r.mapcalc/map.c
Log:
libgis: G__alloca() -> G_alloca()
update modules
(merge r63858-9 from trunk)
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
- /grass/trunk:60817,61096,61141,61994,62105,62179-62180,62182,62190,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750-62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62828,62831,62838,62845,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,63043-63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,
63076,63079,63081,63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63275-63276,63279,63281,63283,63287,63290,63292,63297,63302,63304-63307,63315,63319,63327,63330,63332,63339,63342,63345,63361-63363,63367,63379,63389,63391,63393,63402,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63604,63608-63609,63616,63618,63624,63626,63628,63630,63634,63639,63642,63644,63650,63652,63656,63679,63685,63689,63691,63693,63695,63698,63700-63702,63704,63706-63707,63709,63711,63713,63715,63717-63718
,63721-63727,63731,63733,63740-63742,63744,63747-63749,63751-63752,63756,63758,63761,63767,63777,63780,63783,63787,63793,63796-63798,63801,63803,63807-63808,63812,63814,63816,63821,63823-63824,63827-63828,63830-63831,63834-63835,63837-63839,63841,63843-63844,63846-63847,63849,63851,63853,63855-63856
+ /grass/trunk:60817,61096,61141,61994,62105,62179-62180,62182,62190,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750-62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62828,62831,62838,62845,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,63043-63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,
63076,63079,63081,63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63275-63276,63279,63281,63283,63287,63290,63292,63297,63302,63304-63307,63315,63319,63327,63330,63332,63339,63342,63345,63361-63363,63367,63379,63389,63391,63393,63402,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63604,63608-63609,63616,63618,63624,63626,63628,63630,63634,63639,63642,63644,63650,63652,63656,63679,63685,63689,63691,63693,63695,63698,63700-63702,63704,63706-63707,63709,63711,63713,63715,63717-63718
,63721-63727,63731,63733,63740-63742,63744,63747-63749,63751-63752,63756,63758,63761,63767,63777,63780,63783,63787,63793,63796-63798,63801,63803,63807-63808,63812,63814,63816,63821,63823-63824,63827-63828,63830-63831,63834-63835,63837-63839,63841,63843-63844,63846-63847,63849,63851,63853,63855-63856,63858-63859
Modified: grass/branches/releasebranch_7_0/lib/gis/parser_interface.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/gis/parser_interface.c 2014-12-29 19:35:13 UTC (rev 63859)
+++ grass/branches/releasebranch_7_0/lib/gis/parser_interface.c 2014-12-29 19:36:13 UTC (rev 63860)
@@ -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/branches/releasebranch_7_0/lib/raster/get_row.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster/get_row.c 2014-12-29 19:35:13 UTC (rev 63859)
+++ grass/branches/releasebranch_7_0/lib/raster/get_row.c 2014-12-29 19:36:13 UTC (rev 63860)
@@ -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/branches/releasebranch_7_0/lib/raster/get_row_colr.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster/get_row_colr.c 2014-12-29 19:35:13 UTC (rev 63859)
+++ grass/branches/releasebranch_7_0/lib/raster/get_row_colr.c 2014-12-29 19:36:13 UTC (rev 63860)
@@ -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/branches/releasebranch_7_0/lib/raster/put_row.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster/put_row.c 2014-12-29 19:35:13 UTC (rev 63859)
+++ grass/branches/releasebranch_7_0/lib/raster/put_row.c 2014-12-29 19:36:13 UTC (rev 63860)
@@ -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);
}
Modified: grass/branches/releasebranch_7_0/raster/r.mapcalc/map.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.mapcalc/map.c 2014-12-29 19:35:13 UTC (rev 63859)
+++ grass/branches/releasebranch_7_0/raster/r.mapcalc/map.c 2014-12-29 19:36:13 UTC (rev 63860)
@@ -159,9 +159,9 @@
return sub->buf[0];
}
- tmp = G__alloca(cache->nrows * sizeof(void *));
+ tmp = G_alloca(cache->nrows * sizeof(void *));
memcpy(tmp, sub->buf, cache->nrows * sizeof(void *));
- vtmp = G__alloca(cache->nrows);
+ vtmp = G_alloca(cache->nrows);
memcpy(vtmp, sub->valid, cache->nrows);
i = (i < 0)
@@ -179,8 +179,8 @@
}
sub->row = newrow;
- G__freea(tmp);
- G__freea(vtmp);
+ G_freea(tmp);
+ G_freea(vtmp);
Rast_get_row(cache->fd, sub->buf[i], row, data_type);
sub->valid[i] = 1;
@@ -226,10 +226,10 @@
static void translate_from_colors(struct map *m, DCELL *rast, CELL *cell,
int ncols, int mod)
{
- unsigned char *red = G__alloca(columns);
- unsigned char *grn = G__alloca(columns);
- unsigned char *blu = G__alloca(columns);
- unsigned char *set = G__alloca(columns);
+ unsigned char *red = G_alloca(columns);
+ unsigned char *grn = G_alloca(columns);
+ unsigned char *blu = G_alloca(columns);
+ unsigned char *set = G_alloca(columns);
int i;
Rast_lookup_d_colors(rast, red, grn, blu, set, ncols, &m->colors);
@@ -270,10 +270,10 @@
break;
}
- G__freea(red);
- G__freea(grn);
- G__freea(blu);
- G__freea(set);
+ G_freea(red);
+ G_freea(grn);
+ G_freea(blu);
+ G_freea(set);
}
/* convert cell values to double based on the values in the
@@ -598,10 +598,10 @@
read_map(m, buf, res_type, row, col);
break;
case '@':
- ibuf = G__alloca(columns * sizeof(CELL));
+ ibuf = G_alloca(columns * sizeof(CELL));
read_map(m, ibuf, CELL_TYPE, row, col);
translate_from_cats(m, ibuf, buf, columns);
- G__freea(ibuf);
+ G_freea(ibuf);
break;
case 'r':
case 'g':
@@ -609,10 +609,10 @@
case '#':
case 'y':
case 'i':
- fbuf = G__alloca(columns * sizeof(DCELL));
+ fbuf = G_alloca(columns * sizeof(DCELL));
read_map(m, fbuf, DCELL_TYPE, row, col);
translate_from_colors(m, fbuf, buf, columns, mod);
- G__freea(fbuf);
+ G_freea(fbuf);
break;
default:
G_fatal_error(_("Invalid map modifier: '%c'"), mod);
More information about the grass-commit
mailing list