From: Raymond Hettinger Date: Thu, 15 Oct 2015 06:33:23 +0000 (-0700) Subject: Use unsigned division X-Git-Tag: v3.6.0a1~1208 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc00341105afed2255ecd139ca6ca381a482b1f9;p=thirdparty%2FPython%2Fcpython.git Use unsigned division --- diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 06f85e94ce7a..bc225a5b4cf9 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -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);