[GRASS-SVN] r48240 - grass/trunk/raster/r.univar
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 11 17:25:05 EDT 2011
Author: hamish
Date: 2011-09-11 14:25:05 -0700 (Sun, 11 Sep 2011)
New Revision: 48240
Modified:
grass/trunk/raster/r.univar/globals.h
grass/trunk/raster/r.univar/stats.c
Log:
allow n to be really big
Modified: grass/trunk/raster/r.univar/globals.h
===================================================================
--- grass/trunk/raster/r.univar/globals.h 2011-09-11 21:24:59 UTC (rev 48239)
+++ grass/trunk/raster/r.univar/globals.h 2011-09-11 21:25:05 UTC (rev 48240)
@@ -34,14 +34,14 @@
unsigned int n_perc;
double *perc;
double sum_abs;
- int n;
- int size;
+ unsigned long n;
+ unsigned long size;
DCELL *dcell_array;
FCELL *fcell_array;
CELL *cell_array;
int map_type;
void *nextp;
- int n_alloc;
+ off_t n_alloc;
int first;
} univar_stat;
Modified: grass/trunk/raster/r.univar/stats.c
===================================================================
--- grass/trunk/raster/r.univar/stats.c 2011-09-11 21:24:59 UTC (rev 48239)
+++ grass/trunk/raster/r.univar/stats.c 2011-09-11 21:25:05 UTC (rev 48240)
@@ -141,15 +141,15 @@
}
if (!param.shell_style->answer) {
- fprintf(stdout, "total null and non-null cells: %d\n", stats[z].size);
- fprintf(stdout, "total null cells: %d\n\n", stats[z].size - stats[z].n);
+ fprintf(stdout, "total null and non-null cells: %lu\n", stats[z].size);
+ fprintf(stdout, "total null cells: %lu\n\n", stats[z].size - stats[z].n);
fprintf(stdout, "Of the non-null cells:\n----------------------\n");
}
if (param.shell_style->answer) {
- fprintf(stdout, "n=%d\n", stats[z].n);
- fprintf(stdout, "null_cells=%d\n", stats[z].size - stats[z].n);
- fprintf(stdout, "cells=%d\n", stats->size);
+ fprintf(stdout, "n=%lu\n", stats[z].n);
+ fprintf(stdout, "null_cells=%lu\n", stats[z].size - stats[z].n);
+ fprintf(stdout, "cells=%lu\n", stats->size);
fprintf(stdout, "min=%.15g\n", stats[z].min);
fprintf(stdout, "max=%.15g\n", stats[z].max);
fprintf(stdout, "range=%.15g\n", stats[z].max - stats[z].min);
@@ -161,7 +161,7 @@
fprintf(stdout, "sum=%s\n", sum_str);
}
else {
- fprintf(stdout, "n: %d\n", stats[z].n);
+ fprintf(stdout, "n: %lu\n", stats[z].n);
fprintf(stdout, "minimum: %g\n", stats[z].min);
fprintf(stdout, "maximum: %g\n", stats[z].max);
fprintf(stdout, "range: %g\n", stats[z].max - stats[z].min);
@@ -377,9 +377,9 @@
}
/* non-null cells cells */
- fprintf(stdout, "%d%s", stats[z].n, zone_info.sep);
+ fprintf(stdout, "%lu%s", stats[z].n, zone_info.sep);
/* null cells */
- fprintf(stdout, "%d%s", stats[z].size - stats[z].n, zone_info.sep);
+ fprintf(stdout, "%lu%s", stats[z].size - stats[z].n, zone_info.sep);
/* min */
fprintf(stdout, "%.15g%s", stats[z].min, zone_info.sep);
/* max */
More information about the grass-commit
mailing list