aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>2013-03-05 18:17:50 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2013-03-08 20:53:18 +0000
commite0b14786d6d22276dda85354babbfeffdfd78072 (patch)
tree85f86356ae498b03392e0370de252059d0496072
parent670962cfe8d951004f927c803e505f23ee373d3a (diff)
downloadswig-e0b14786d6d22276dda85354babbfeffdfd78072.tar.gz
Fix some useless code detected by scan-build (LLVM/Clang)
-rw-r--r--Source/CParse/templ.c7
-rw-r--r--Source/Modules/ocaml.cxx3
-rw-r--r--Source/Modules/octave.cxx1
-rw-r--r--Source/Modules/perl5.cxx1
-rw-r--r--Source/Modules/php.cxx2
-rw-r--r--Source/Swig/typeobj.c2
-rw-r--r--Source/Swig/typesys.c2
7 files changed, 2 insertions, 16 deletions
diff --git a/Source/CParse/templ.c b/Source/CParse/templ.c
index ed6acfc8c..48bdf4faa 100644
--- a/Source/CParse/templ.c
+++ b/Source/CParse/templ.c
@@ -317,14 +317,13 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
if (tp) {
Symtab *tsdecl = Getattr(n, "sym:symtab");
while (p && tp) {
- String *name, *value, *valuestr, *tydef, *tmp, *tmpr;
+ String *name, *value, *valuestr, *tmp, *tmpr;
int sz, i;
String *dvalue = 0;
String *qvalue = 0;
name = Getattr(tp, "name");
value = Getattr(p, "value");
- tydef = Getattr(p, "typedef");
if (name) {
if (!value)
@@ -365,9 +364,6 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
/* Printf(stdout,"'%s'\n", s); */
}
- if (!tydef) {
- tydef = dvalue;
- }
tmp = NewStringf("#%s", name);
tmpr = NewStringf("\"%s\"", valuestr);
@@ -375,7 +371,6 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
for (i = 0; i < sz; i++) {
String *s = Getitem(cpatchlist, i);
Replace(s, tmp, tmpr, DOH_REPLACE_ID);
- /* Replace(s,name,tydef, DOH_REPLACE_ID); */
Replace(s, name, valuestr, DOH_REPLACE_ID);
}
Delete(tmp);
diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx
index 34c8975c5..c5fcf69dd 100644
--- a/Source/Modules/ocaml.cxx
+++ b/Source/Modules/ocaml.cxx
@@ -1583,8 +1583,6 @@ public:
String *cleanup = NewString("");
String *outarg = NewString("");
- idx = 0;
-
tm = Swig_typemap_lookup("directorout", n, "c_result", w);
if (tm != 0) {
Replaceall(tm, "$input", "swig_result");
@@ -1742,7 +1740,6 @@ public:
p = NewParm(type, NewString("self"), n);
q = Copy(p);
set_nextSibling(p, parms);
- parms = p;
{
Wrapper *w = NewWrapper();
diff --git a/Source/Modules/octave.cxx b/Source/Modules/octave.cxx
index bbe442b7e..6f6e5b8ae 100644
--- a/Source/Modules/octave.cxx
+++ b/Source/Modules/octave.cxx
@@ -1371,7 +1371,6 @@ public:
outputs++;
// build argument list and type conversion string
- idx = 0;
p = l;
while (p) {
if (checkAttribute(p, "tmap:in:numinputs", "0")) {
diff --git a/Source/Modules/perl5.cxx b/Source/Modules/perl5.cxx
index 7147e67c1..09500b23b 100644
--- a/Source/Modules/perl5.cxx
+++ b/Source/Modules/perl5.cxx
@@ -610,7 +610,6 @@ public:
Printf(f->code, "}\n");
/* Write code to extract parameters. */
- i = 0;
for (i = 0, p = l; i < num_arguments; i++) {
/* Skip ignored arguments */
diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx
index 292f979ba..fdd335993 100644
--- a/Source/Modules/php.cxx
+++ b/Source/Modules/php.cxx
@@ -787,7 +787,6 @@ public:
}
f = NewWrapper();
- numopt = 0;
String *outarg = NewStringEmpty();
String *cleanup = NewStringEmpty();
@@ -1736,7 +1735,6 @@ public:
if (!class_node) {
/* This is needed when we're returning a pointer to a type
* rather than returning the type by value or reference. */
- class_node = current_class;
Delete(mangled);
mangled = NewString(SwigType_manglestr(ret_type));
class_node = Getattr(zend_types, mangled);
diff --git a/Source/Swig/typeobj.c b/Source/Swig/typeobj.c
index 1fe63ff27..56892f3f8 100644
--- a/Source/Swig/typeobj.c
+++ b/Source/Swig/typeobj.c
@@ -746,7 +746,6 @@ SwigType *SwigType_add_function(SwigType *t, ParmList *parms) {
Insert(t, 0, ").");
pstr = NewString("f(");
- p = parms;
for (p = parms; p; p = nextSibling(p)) {
if (p != parms)
Putc(',', pstr);
@@ -844,7 +843,6 @@ SwigType *SwigType_add_template(SwigType *t, ParmList *parms) {
Parm *p;
Append(t, "<(");
- p = parms;
for (p = parms; p; p = nextSibling(p)) {
String *v;
if (Getattr(p, "default"))
diff --git a/Source/Swig/typesys.c b/Source/Swig/typesys.c
index 372ac3f65..c10ffbfb5 100644
--- a/Source/Swig/typesys.c
+++ b/Source/Swig/typesys.c
@@ -820,7 +820,7 @@ SwigType *SwigType_typedef_resolve(const SwigType *t) {
type_elem = SwigType_split(type);
type_sz = Len(type_elem);
- i = 0;
+
for (i = 0; i < type_sz; ++i) {
String *e = Getitem(type_elem, i);
if (!SwigType_isarray(e))