From b55a63c153c537404189e3f3c817e67da2ae1547 Mon Sep 17 00:00:00 2001 From: Phil Thompson Date: Mon, 14 Oct 2024 17:06:57 +0100 Subject: [PATCH] Eliminated compiler warnings The outstanding compiler warnings were eliminated when building the 'sip' module. Resolves #32 --- sipbuild/module/source/12/siplib.c | 12 +++--------- sipbuild/module/source/13/sip_core.c | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sipbuild/module/source/12/siplib.c b/sipbuild/module/source/12/siplib.c index f7ee273c..a2c5d883 100644 --- a/sipbuild/module/source/12/siplib.c +++ b/sipbuild/module/source/12/siplib.c @@ -2893,7 +2893,7 @@ static int parseResult(PyObject *method, PyObject *res, case 'a': { char *p = va_arg(va, char *); - int enc; + int enc = -1; switch (*fmt++) { @@ -2908,9 +2908,6 @@ static int parseResult(PyObject *method, PyObject *res, case '8': enc = parseString_AsUTF8Char(arg, p); break; - - default: - enc = -1; } if (enc < 0) @@ -3181,7 +3178,7 @@ static int parseResult(PyObject *method, PyObject *res, { int key = va_arg(va, int); const char **p = va_arg(va, const char **); - PyObject *keep; + PyObject *keep = NULL; switch (*fmt++) { @@ -3196,9 +3193,6 @@ static int parseResult(PyObject *method, PyObject *res, case '8': keep = parseString_AsUTF8String(arg, p); break; - - default: - keep = NULL; } if (keep == NULL) @@ -5785,7 +5779,7 @@ static int parsePass2(sipSimpleWrapper *self, int selfarg, PyObject *sipArgs, if (arg != NULL) { - int enc; + int enc = -1; switch (sub_fmt) { diff --git a/sipbuild/module/source/13/sip_core.c b/sipbuild/module/source/13/sip_core.c index d900f965..2594a1a5 100644 --- a/sipbuild/module/source/13/sip_core.c +++ b/sipbuild/module/source/13/sip_core.c @@ -2589,7 +2589,7 @@ static int parseResult(PyObject *method, PyObject *res, case 'a': { char *p = va_arg(va, char *); - int enc; + int enc = -1; switch (*fmt++) { @@ -2604,9 +2604,6 @@ static int parseResult(PyObject *method, PyObject *res, case '8': enc = parseString_AsUTF8Char(arg, p); break; - - default: - enc = -1; } if (enc < 0) @@ -2843,7 +2840,7 @@ static int parseResult(PyObject *method, PyObject *res, { int key = va_arg(va, int); const char **p = va_arg(va, const char **); - PyObject *keep; + PyObject *keep = NULL; switch (*fmt++) { @@ -2858,9 +2855,6 @@ static int parseResult(PyObject *method, PyObject *res, case '8': keep = parseString_AsUTF8String(arg, p); break; - - default: - keep = NULL; } if (keep == NULL) @@ -5066,7 +5060,7 @@ static int parsePass2(PyObject *self, int selfarg, PyObject *sipArgs, if (arg != NULL) { - int enc; + int enc = -1; switch (sub_fmt) {