Hi folks,
I've been getting the following warning when compiling my code,
"Bitwise-or operator used on a sign-extended operand; consider casting
to a smaller unsigned type first", and although it doesn't have any
detrimental effect, I would love to be able to get rid of it.
The code that it refers to is:
public static int RGB(byte r, byte g, byte b) {
return (int) (((byte) (r) | ((ushort) (g) << 8)) | (((uint) (byte)
(b)) << 16));
}
Which is something I didn't write myself, so I don't actually understand
what it's doing, otherwise I might have fixed it by now!
Any ideas how to stop the warning occurring without altering the
returned value?
--
Dylan Parry - http://electricfreedom.org
A Flower?