]> granicus.if.org Git - python/commitdiff
Add casts to CMPERROR macro to silence SunPro compiler warnings about
authorGuido van Rossum <guido@python.org>
Wed, 5 Mar 1997 00:45:43 +0000 (00:45 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 5 Mar 1997 00:45:43 +0000 (00:45 +0000)
integer overflow in << operator.

Objects/listobject.c

index 2fb67b9883299e3e850dca397ae96dbf5ae32aee..8aca28dc303c27b3c6e5b24fa8b683bbd2e06e78 100644 (file)
@@ -560,7 +560,7 @@ listappend(self, args)
 /* CMPERROR is returned by our comparison function when an error
    occurred.  This is the largest negative integer (0x80000000 on a
    32-bit system). */
-#define CMPERROR (1 << (8*sizeof(int) - 1))
+#define CMPERROR ( (int) ((unsigned int)1 << (8*sizeof(int) - 1)) )
 
 /* Comparison function.  Takes care of calling a user-supplied
    comparison function (any callable Python object).  Calls the