[Python-checkins] r65980 - in python/trunk: Misc/NEWS Modules/_collectionsmodule.c

christian.heimes python-checkins at python.org
Fri Aug 22 22:10:27 CEST 2008


Author: christian.heimes
Date: Fri Aug 22 22:10:27 2008
New Revision: 65980

Log:
Fixed two format strings in the _collections module. For example
Modules/_collectionsmodule.c:674: warning: format '%i' expects type 'int', but argument 2 has type 'Py_ssize_t'
Reviewed by Benjamin Peterson

Modified:
   python/trunk/Misc/NEWS
   python/trunk/Modules/_collectionsmodule.c

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri Aug 22 22:10:27 2008
@@ -23,6 +23,8 @@
 
 - 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?
 ================================

Modified: python/trunk/Modules/_collectionsmodule.c
==============================================================================
--- python/trunk/Modules/_collectionsmodule.c	(original)
+++ python/trunk/Modules/_collectionsmodule.c	Fri Aug 22 22:10:27 2008
@@ -670,7 +670,7 @@
 		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 @@
 	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;
 }


More information about the Python-checkins mailing list