test/xi2: Really fix infinite loop in test_convert_XITouchOwnershipEvent
authorChase Douglas <chase.douglas@canonical.com>
Thu, 22 Dec 2011 20:00:37 +0000 (12:00 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 23 Dec 2011 21:18:10 +0000 (13:18 -0800)
commita28ff2cf92c2b35e02eacca21af929afabbf6b83
treec429c35d7694fed10255113699f9fc977fe88d34
parente7df42ab68e30588a5e32ed543b0711821daf009
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>
test/xi2/protocol-eventconvert.c