]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed two format strings in the _collections module. For example
authorChristian Heimes <christian@cheimes.de>
Fri, 22 Aug 2008 20:10:27 +0000 (20:10 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 22 Aug 2008 20:10:27 +0000 (20:10 +0000)
Modules/_collectionsmodule.c:674: warning: format '%i' expects type 'int', but argument 2 has type 'Py_ssize_t'
Reviewed by Benjamin Peterson

Misc/NEWS
Modules/_collectionsmodule.c

index e5b37a95b0a2a9701984609021bac475a3761a28..07fc1f35043191038fb5154be7117bd2e6bc9781 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -23,6 +23,8 @@ Library
 
 - Silenced a trivial compiler warning in the sqlite module.
 
+- Fixed two format strings in the _collections module.
+
 
 What's New in Python 2.6 beta 3?
 ================================
index 4517811479d4a9c9bad784139f0567f5b3c0f6f8..82bfb14e69dd7a3fd034ba98bb48b1406d534499 100644 (file)
@@ -670,7 +670,7 @@ deque_repr(PyObject *deque)
                return NULL;
        }
        if (((dequeobject *)deque)->maxlen != -1)
-               fmt = PyString_FromFormat("deque(%%r, maxlen=%i)", 
+               fmt = PyString_FromFormat("deque(%%r, maxlen=%" PY_FORMAT_SIZE_T "i)", 
                                        ((dequeobject *)deque)->maxlen);
        else
                fmt = PyString_FromString("deque(%r)");  
@@ -733,7 +733,7 @@ deque_tp_print(PyObject *deque, FILE *fp, int flags)
        if (((dequeobject *)deque)->maxlen == -1)
                fputs("])", fp);
        else
-               fprintf(fp, "], maxlen=%d)", ((dequeobject *)deque)->maxlen);
+               fprintf(fp, "], maxlen=%" PY_FORMAT_SIZE_T "d)", ((dequeobject *)deque)->maxlen);
        Py_END_ALLOW_THREADS
        return 0;
 }