From a28ff2cf92c2b35e02eacca21af929afabbf6b83 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Thu, 22 Dec 2011 12:00:37 -0800 Subject: [PATCH] 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 Signed-off-by: Keith Packard --- test/xi2/protocol-eventconvert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } }