I guess this is the same integer overflow issue reported earlier [1]. I am just a bit puzzled that after changing to a 64-bit Linux OS, results of r.stats seem to be correct, but not those of r.univar.
Am I missing something, perhaps an upgrade? (I'm using GRASS 6.4.0.)
I guess this is the same integer overflow issue reported earlier [1]. I am
just a bit puzzled that after changing to a 64-bit Linux OS, results of
r.stats seem to be correct, but not those of r.univar.
Am I missing something, perhaps an upgrade? (I'm using GRASS 6.4.0.)
GRASS 6.4.2svn (nc_spm_08):~ > r.univar elevation
100%
total null and non-null cells: -347311046
total null cells: -350476046
...
I suppose that r.univar is lacking the needed off_t updates.
globals.h is defining univar_stat's 'n' and 'size' as int, and
stats.c is printing as plain '%d'. (fwiw in GRASS 5 I used
'unsigned int' originally, but it appears to haven be lost with
the introduction of r3.univar.)
suggest to use 'unsigned long' and "%lu" as is done by r.in.xyz,
and 'off_t' for 'n_alloc'.
try r48240 in trunk.
Hamish
ps- I get this warning when compiling it, not sure how to fix:
r3.univar_main.c: In function 'main':
r3.univar_main.c:146: warning: assignment discards qualifiers from pointer target type
146: if (NULL == (mapset = G_find_raster3d(zonemap, "")))