4 ms·
I read this, and go "yes, yes, yes", and then "NO!". Shifts and ors really is the sanest and simplest way to express "assembling an integer from bytes". Maski
by wnoise 5y ago
I read this, and go "yes, yes, yes", and then "NO!".
Shifts and ors really is the sanest and simplest way to express "assembling an integer from bytes". Masking is _a_ way to deal with the current C spec which has silly promotion rules. Unsigned everything is more fundamental than signed.