Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…terLib

 * Rast_raster_size -> Rast_cell_size
 * Rast_allocate_cell_buf removed
 * Rast_allocate_c_raster_buf -> Rast_allocate_c_buf
 * Rast_allocate_f_raster_buf -> Rast_allocare_f_buf
 * Rast_allocate_d_raster_buf -> Rast_allocate_d_buf
Modules updated


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38082 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
landam committed Jun 25, 2009
1 parent 36975ba commit 8daf2e7
Show file tree
Hide file tree
Showing 222 changed files with 840 additions and 851 deletions.
6 changes: 3 additions & 3 deletions display/d.his/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ int main(int argc, char **argv)
G_fatal_error(_("Color file for <%s> not available"), name_s);
}

r_array = Rast_allocate_cell_buf();
g_array = Rast_allocate_cell_buf();
b_array = Rast_allocate_cell_buf();
r_array = Rast_allocate_c_buf();
g_array = Rast_allocate_c_buf();
b_array = Rast_allocate_c_buf();

/* Make color table */
make_gray_scale(&gray_colors);
Expand Down
6 changes: 3 additions & 3 deletions display/d.nviz/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ int read_rast


if (data_type == CELL_TYPE) {
cell = Rast_allocate_c_raster_buf();
cell = Rast_allocate_c_buf();
if (Rast_get_c_raster_row(fd, cell, row) < 0)
exit(1);

Expand All @@ -453,7 +453,7 @@ int read_rast
}

if (data_type == FCELL_TYPE) {
fcell = Rast_allocate_f_raster_buf();
fcell = Rast_allocate_f_buf();
if (Rast_get_f_raster_row(fd, fcell, row) < 0)
exit(1);
if (Rast_is_f_null_value(&fcell[col]))
Expand All @@ -463,7 +463,7 @@ int read_rast
}

if (data_type == DCELL_TYPE) {
dcell = Rast_allocate_d_raster_buf();
dcell = Rast_allocate_c_buf();
if (Rast_get_d_raster_row(fd, dcell, row) < 0)
exit(1);
if (Rast_is_d_null_value(&dcell[col]))
Expand Down
6 changes: 3 additions & 3 deletions display/d.profile/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct point

static void get_region_range(int fd)
{
DCELL *buf = Rast_allocate_d_raster_buf();
DCELL *buf = Rast_allocate_c_buf();
int nrows = G_window_rows();
int ncols = G_window_cols();
int row, col;
Expand Down Expand Up @@ -123,8 +123,8 @@ static int get_cell(DCELL *result, int fd, double x, double y)
DCELL *tmp;

if (!row1) {
row1 = Rast_allocate_d_raster_buf();
row2 = Rast_allocate_d_raster_buf();
row1 = Rast_allocate_c_buf();
row2 = Rast_allocate_c_buf();
}

col = (int)floor(x - 0.5);
Expand Down
12 changes: 6 additions & 6 deletions display/d.rast.arrow/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ int main(int argc, char **argv)
raster_type = Rast_get_raster_map_type(layer_fd);

/* allocate the cell array */
raster_row = Rast_allocate_raster_buf(raster_type);
raster_row = Rast_allocate_buf(raster_type);


if (opt7->answer) {
Expand All @@ -309,7 +309,7 @@ int main(int argc, char **argv)
mag_raster_type = Rast_get_raster_map_type(mag_fd);

/* allocate the cell array */
mag_raster_row = Rast_allocate_raster_buf(mag_raster_type);
mag_raster_row = Rast_allocate_buf(mag_raster_type);
}


Expand Down Expand Up @@ -367,11 +367,11 @@ int main(int argc, char **argv)
}

if (no_arrow) {
ptr = G_incr_void_ptr(ptr, Rast_raster_size(raster_type));
ptr = G_incr_void_ptr(ptr, Rast_cell_size(raster_type));
if (opt7->answer)
mag_ptr =
G_incr_void_ptr(mag_ptr,
Rast_raster_size(mag_raster_type));
Rast_cell_size(mag_raster_type));
no_arrow = FALSE;
continue;
}
Expand Down Expand Up @@ -494,10 +494,10 @@ int main(int argc, char **argv)
}
}

ptr = G_incr_void_ptr(ptr, Rast_raster_size(raster_type));
ptr = G_incr_void_ptr(ptr, Rast_cell_size(raster_type));
if (opt7->answer)
mag_ptr =
G_incr_void_ptr(mag_ptr, Rast_raster_size(mag_raster_type));
G_incr_void_ptr(mag_ptr, Rast_cell_size(mag_raster_type));
}
}

Expand Down
2 changes: 1 addition & 1 deletion display/d.rast.num/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int main(int argc, char **argv)
}

/* allocate the cell array */
cell = Rast_allocate_raster_buf(map_type);
cell = Rast_allocate_buf(map_type);

/* read the color table in the color structures of the displayed map */
if (Rast_read_colors(map_name, "", &colors) == -1)
Expand Down
2 changes: 1 addition & 1 deletion display/d.rast/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int cell_draw(const char *name,
G_fatal_error(_("Unable to open raster map <%s>"), name);

/* Allocate space for cell buffer */
xarray = Rast_allocate_raster_buf(data_type);
xarray = Rast_allocate_buf(data_type);

D_cell_draw_begin();

Expand Down
2 changes: 1 addition & 1 deletion display/d.rgb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int main(int argc, char **argv)
if (Rast_read_colors(name, "", &B[i].colors) == -1)
G_fatal_error(_("Color file for <%s> not available"), name);

B[i].array = Rast_allocate_raster_buf(B[i].type);
B[i].array = Rast_allocate_buf(B[i].type);
}

/* read in current window */
Expand Down
4 changes: 2 additions & 2 deletions display/d.what.rast/what.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int what(int once, int terse, int colrow, char *fs, int width, int mwidth)
G_get_set_window(&window);
nrows = window.rows;
ncols = window.cols;
buf = Rast_allocate_c_raster_buf();
dbuf = Rast_allocate_d_raster_buf();
buf = Rast_allocate_c_buf();
dbuf = Rast_allocate_c_buf();

screen_x = ((int)D_get_d_west() + (int)D_get_d_east()) / 2;
screen_y = ((int)D_get_d_north() + (int)D_get_d_south()) / 2;
Expand Down
4 changes: 2 additions & 2 deletions doc/raster/r.example/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ int main(int argc, char *argv[])
G_debug(3, "number of rows %d", cellhd.rows);

/* Allocate input buffer */
inrast = Rast_allocate_raster_buf(data_type);
inrast = Rast_allocate_buf(data_type);

/* Allocate output buffer, use input map data_type */
nrows = G_window_rows();
ncols = G_window_cols();
outrast = Rast_allocate_raster_buf(data_type);
outrast = Rast_allocate_buf(data_type);

/* controlling, if we can write the raster */
if ((outfd = Rast_open_raster_new(result, data_type)) < 0)
Expand Down
6 changes: 3 additions & 3 deletions general/g.region/zoom.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int zoom(struct Cell_head *window, const char *name, const char *mapset)
G_fatal_error(_("Unable to open raster map <%s> in <%s>"),
name, mapset);
map_type = Rast_get_raster_map_type(fd);
raster = Rast_allocate_raster_buf(map_type);
raster = Rast_allocate_buf(map_type);

/* find first non-null row */
top = nrows;
Expand All @@ -37,7 +37,7 @@ int zoom(struct Cell_head *window, const char *name, const char *mapset)
for (col = 0; col < ncols; col++) {
if (!Rast_is_null_value(rast_ptr, map_type))
break;
rast_ptr = G_incr_void_ptr(rast_ptr, Rast_raster_size(map_type));
rast_ptr = G_incr_void_ptr(rast_ptr, Rast_cell_size(map_type));
}
if (col == ncols)
continue;
Expand All @@ -50,7 +50,7 @@ int zoom(struct Cell_head *window, const char *name, const char *mapset)
for (mark = col; col < ncols; col++) {
if (!Rast_is_null_value(rast_ptr, map_type))
mark = col;
rast_ptr = G_incr_void_ptr(rast_ptr, Rast_raster_size(map_type));
rast_ptr = G_incr_void_ptr(rast_ptr, Rast_cell_size(map_type));
}
if (mark > right)
right = mark;
Expand Down
4 changes: 2 additions & 2 deletions imagery/i.albedo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int main(int argc, char *argv[])
if ((Rast_get_cellhd(name, "", &cellhd)) < 0)
G_fatal_error(_("Unable to read header of raster map <%s>"), name);

inrast[nfiles] = Rast_allocate_raster_buf(in_data_type[nfiles]);
inrast[nfiles] = Rast_allocate_buf(in_data_type[nfiles]);
nfiles++;
}
nfiles--;
Expand All @@ -171,7 +171,7 @@ int main(int argc, char *argv[])
/* Allocate output buffer, use input map data_type */
nrows = G_window_rows();
ncols = G_window_cols();
outrast = Rast_allocate_raster_buf(out_data_type);
outrast = Rast_allocate_buf(out_data_type);

/* Create New raster files */
if ((outfd = Rast_open_raster_new(result, 1)) < 0)
Expand Down
14 changes: 7 additions & 7 deletions imagery/i.biomass/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,31 @@ int main(int argc, char *argv[])
/***************************************************/
if ((infd_fpar = Rast_open_cell_old(fpar, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), fpar);
inrast_fpar = Rast_allocate_d_raster_buf();
inrast_fpar = Rast_allocate_c_buf();

if ((infd_luf = Rast_open_cell_old(luf, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), luf);
inrast_luf = Rast_allocate_d_raster_buf();
inrast_luf = Rast_allocate_c_buf();

if ((infd_lat = Rast_open_cell_old(lat, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), lat);
inrast_lat = Rast_allocate_d_raster_buf();
inrast_lat = Rast_allocate_c_buf();

if ((infd_doy = Rast_open_cell_old(doy, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), doy);
inrast_doy = Rast_allocate_d_raster_buf();
inrast_doy = Rast_allocate_c_buf();

if ((infd_tsw = Rast_open_cell_old(tsw, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), tsw);
inrast_tsw = Rast_allocate_d_raster_buf();
inrast_tsw = Rast_allocate_c_buf();

if ((infd_wa = Rast_open_cell_old(wa, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), wa);
inrast_wa = Rast_allocate_d_raster_buf();
inrast_wa = Rast_allocate_c_buf();

nrows = G_window_rows();
ncols = G_window_cols();
outrast1 = Rast_allocate_d_raster_buf();
outrast1 = Rast_allocate_c_buf();

/* Create New raster files */
if ((outfd1 = Rast_open_raster_new(result1, DCELL_TYPE)) < 0)
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.cca/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ transform(int datafds[MX], int outfds[MX], int rows, int cols,

/* allocate row buffers for each band */
for (i = 1; i <= bands; i++)
if ((rowbufs[i] = Rast_allocate_cell_buf()) == NULL)
if ((rowbufs[i] = Rast_allocate_c_buf()) == NULL)
G_fatal_error(_("Unable to allocate cell buffers."));

for (i = 0; i < rows; i++) {
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.class/band_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int open_band_files(void)
Bandbuf = (CELL **) G_malloc(nbands * sizeof(CELL *));
Bandfd = (int *)G_malloc(nbands * sizeof(int));
for (n = 0; n < nbands; n++) {
Bandbuf[n] = Rast_allocate_cell_buf();
Bandbuf[n] = Rast_allocate_c_buf();
name = Refer.file[n].name;
mapset = Refer.file[n].mapset;
if ((Bandfd[n] = Rast_open_cell_old(name, mapset)) < 0)
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.class/draw_cell.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int draw_cell(View * view, int overlay)
Rast_free_colors(&colr);
return 0;
}
dcell = Rast_allocate_d_raster_buf();
dcell = Rast_allocate_c_buf();


sprintf(msg, "Plotting %s ...", view->cell.name);
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.class/signature.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ int display_signature(void)

if ((fd = Rast_open_cell_new(MASK)) < 0)
G_fatal_error(_("Unable to open the cell map MASK."));
if ((buffer = Rast_allocate_cell_buf()) == NULL)
if ((buffer = Rast_allocate_c_buf()) == NULL)
G_fatal_error(_("Unable to allocate the cell buffer in display_signature()."));
nrows = G_window_rows();
ncols = G_window_cols();
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.cluster/open_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int open_files(void)
cell = (DCELL **) G_malloc(ref.nfiles * sizeof(DCELL *));
cellfd = (int *)G_malloc(ref.nfiles * sizeof(int));
for (n = 0; n < ref.nfiles; n++) {
cell[n] = Rast_allocate_d_raster_buf();
cell[n] = Rast_allocate_c_buf();
name = ref.file[n].name;
mapset = ref.file[n].mapset;
if ((cellfd[n] = Rast_open_cell_old(name, mapset)) < 0)
Expand Down
8 changes: 4 additions & 4 deletions imagery/i.eb.eta/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ int main(int argc, char *argv[])

if ((infd_rnetday = Rast_open_cell_old(rnetday, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), rnetday);
inrast_rnetday = Rast_allocate_d_raster_buf();
inrast_rnetday = Rast_allocate_c_buf();

if ((infd_evapfr = Rast_open_cell_old(evapfr, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), evapfr);
inrast_evapfr = Rast_allocate_d_raster_buf();
inrast_evapfr = Rast_allocate_c_buf();

if ((infd_tempk = Rast_open_cell_old(tempk, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), tempk);
inrast_tempk = Rast_allocate_d_raster_buf();
inrast_tempk = Rast_allocate_c_buf();

nrows = G_window_rows();
ncols = G_window_cols();
outrast1 = Rast_allocate_d_raster_buf();
outrast1 = Rast_allocate_c_buf();

if ((outfd1 = Rast_open_raster_new(result1, DCELL_TYPE)) < 0)
G_fatal_error(_("Unable to create raster map <%s>"), result1);
Expand Down
10 changes: 5 additions & 5 deletions imagery/i.eb.evapfr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,24 @@ int main(int argc, char *argv[])
/***************************************************/
if ((infd_rnet = Rast_open_cell_old(rnet, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), rnet);
inrast_rnet = Rast_allocate_d_raster_buf();
inrast_rnet = Rast_allocate_c_buf();

/***************************************************/
if ((infd_g0 = Rast_open_cell_old(g0, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), g0);
inrast_g0 = Rast_allocate_d_raster_buf();
inrast_g0 = Rast_allocate_c_buf();

/***************************************************/
if ((infd_h0 = Rast_open_cell_old(h0, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), h0);
inrast_h0 = Rast_allocate_d_raster_buf();
inrast_h0 = Rast_allocate_c_buf();

/***************************************************/
nrows = G_window_rows();
ncols = G_window_cols();
outrast1 = Rast_allocate_d_raster_buf();
outrast1 = Rast_allocate_c_buf();
if (makin)
outrast2 = Rast_allocate_d_raster_buf();
outrast2 = Rast_allocate_c_buf();

/* Create New raster files */
if ((outfd1 = Rast_open_raster_new(result1, DCELL_TYPE)) < 0)
Expand Down
10 changes: 5 additions & 5 deletions imagery/i.eb.h_SEBAL01/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ int main(int argc, char *argv[])
G_fatal_error(_("Unable to read header of raster map <%s>"), t0dem);

/* Allocate input buffer */
inrast_Rn = Rast_allocate_d_raster_buf();
inrast_g0 = Rast_allocate_d_raster_buf();
inrast_z0m = Rast_allocate_d_raster_buf();
inrast_t0dem = Rast_allocate_d_raster_buf();
inrast_Rn = Rast_allocate_c_buf();
inrast_g0 = Rast_allocate_c_buf();
inrast_z0m = Rast_allocate_c_buf();
inrast_t0dem = Rast_allocate_c_buf();

/***************************************************/
/* Setup pixel location variables */
Expand All @@ -245,7 +245,7 @@ int main(int argc, char *argv[])
/***************************************************/
/* Allocate output buffer */
/***************************************************/
outrast = Rast_allocate_d_raster_buf();
outrast = Rast_allocate_c_buf();

if ((outfd = Rast_open_raster_new(h0, DCELL_TYPE)) < 0)
G_fatal_error(_("Unable to create raster map <%s>"), h0);
Expand Down
12 changes: 6 additions & 6 deletions imagery/i.eb.soilheatflux/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,27 @@ int main(int argc, char *argv[])

if ((infd_albedo = Rast_open_cell_old(albedo, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), albedo);
inrast_albedo = Rast_allocate_d_raster_buf();
inrast_albedo = Rast_allocate_c_buf();

if ((infd_ndvi = Rast_open_cell_old(ndvi, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), ndvi);
inrast_ndvi = Rast_allocate_d_raster_buf();
inrast_ndvi = Rast_allocate_c_buf();

if ((infd_tempk = Rast_open_cell_old(tempk, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), tempk);
inrast_tempk = Rast_allocate_d_raster_buf();
inrast_tempk = Rast_allocate_c_buf();

if ((infd_rnet = Rast_open_cell_old(rnet, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), rnet);
inrast_rnet = Rast_allocate_d_raster_buf();
inrast_rnet = Rast_allocate_c_buf();

if ((infd_time = Rast_open_cell_old(time, "")) < 0)
G_fatal_error(_("Unable to open raster map <%s>"), time);
inrast_time = Rast_allocate_d_raster_buf();
inrast_time = Rast_allocate_c_buf();

nrows = G_window_rows();
ncols = G_window_cols();
outrast = Rast_allocate_d_raster_buf();
outrast = Rast_allocate_c_buf();

/* Create New raster files */
if ((outfd = Rast_open_raster_new(result,DCELL_TYPE)) < 0)
Expand Down
Loading

0 comments on commit 8daf2e7

Please sign in to comment.