Open oddbookworm opened 11 months ago
int
is usually 4 bytes except a few really rare/old exceptions, and I'm guessing those rare exceptions would not be able to run python or even SDL. We use int
in like a million places and a lot of API out of our control already uses int
. In short, I don't think going over the code replacing int
with anything else is a good idea.
However, the size of long
being either 4 or 8 bytes is a more common issue that occasionally bites us, and when it does we do use something like long long
or explicitly sized integer types
Actually, we could re-open this issue to investigate long
usage. I'm sure there would be some places where different platforms behave differently due to this.
So for those who don't know, windows builds with the MSVC have 32-bit long
s even on 64-bit hardware (eww, I know) and generally every other 64-bit platform have 64-bit sized long
A thought occurred to me:
int
doesn't have a specific size. Per the C spec (I'm using this freely available draft of C17 https://web.archive.org/web/20181230041359if_/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf, page 31 in section 6.2.5, subsection 5):So, technically, an
int
could be different for different machines even running the same OS. Theoretically then, we could run into a situation with pygame-ce actually doing different things.Would this be worth investigating?