From: Victor Stinner Date: Tue, 8 Apr 2014 07:14:21 +0000 (+0200) Subject: Issue #21118: PyLong_AS_LONG() result type is long X-Git-Tag: v3.5.0a1~1930 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4dd25256e25b2f03d0140e53f0813d482e3b07b5;p=thirdparty%2FPython%2Fcpython.git Issue #21118: PyLong_AS_LONG() result type is long Even if PyLong_AS_LONG() cannot fail, I prefer to use the right type. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 921d7aa3d242..af70ede749d1 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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) {