From: Jeremy Hylton Date: Mon, 3 Nov 2003 20:58:28 +0000 (+0000) Subject: Fix compiler warning about possible use of n without assignment. X-Git-Tag: v2.4a1~1329 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ceac90aecb0996ddb4a97998ed60d724d936e60b;p=python Fix compiler warning about possible use of n without assignment. Also fix use of n for two different variables in two different blocks. --- diff --git a/Objects/listobject.c b/Objects/listobject.c index 23d7d9a620..fd98b639a9 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1848,7 +1848,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds) PyObject *result = NULL; /* guilty until proved innocent */ int reverse = 0; PyObject *keyfunc = NULL; - int i, n; + int i, len = 0; PyObject *key, *value, *kvpair; static char *kwlist[] = {"cmp", "key", "reverse", 0}; @@ -1871,10 +1871,11 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds) Py_XINCREF(compare); if (keyfunc != NULL) { - n = PyList_GET_SIZE(self); - for (i=0 ; i