Skip to content

Commit

Permalink
re-indented with grass_master/tools/grass_indent.sh (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
neteler committed Jul 4, 2019
1 parent d6d7f2f commit 93abaad
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 242 deletions.
12 changes: 6 additions & 6 deletions grass7/imagery/i.spec.unmix/hist.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <grass/gis.h>
#include <grass/raster.h>

void make_history(const char *name, const char *group, const char*matrixfile)
void make_history(const char *name, const char *group, const char *matrixfile)
{
struct History hist;

if(Rast_read_history (name, G_mapset(), &hist) >= 0)
{
Rast_format_history(&hist, HIST_DATSRC_1, "Group: %s", group);
Rast_format_history(&hist, HIST_DATSRC_2, "Matrix file: %s", matrixfile);
Rast_write_history (name, &hist);
if (Rast_read_history(name, G_mapset(), &hist) >= 0) {
Rast_format_history(&hist, HIST_DATSRC_1, "Group: %s", group);
Rast_format_history(&hist, HIST_DATSRC_2, "Matrix file: %s",
matrixfile);
Rast_write_history(name, &hist);
}
}
18 changes: 9 additions & 9 deletions grass7/imagery/i.spec.unmix/histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ int do_histogram(char *name, char *mapset)

Rast_get_cellhd(name, mapset, &cellhd);
/* if (Rast_get_cellhd (name, mapset, &cellhd) < 0)
return 0;
*/
return 0;
*/

G_set_window(&cellhd);
fd = Rast_open_old(name, mapset);
if (fd < 0)
return 0;
return 0;



Expand All @@ -28,22 +28,22 @@ int do_histogram(char *name, char *mapset)
ncols = region.cols;

/* nrows = G_window_rows ();
ncols = G_window_cols ();
*/
ncols = G_window_cols ();
*/
cell = Rast_allocate_c_buf();

Rast_init_cell_stats(&statf);
for (row = 0; row < nrows; row++) {
Rast_get_c_row_nomask(fd, cell, row);
/* break; */
Rast_get_c_row_nomask(fd, cell, row);
/* break; */

Rast_update_cell_stats(cell, ncols, &statf);
Rast_update_cell_stats(cell, ncols, &statf);
}
Rast_close(fd);
G_free(cell);

if (row == nrows)
Rast_write_histogram_cs(name, &statf);
Rast_write_histogram_cs(name, &statf);

Rast_free_cell_stats(&statf);

Expand Down

0 comments on commit 93abaad

Please sign in to comment.