Repository navigation
BUG: Use signed char counter in RLEImage signed/unsigned test - #7239
hjmjohnson merged 1 commit into
Conversation
Plain `char` is unsigned on Linux arm64, riscv64, ...
There was a problem hiding this comment.
Thank you for contributing a pull request! 🙏
Welcome to the ITK community! 🤗👋☀️
We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
More support and guidance on the contribution process can be found in our contributing guide. 📖
This is an automatic message. Allow for time for the ITK community to be able to read the pull request and comment
on it.
[Low impact] The PR appears safe to merge.
|
hjmjohnson
left a comment
There was a problem hiding this comment.
Thanks, this is the right fix: RLEImage::Allocate() throws when the x size exceeds std::numeric_limits<CounterType>::max(), so signed char gives 127 on every platform, and x86 behavior is unchanged. Nothing blocks merge.
Optional nits
- The commit body trails off ("riscv64, ..."). Something like: "Plain
charis unsigned on Linux arm64, ppc64le, and riscv64, so the counter accepts runs up to 255 and the xSize>127 exception test fails." charRLEImagenow names thesigned charcounter besideucharRLEImage;scharRLEImagewould read better (lines 49, 50, 55, 99).- The literal
127at line 147 could bestd::numeric_limits<signed char>::max(), so the threshold follows the type. - Related, not in scope: #7067, where Debug builds assert instead of throwing in
Allocate(), so on arm64 Debug the 128-255 inputs now abort as they already do on x86.
dzenanz
left a comment
There was a problem hiding this comment.
Good as is. Hans' nits are optional.
fc82ba4
into
InsightSoftwareConsortium:main
itkRLEImageTestfails on Linux arm64, riscv64 and other platforms where plaincharis unsigned. Usesigned charfor the signed counter so the test behaves the same everywhere.