summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2011-12-22 12:00:37 -0800
committerKeith Packard <keithp@keithp.com>2011-12-23 13:18:10 -0800
commita28ff2cf92c2b35e02eacca21af929afabbf6b83 (patch)
treec429c35d7694fed10255113699f9fc977fe88d34
parente7df42ab68e30588a5e32ed543b0711821daf009 (diff)
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>
-rw-r--r--test/xi2/protocol-eventconvert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
index faa9f407a..bf1493c05 100644
--- a/test/xi2/protocol-eventconvert.c
+++ b/test/xi2/protocol-eventconvert.c
@@ -1005,7 +1005,7 @@ test_convert_XITouchOwnershipEvent(void)
{
in.touchid = i;
test_XITouchOwnershipEvent(&in);
- if (i == (1 << 31))
+ if (i == ((long)1 << 31))
break;
}
}