Remove set but not used variables

Highlighted by clang-15 warnings such as:

warning: variable 'index' set but not used [-Wunused-but-set-variable]
This commit is contained in:
Olly Betts 2022-06-30 12:50:53 +12:00
commit f5e2d044df
6 changed files with 1 additions and 20 deletions

View file

@ -97,7 +97,6 @@ String *Swig_director_declaration(Node *n) {
String *Swig_method_call(const_String_or_char_ptr name, ParmList *parms) {
String *func;
int i = 0;
int comma = 0;
Parm *p = parms;
SwigType *pt;
@ -115,7 +114,6 @@ String *Swig_method_call(const_String_or_char_ptr name, ParmList *parms) {
pname = Getattr(p, "name");
Printf(func, "%s", pname);
comma = 1;
i++;
}
p = nextSibling(p);
}

View file

@ -1418,7 +1418,6 @@ public:
List *baselist = Getattr(n, "bases");
if (baselist && Len(baselist)) {
Iterator b;
int index = 0;
b = First(baselist);
while (b.item) {
String *bname = Getattr(b.item, "name");
@ -1431,7 +1430,6 @@ public:
Printf(base_class_names, "\"%s *\",", SwigType_namestr(bname));
b = Next(b);
index++;
}
}
// First, print class static part

View file

@ -1486,10 +1486,6 @@ public:
int i;
char source[256];
int outputs = 0;
if (!is_void)
outputs++;
/* build argument list and type conversion string */
for (i = 0, idx = 0, p = l; i < num_arguments; i++) {
@ -1497,9 +1493,6 @@ public:
p = Getattr(p, "tmap:ignore:next");
}
if (Getattr(p, "tmap:directorargout") != 0)
outputs++;
String *pname = Getattr(p, "name");
String *ptype = Getattr(p, "type");

View file

@ -1003,7 +1003,6 @@ public:
List *baselist = Getattr(n, "bases");
if (baselist && Len(baselist)) {
Iterator b;
int index = 0;
b = First(baselist);
while (b.item) {
String *bname = Getattr(b.item, "name");
@ -1016,7 +1015,6 @@ public:
Printf(base_class_names, "\"%s\",", bname_mangled);
Printf(base_class, "0,");
b = Next(b);
index++;
Delete(bname_mangled);
}
}

View file

@ -2167,10 +2167,6 @@ public:
Parm *p;
int outputs = 0;
if (!is_void)
outputs++;
/* build argument list and type conversion string */
idx = 0;
p = l;
@ -2180,9 +2176,6 @@ public:
continue;
}
if (Getattr(p, "tmap:directorargout") != 0)
outputs++;
String *pname = Getattr(p, "name");
String *ptype = Getattr(p, "type");

View file

@ -825,6 +825,7 @@ public:
//Printf(f_init,"/* Register base : %s */\n", bmangle);
//Printf(f_init,"swig_%s_bases[%d] = (swig_class *) SWIG_TypeQuery(\"%s *\")->clientdata;\n", mangled_classname, index, SwigType_namestr(bname));
(void)index;
b = Next(b);
index++;
Putc(',', base_class);