]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #21118: PyLong_AS_LONG() result type is long
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 8 Apr 2014 07:14:21 +0000 (09:14 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 8 Apr 2014 07:14:21 +0000 (09:14 +0200)
Even if PyLong_AS_LONG() cannot fail, I prefer to use the right type.

Objects/unicodeobject.c

index 921d7aa3d24255a72646d55a6c524aa6bd990f6a..af70ede749d18b9179b38455c1b5ec4ca94db3a4 100644 (file)
@@ -8568,7 +8568,7 @@ unicode_fast_translate_lookup(PyObject *mapping, Py_UCS1 ch,
         return 1;
     }
     else if (PyLong_Check(item)) {
-        Py_UCS4 replace = (Py_UCS4)PyLong_AS_LONG(item);
+        long replace = PyLong_AS_LONG(item);
         /* PyLong_AS_LONG() cannot fail, charmaptranslate_lookup() already
            used it */
         if (127 < replace) {