We just want to create a bitmask here, so cast the mask to unsigned
to avoid left shifting a negative value which is undefined behavior.
However, it's a little more complex than looking at sign bits, we need
to see if we are shifting the sign information away... */
if (((val << cnt) >> size) == 0
- || (((val << cnt) >> size) == ~(~0 << cnt)
+ || (((val << cnt) >> size) == ~((bu32)~0 << cnt)
&& ((new_val >> (size - 1)) & 0x1)))
v_i = 0;
else
bu16 inshift = in << shift;
if (((inshift & ~0xFFFF)
- && ((inshift & ~0xFFFF) >> 16) != ~(~0 << shift))
+ && ((inshift & ~0xFFFF) >> 16) != ~((bu32)~0 << shift))
|| (inshift & 0x8000) != (in & 0x8000))
{
if (in & 0x8000)