Closed dirkmueller closed 4 years ago
the first (inner) cast is a sign conversion (treating the read value as signed 8bit integer). the outer cast is a small optimisation, it changes the bitwise | and << operation to operate on signed 16bits (because we only store signed 16 bit integer anyway) instead of a machine specific int promotion (typically 32/64bit) (which would be the default in C/C++). I can remove that outer cast, it would not matter, the inner cast is the actual change. just let me know, I'll update it then.
oki thanks for the details - we'll have to test on hardware
thanx!
hiya why'd ya need to double-cast? never seen it befoer :)