]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport from trunk:
authorGuido van Rossum <guido@python.org>
Mon, 23 Sep 2002 21:17:27 +0000 (21:17 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 23 Sep 2002 21:17:27 +0000 (21:17 +0000)
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.

Objects/stringobject.c
Objects/unicodeobject.c

index 529a424d8a1ab4e10ba16dbad276a33b601fdeeb..c601f606740d04610c797b5c5bebfbbd5f0ae943 100644 (file)
@@ -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) {
index b1ba48dd37356a12984c1e029cb1d00ba2653288..83cd7ed002205ba9e3b6f5478ad33c59b1ed90b9 100644 (file)
@@ -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) {