xserver icon indicating copy to clipboard operation
xserver copied to clipboard

Consider ditching CARD type for UINT

Open clhin opened this issue 1 month ago • 2 comments

Describe the cleanup

Changing all various CARD types to UINT types

It should be done because

CARD, even as a native english speaker seems unintuitive. It is supposed to denote a cardinal number. Unless you are both a very proficient english speaker, and some one with a good grasp of math, you will have no idea what this is referring to (even I thought it was some sort of reference to playing cards before I did some digging).

UINT8 for example, is straight forward on the other hand: U = unsigned, lacking a negative INT= integer, a whole number 8 = 8 bits, between 0 and 255, due to previously mentioned unsigned

CARD8: CARD = playing card (??) 8 = 8 bits, -128 to 127 or 0 to 255?? Decimals??

What are the alternatives?

No response

Additional context

We should keep the CARD type defined in our headers for API's sake, but I wouldn't use this anymore internally.

Extra fields

clhin avatar Nov 25 '25 01:11 clhin

https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types :D

ArmanHayots avatar Nov 25 '25 05:11 ArmanHayots

These are X11 protocol data types. CARD = cardinal number.

metux avatar Nov 25 '25 11:11 metux