From ee8d47cec4caad77d1bb8d0414416a71af332f49 Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Sat, 6 Mar 2021 08:20:27 +0100 Subject: [PATCH] Fix few unused variable warnings --- Source/CParse/templ.c | 1 + Source/DOH/file.c | 2 ++ Source/Modules/go.cxx | 2 ++ Source/Modules/lua.cxx | 1 + Source/Modules/python.cxx | 1 + Source/Swig/typeobj.c | 5 +++++ 6 files changed, 12 insertions(+) diff --git a/Source/CParse/templ.c b/Source/CParse/templ.c index 22d49fac5..2f38cc2c2 100644 --- a/Source/CParse/templ.c +++ b/Source/CParse/templ.c @@ -839,6 +839,7 @@ Node *Swig_cparse_template_locate(String *name, Parm *tparms, Symtab *tscope) { String *nodeType = nodeType(n); int isclass = 0; assert(Equal(nodeType, "template")); + (void)nodeType; isclass = (Equal(Getattr(n, "templatetype"), "class")); if (!isclass) { /* If not a templated class we must have a templated function. diff --git a/Source/DOH/file.c b/Source/DOH/file.c index 570f84ed5..96f700223 100644 --- a/Source/DOH/file.c +++ b/Source/DOH/file.c @@ -64,6 +64,7 @@ static void open_files_list_remove(DohFile *f) { } Delete(sf); assert(removed); + (void)removed; } /* ----------------------------------------------------------------------------- @@ -80,6 +81,7 @@ void DohCloseAllOpenFiles() { DOHString *sf = Getitem(all_open_files, i); int check = sscanf(Char(sf), "%p", (void **)&f); assert(check == 1); + (void)check; if (f->closeondel) { if (f->filep) { check = fclose(f->filep); diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx index 0163f71df..f2d8ff3a4 100644 --- a/Source/Modules/go.cxx +++ b/Source/Modules/go.cxx @@ -4115,6 +4115,7 @@ private: String *name = Getattr(n, "sym:name"); if (!name) { assert(is_ignored); + (void)is_ignored; name = Getattr(n, "name"); } @@ -6085,6 +6086,7 @@ private: } bool r = addSymbol(name, n, scope) ? true : false; assert(r); + (void)r; return true; } diff --git a/Source/Modules/lua.cxx b/Source/Modules/lua.cxx index 188b11c2b..8723ad6cf 100644 --- a/Source/Modules/lua.cxx +++ b/Source/Modules/lua.cxx @@ -1002,6 +1002,7 @@ public: // REPORT("variableWrapper", n); String *lua_name = Getattr(n, "lua:name"); assert(lua_name); + (void)lua_name; current[VARIABLE] = true; // let SWIG generate the wrappers int result = Language::variableWrapper(n); diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index b437d2f6f..c9bc21742 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -4875,6 +4875,7 @@ public: String *classname = Swig_class_name(parent); String *rclassname = Swig_class_name(getCurrentClass()); assert(rclassname); + (void)rclassname; String *parms = make_pyParmList(n, true, false, allow_kwargs); /* Pass 'self' only if using director */ diff --git a/Source/Swig/typeobj.c b/Source/Swig/typeobj.c index 69fb6662b..9944a9eeb 100644 --- a/Source/Swig/typeobj.c +++ b/Source/Swig/typeobj.c @@ -404,6 +404,7 @@ SwigType *SwigType_del_reference(SwigType *t) { char *c = Char(t); int check = strncmp(c, "r.", 2); assert(check == 0); + (void)check; Delslice(t, 0, 2); return t; } @@ -439,6 +440,7 @@ SwigType *SwigType_del_rvalue_reference(SwigType *t) { char *c = Char(t); int check = strncmp(c, "z.", 2); assert(check == 0); + (void)check; Delslice(t, 0, 2); return t; } @@ -529,6 +531,7 @@ SwigType *SwigType_del_qualifier(SwigType *t) { char *c = Char(t); int check = strncmp(c, "q(", 2); assert(check == 0); + (void)check; Delslice(t, 0, element_size(c)); return t; } @@ -597,6 +600,7 @@ SwigType *SwigType_del_memberpointer(SwigType *t) { char *c = Char(t); int check = strncmp(c, "m(", 2); assert(check == 0); + (void)check; Delslice(t, 0, element_size(c)); return t; } @@ -641,6 +645,7 @@ SwigType *SwigType_del_array(SwigType *t) { char *c = Char(t); int check = strncmp(c, "a(", 2); assert(check == 0); + (void)check; Delslice(t, 0, element_size(c)); return t; }