From f83d78dd2801c7e4bee406379d3119f8852cf297 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 19 Jul 2014 13:36:13 +1000 Subject: Warning cleanup - ignoring const - declarations after statements - some C files didnt include own headers (risking them getting out of sync) Closes #1064 --- plugins/python/python.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/python') diff --git a/plugins/python/python.c b/plugins/python/python.c index 1904a3e9..0ce6ad6e 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -414,6 +414,9 @@ Util_BuildEOLList(char *word[]) PyObject *list; int listsize = 31; int i; + char *accum = NULL; + char *last = NULL; + /* Find the last valid array member; there may be intermediate NULLs that * would otherwise cause us to drop some members. */ while (listsize > 0 && @@ -424,10 +427,9 @@ Util_BuildEOLList(char *word[]) PyErr_Print(); return NULL; } - char *accum = NULL; - char *last = NULL; for (i = listsize; i > 0; i--) { char *part = word[i]; + PyObject *uni_part; if (accum == NULL) { accum = g_strdup (part); } else if (part != NULL && part[0] != 0) { @@ -443,7 +445,7 @@ Util_BuildEOLList(char *word[]) return NULL; } } - PyObject *uni_part = PyUnicode_FromString(accum); + uni_part = PyUnicode_FromString(accum); PyList_SetItem(list, i - 1, uni_part); } -- cgit 1.4.1