Fix some useless code detected by scan-build (LLVM/Clang)
This commit is contained in:
parent
670962cfe8
commit
e0b14786d6
7 changed files with 2 additions and 16 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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")) {
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue