cast result of "sizeof()" to "int" in testcase, silents GCC warnings about signed...
authorLisandro Dalcin <dalcinl@gmail.com>
Tue, 7 Apr 2009 21:05:52 +0000 (18:05 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Tue, 7 Apr 2009 21:05:52 +0000 (18:05 -0300)
tests/run/index.pyx

index 58bcf4413a09cc419746378645e66be589604e0a..223e687ac5952848ca7e0aaaa56466a69e9c6010 100644 (file)
@@ -65,10 +65,10 @@ def test_unsigned_long():
     cdef int i
     cdef unsigned long ix
     cdef D = {}
-    for i from 0 <= i < sizeof(unsigned long) * 8:
+    for i from 0 <= i < <int>sizeof(unsigned long) * 8:
         ix = (<unsigned long>1) << i
         D[ix] = True
-    for i from 0 <= i < sizeof(unsigned long) * 8:
+    for i from 0 <= i < <int>sizeof(unsigned long) * 8:
         ix = (<unsigned long>1) << i
         assert D[ix] is True
         del D[ix]
@@ -78,10 +78,10 @@ def test_unsigned_short():
     cdef int i
     cdef unsigned short ix
     cdef D = {}
-    for i from 0 <= i < sizeof(unsigned short) * 8:
+    for i from 0 <= i < <int>sizeof(unsigned short) * 8:
         ix = (<unsigned short>1) << i
         D[ix] = True
-    for i from 0 <= i < sizeof(unsigned short) * 8:
+    for i from 0 <= i < <int>sizeof(unsigned short) * 8:
         ix = (<unsigned short>1) << i
         assert D[ix] is True
         del D[ix]
@@ -91,10 +91,10 @@ def test_long_long():
     cdef int i
     cdef long long ix
     cdef D = {}
-    for i from 0 <= i < sizeof(long long) * 8:
+    for i from 0 <= i < <int>sizeof(long long) * 8:
         ix = (<long long>1) << i
         D[ix] = True
-    for i from 0 <= i < sizeof(long long) * 8:
+    for i from 0 <= i < <int>sizeof(long long) * 8:
         ix = (<long long>1) << i
         assert D[ix] is True
         del D[ix]