Jesper de Jong wrote:
Maybe the programmer who wrote this didn't understand this properly.
Or perhaps, it is done for consistency. For example, to go from short to byte, you need the explicit cast, but not the AND operation. And to go from byte to short, you don't need the explicit cast, but you do need the AND operation... perhaps, it is just easier to make sure that each conversion has the cast and masking of bits, regardless whether it is needed or not.
Regardless, it is an interesting catch, and cow-worthy. Have a cow...