Re:Perfecting GLFW for Zig, and finding lurking undefined be...
by mforney on Sunday October 31, 2021 @07:36PM
(#29061516)
> A simple way to fix this would be to shift c by 24u, "(c << 24u)" which would promote both values to unsigned int
This works for most arithmetic operators, but not shift: "The type of the result is that of the promoted left operand". The type of the right-hand-side has no effect on the type of the result.
To fix this, you'd need to cast the left-hand-side to a type that is wide enough.
This works for most arithmetic operators, but not shift: "The type of the result is that of the promoted left operand". The type of the right-hand-side has no effect on the type of the result.
To fix this, you'd need to cast the left-hand-side to a type that is wide enough.