test/xi2: Really fix infinite loop in test_convert_XITouchOwnershipEvent
long i; for (i = 1; ; i <<= 1) if (i == (1 << 31)) break; (1 << 31) is compiled as an int, and thus is equal to -2147483648. We are trying to compare it against a long, which on 64-bit machines is 2147483648. This results in an infinite loop. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
e7df42ab68
commit
a28ff2cf92
|
@ -1005,7 +1005,7 @@ test_convert_XITouchOwnershipEvent(void)
|
||||||
{
|
{
|
||||||
in.touchid = i;
|
in.touchid = i;
|
||||||
test_XITouchOwnershipEvent(&in);
|
test_XITouchOwnershipEvent(&in);
|
||||||
if (i == (1 << 31))
|
if (i == ((long)1 << 31))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue