Re:Perfecting GLFW for Zig, and finding lurking undefined be...
by ncmncm on Sunday October 31, 2021 @09:30PM
(#29062186)
Casting to signed long is demonstrably wrong.
The code in question is (probably) pretty slow, offering plenty of room for improvement beyond just fixing the UB. But it has seemed to work well enough, so far, like most things.
> Wouldn't it be better to cast to unsigned int or something similar (like uint32_t), since long can still be 32 bits? If the size of long and int is the same, wouldn't the cast as proposed in the PR be semantically identical to the current state?