Skip to content

Conversation

@rouault
Copy link
Member

@rouault rouault commented Nov 17, 2025

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.

@rouault rouault added this to the 3.13.0 milestone Nov 17, 2025
@jratike80
Copy link
Collaborator

jratike80 commented Nov 18, 2025

Byte as a datatype appears also on quite a many document pages https://github.com/search?q=repo%3AOSGeo%2Fgdal+path%3A%2F%5Edoc%5C%2F%2F+Byte&type=code
Do we want to encourage users to use UInt8 even Byte will still work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants