Re: [Python-Dev] [Python-checkins] cpython: add unicode_char() in unicodeobject.c to factorize code

On Fri, Jan 3, 2014 at 6:01 AM, victor.stinner <python-checkins@python.org> wrote:
The above-quoted parts of this changeset caused several compiler warnings due to unused variables. On 32-bit Windows: ..\Objects\unicodeobject.c(2881): warning C4101: 'kind' : unreferenced local variable [P:\ath\to\cpython\PCbuild\pythoncore.vcxproj] ..\Objects\unicodeobject.c(2879): warning C4101: 'v' : unreferenced local variable [P:\ath\to\cpython\PCbuild\pythoncore.vcxproj] ..\Objects\unicodeobject.c(2880): warning C4101: 'data' : unreferenced local variable [P:\ath\to\cpython\PCbuild\pythoncore.vcxproj] ..\Objects\unicodeobject.c(11333): warning C4101: 'res' : unreferenced local variable [P:\ath\to\cpython\PCbuild\pythoncore.vcxproj] I believe this should fix it, but I'll leave it up to you to confirm that, Victor :) diff -r 8a3718f31188 Objects/unicodeobject.c --- a/Objects/unicodeobject.c Fri Jan 03 15:53:20 2014 +0100 +++ b/Objects/unicodeobject.c Fri Jan 03 10:20:12 2014 -0600 @@ -2876,10 +2876,6 @@ PyObject * PyUnicode_FromOrdinal(int ordinal) { - PyObject *v; - void *data; - int kind; - if (ordinal < 0 || ordinal > MAX_UNICODE) { PyErr_SetString(PyExc_ValueError, "chr() arg not in range(0x110000)"); @@ -11330,7 +11326,6 @@ void *data; enum PyUnicode_Kind kind; Py_UCS4 ch; - PyObject *res; if (!PyUnicode_Check(self) || PyUnicode_READY(self) == -1) { PyErr_BadArgument(); -- Zach
participants (2)
-
Victor Stinner
-
Zachary Ware