ENH: Fixed width type enums (INT8, UINT64, FLOAT64, ...) for IOComponent#5410
Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom Jun 18, 2025
Conversation
dzenanz
approved these changes
Jun 17, 2025
d952af0 to
2a335fe
Compare
Added enumerators to `IOComponent` that explicitly specify the number of bits
of the types they refer to:
UINT8, INT8, UINT16, INT16, UINT32, INT32, UINT64, INT64, FLOAT32, FLOAT64
Tested that `MapPixelType<TPixel>::CType` maps to the expected enumerator.
`INT8` is clearer than `CHAR`, because the C++ type `char` may be either signed
or unsigned. (`INT8` corresponds with `std::int8_t`, which is always signed, by
definition.) `INT32` and `INT64` are clearer than `LONG`, because `long` may be
either 32 bits or 64 bits, depending on the platform and the compiler. `FLOAT32`
is clearer than `FLOAT`, because on other languages (notably Python), the
standard `float` type may be 64 bits.
2a335fe to
d2e6801
Compare
Member
|
Windows failure is due to Github removing support for windows-2019 |
hjmjohnson
approved these changes
Jun 18, 2025
ab87323
into
InsightSoftwareConsortium:master
15 of 16 checks passed
Contributor
|
This change introduced -Wduplicate-enum warnings into ITK, and there were none before. Any objection to wrapping the enum in a pragma push/pop disabling that warning around that enum? |
Member
|
None - quite the contrary. I noticed 199 (maximum reported number?) of new warnings on your dashboard machines. It would be good if someone fixed it :D |
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added enumerators to
IOComponentthat explicitly specify the number of bits of the types they refer to:Tested that
MapPixelType<TPixel>::CTypemaps to the expected enumerator.INT8is clearer thanCHAR, because the C++ typecharmay be either signedor unsigned. (
INT8corresponds withstd::int8_t, which is always signed, bydefinition.)
INT32andINT64are clearer thanLONG, becauselongmay beeither 32 bits or 64 bits, depending on the platform and the compiler.
FLOAT32is clearer than
FLOAT, because on other languages (notably Python), thestandard
floattype may be 64 bits.