From f5e2d044df193f3aa2340eca9ee47d5f125982fc Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 30 Jun 2022 12:50:53 +1200 Subject: [PATCH] Remove set but not used variables Highlighted by clang-15 warnings such as: warning: variable 'index' set but not used [-Wunused-but-set-variable] --- Source/Modules/directors.cxx | 2 -- Source/Modules/lua.cxx | 2 -- Source/Modules/ocaml.cxx | 7 ------- Source/Modules/octave.cxx | 2 -- Source/Modules/php.cxx | 7 ------- Source/Modules/tcl8.cxx | 1 + 6 files changed, 1 insertion(+), 20 deletions(-) diff --git a/Source/Modules/directors.cxx b/Source/Modules/directors.cxx index 196974792..4ca8b25e5 100644 --- a/Source/Modules/directors.cxx +++ b/Source/Modules/directors.cxx @@ -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); } diff --git a/Source/Modules/lua.cxx b/Source/Modules/lua.cxx index 18cf8a346..5265aa5c1 100644 --- a/Source/Modules/lua.cxx +++ b/Source/Modules/lua.cxx @@ -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 diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index 97bb8cc17..84f16aa99 100644 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -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"); diff --git a/Source/Modules/octave.cxx b/Source/Modules/octave.cxx index 9e5bd17a1..e6c55fb0b 100644 --- a/Source/Modules/octave.cxx +++ b/Source/Modules/octave.cxx @@ -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); } } diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index c424572f1..67f7f1f19 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -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"); diff --git a/Source/Modules/tcl8.cxx b/Source/Modules/tcl8.cxx index 641dfc866..72908d8ed 100644 --- a/Source/Modules/tcl8.cxx +++ b/Source/Modules/tcl8.cxx @@ -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);