In C++ I have code like this.
static UInt32 rol(UInt32 value, UInt32 bits) { bits &= 31; return ((value << bits) | (value >&
You should use int type for the right side variable in shift operators.
int