There is a code on C # which is used in Unity3D. Visual Studio does not find any warnings in it, but the compiler in the unit displays a warning:
warning CS0675: The operator
| ' used on the sign-extended type int'. Consider casting to a smaller unsigned type first
int'. Consider casting to a smaller unsigned type first
A piece of code, which swears:
long old = _outKey[8] & 0xff; old |= _outKey[9] << 0x08 & 0xff00; old |= _outKey[10] << 0x10 & 0xff0000; old |= _outKey[11] << 0x18 & 0xff000000;
The problem is in casting. Initially, this code is ported from Java, where everything is fine, and the variable in general was of type int. However, Sharpe does not like such bit operations on signed numbers.
And if you declare a variable as an int, then on the last line, VS swears at the need to cast long to int (why is there 4 bytes ?!).
I also tried to declare uint - it also requires typing types.
Tell me, what data type is better to use?