From: Guido van Rossum Date: Mon, 23 Sep 2002 21:17:27 +0000 (+0000) Subject: Backport from trunk: X-Git-Tag: v2.2.2b1~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67c87194fb030a584d087231d29b6676e24b7d5d;p=thirdparty%2FPython%2Fcpython.git Backport from trunk: unicodeobject.c 2.169 stringobject.c 2.189 Fix warnings on 64-bit platforms about casts from pointers to ints. Two of these were real bugs. --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 529a424d8a1a..c601f606740d 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -3581,7 +3581,8 @@ PyString_Format(PyObject *format, PyObject *args) PyErr_Format(PyExc_ValueError, "unsupported format character '%c' (0x%x) " "at index %i", - c, c, fmt - 1 - PyString_AsString(format)); + c, c, + (int)(fmt - 1 - PyString_AsString(format))); goto error; } if (sign) { diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index b1ba48dd3735..83cd7ed00220 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5642,7 +5642,8 @@ PyObject *PyUnicode_Format(PyObject *format, "unsupported format character '%c' (0x%x) " "at index %i", (31<=c && c<=126) ? (int)c : '?', - (int)c, (fmt -1 - PyUnicode_AS_UNICODE(uformat))); + (int)c, + (int)(fmt -1 - PyUnicode_AS_UNICODE(uformat))); goto onError; } if (sign) {