xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Fri Dec 23 13:17:36 PST 2011


 test/xi2/protocol-eventconvert.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a28ff2cf92c2b35e02eacca21af929afabbf6b83
Author: Chase Douglas <chase.douglas at canonical.com>
Date:   Thu Dec 22 12:00:37 2011 -0800

    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 at canonical.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
index faa9f40..bf1493c 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;
     }
 }


More information about the xorg-commit mailing list