Fix few unused variable warnings

This commit is contained in:
Michel Zou 2021-03-06 08:20:27 +01:00 • committed by William S Fulton
commit ee8d47cec4
6 changed files with 12 additions and 0 deletions

View file

@ -839,6 +839,7 @@ Node *Swig_cparse_template_locate(String *name, Parm *tparms, Symtab *tscope) {
String *nodeType = nodeType(n); String *nodeType = nodeType(n);
int isclass = 0; int isclass = 0;
assert(Equal(nodeType, "template")); assert(Equal(nodeType, "template"));
(void)nodeType;
isclass = (Equal(Getattr(n, "templatetype"), "class")); isclass = (Equal(Getattr(n, "templatetype"), "class"));
if (!isclass) { if (!isclass) {
/* If not a templated class we must have a templated function. /* If not a templated class we must have a templated function.

View file

@ -64,6 +64,7 @@ static void open_files_list_remove(DohFile *f) {
} }
Delete(sf); Delete(sf);
assert(removed); assert(removed);
(void)removed;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
@ -80,6 +81,7 @@ void DohCloseAllOpenFiles() {
DOHString *sf = Getitem(all_open_files, i); DOHString *sf = Getitem(all_open_files, i);
int check = sscanf(Char(sf), "%p", (void **)&f); int check = sscanf(Char(sf), "%p", (void **)&f);
assert(check == 1); assert(check == 1);
(void)check;
if (f->closeondel) { if (f->closeondel) {
if (f->filep) { if (f->filep) {
check = fclose(f->filep); check = fclose(f->filep);

View file

@ -4115,6 +4115,7 @@ private:
String *name = Getattr(n, "sym:name"); String *name = Getattr(n, "sym:name");
if (!name) { if (!name) {
assert(is_ignored); assert(is_ignored);
(void)is_ignored;
name = Getattr(n, "name"); name = Getattr(n, "name");
} }
@ -6085,6 +6086,7 @@ private:
} }
bool r = addSymbol(name, n, scope) ? true : false; bool r = addSymbol(name, n, scope) ? true : false;
assert(r); assert(r);
(void)r;
return true; return true;
} }

View file

@ -1002,6 +1002,7 @@ public:
// REPORT("variableWrapper", n); // REPORT("variableWrapper", n);
String *lua_name = Getattr(n, "lua:name"); String *lua_name = Getattr(n, "lua:name");
assert(lua_name); assert(lua_name);
(void)lua_name;
current[VARIABLE] = true; current[VARIABLE] = true;
// let SWIG generate the wrappers // let SWIG generate the wrappers
int result = Language::variableWrapper(n); int result = Language::variableWrapper(n);

View file

@ -4875,6 +4875,7 @@ public:
String *classname = Swig_class_name(parent); String *classname = Swig_class_name(parent);
String *rclassname = Swig_class_name(getCurrentClass()); String *rclassname = Swig_class_name(getCurrentClass());
assert(rclassname); assert(rclassname);
(void)rclassname;
String *parms = make_pyParmList(n, true, false, allow_kwargs); String *parms = make_pyParmList(n, true, false, allow_kwargs);
/* Pass 'self' only if using director */ /* Pass 'self' only if using director */

View file

@ -404,6 +404,7 @@ SwigType *SwigType_del_reference(SwigType *t) {
char *c = Char(t); char *c = Char(t);
int check = strncmp(c, "r.", 2); int check = strncmp(c, "r.", 2);
assert(check == 0); assert(check == 0);
(void)check;
Delslice(t, 0, 2); Delslice(t, 0, 2);
return t; return t;
} }
@ -439,6 +440,7 @@ SwigType *SwigType_del_rvalue_reference(SwigType *t) {
char *c = Char(t); char *c = Char(t);
int check = strncmp(c, "z.", 2); int check = strncmp(c, "z.", 2);
assert(check == 0); assert(check == 0);
(void)check;
Delslice(t, 0, 2); Delslice(t, 0, 2);
return t; return t;
} }
@ -529,6 +531,7 @@ SwigType *SwigType_del_qualifier(SwigType *t) {
char *c = Char(t); char *c = Char(t);
int check = strncmp(c, "q(", 2); int check = strncmp(c, "q(", 2);
assert(check == 0); assert(check == 0);
(void)check;
Delslice(t, 0, element_size(c)); Delslice(t, 0, element_size(c));
return t; return t;
} }
@ -597,6 +600,7 @@ SwigType *SwigType_del_memberpointer(SwigType *t) {
char *c = Char(t); char *c = Char(t);
int check = strncmp(c, "m(", 2); int check = strncmp(c, "m(", 2);
assert(check == 0); assert(check == 0);
(void)check;
Delslice(t, 0, element_size(c)); Delslice(t, 0, element_size(c));
return t; return t;
} }
@ -641,6 +645,7 @@ SwigType *SwigType_del_array(SwigType *t) {
char *c = Char(t); char *c = Char(t);
int check = strncmp(c, "a(", 2); int check = strncmp(c, "a(", 2);
assert(check == 0); assert(check == 0);
(void)check;
Delslice(t, 0, element_size(c)); Delslice(t, 0, element_size(c));
return t; return t;
} }