]> granicus.if.org Git - python/commitdiff
Use unsigned division
authorRaymond Hettinger <python@rcn.com>
Thu, 15 Oct 2015 06:33:23 +0000 (23:33 -0700)
committerRaymond Hettinger <python@rcn.com>
Thu, 15 Oct 2015 06:33:23 +0000 (23:33 -0700)
Modules/_collectionsmodule.c

index 06f85e94ce7aef6fc1264142aac887c8e91e0580..bc225a5b4cf926643fab1959947998815c506049 100644 (file)
@@ -1482,7 +1482,7 @@ deque_sizeof(dequeobject *deque, void *unused)
     Py_ssize_t blocks;
 
     res = sizeof(dequeobject);
-    blocks = (deque->leftindex + Py_SIZE(deque) + BLOCKLEN - 1) / BLOCKLEN;
+    blocks = (size_t)(deque->leftindex + Py_SIZE(deque) + BLOCKLEN - 1) / BLOCKLEN;
     assert(deque->leftindex + Py_SIZE(deque) - 1 ==
            (blocks - 1) * BLOCKLEN + deque->rightindex);
     res += blocks * sizeof(block);