Skip to content

r.stats: bump up counts storage to unsigned long long - #7790

Merged
cwhite911 merged 4 commits into
OSGeo:mainfrom
marisn:r_stats_overflow
Aug 24, 2026
Merged

cwhite911 merged 4 commits into
OSGeo:mainfrom
marisn:r_stats_overflow

Conversation

@marisn

@marisn marisn commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

On Windows log is 32bit and only long long is 64bit.

Problems now will occur when counts exceed 18446744073709551615.

Fixes: #7769

Authored by Claude Sonnet 4.6

On Windows `log` is 32bit and only `long long` is 64bit.

Fixes: OSGeo#7769

Authored by Claude Sonnet 4.6
@marisn
marisn requested a review from HuidaeCho July 31, 2026 06:46
@github-actions github-actions Bot added raster Related to raster data processing C Related code is in C module labels Jul 31, 2026
cwhite911
cwhite911 previously approved these changes Aug 2, 2026
@cwhite911

Copy link
Copy Markdown
Contributor

Looks good to me.

@metzm

metzm commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

You could use grass_int64 which is guaranteed to be a portable 64bit integer type.

@cwhite911

Copy link
Copy Markdown
Contributor

You could use grass_int64 which is guaranteed to be a portable 64bit integer type.

@marisn are you planning and making this change?

@marisn

marisn commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

You could use grass_int64 which is guaranteed to be a portable 64bit integer type.

@marisn are you planning and making this change?

Done.
Sorry, summer mode. We just had a huge storm with days without electricity and cell service in countryside :D

@marisn
marisn removed the request for review from HuidaeCho August 24, 2026 18:54
@cwhite911

Copy link
Copy Markdown
Contributor

@marisn summer mode is a good mode to be in. Glad you got your power back.

@cwhite911
cwhite911 merged commit 8ecfa87 into OSGeo:main Aug 24, 2026
26 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone Aug 24, 2026
@marisn
marisn deleted the r_stats_overflow branch August 25, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C module raster Related to raster data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] r.stats reports negative counts when tabulating across 2 rasters

3 participants