]> granicus.if.org Git - python/commitdiff
longobject.c: fix compilation warning on Windows 64-bit
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 23 Mar 2016 17:36:54 +0000 (18:36 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 23 Mar 2016 17:36:54 +0000 (18:36 +0100)
We know that Py_SIZE(b) is -1 or 1 an so fits into the sdigit type.

Objects/longobject.c

index 3f9837fc93588337c8a35533b72661d7a86c0861..70d8cfc6a7dbeafb0804b1c92ca6bd7e01f736d4 100644 (file)
@@ -3522,7 +3522,7 @@ fast_mod(PyLongObject *a, PyLongObject *b)
         mod = right - 1 - (left - 1) % right;
     }
 
-    return PyLong_FromLong(mod * Py_SIZE(b));
+    return PyLong_FromLong(mod * (sdigit)Py_SIZE(b));
 }
 
 /* Fast floor division for single-digit longs. */