Add GDT_UInt8 in GDALDataType, and alias GDT_Byte on it #13432
+1,722
−1,662
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.
Writing switch / case on data types has always bothered me due to the special case of GDT_Byte which is at odds with all the other values
GDT_[U]Int[8/16/32/64], so let's replace GDT_Byte with GDT_UInt8 in the GDALDataType enumeration, and create a #define alias for backwards compatibility.Furthermore the signedness of "byte" might be ambiguous. In most programming languages where it exists, it is indeed unsigned, with the major exception of Java/Scala.