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) {
|
if (tp) {
|
||||||
Symtab *tsdecl = Getattr(n, "sym:symtab");
|
Symtab *tsdecl = Getattr(n, "sym:symtab");
|
||||||
while (p && tp) {
|
while (p && tp) {
|
||||||
String *name, *value, *valuestr, *tydef, *tmp, *tmpr;
|
String *name, *value, *valuestr, *tmp, *tmpr;
|
||||||
int sz, i;
|
int sz, i;
|
||||||
String *dvalue = 0;
|
String *dvalue = 0;
|
||||||
String *qvalue = 0;
|
String *qvalue = 0;
|
||||||
|
|
||||||
name = Getattr(tp, "name");
|
name = Getattr(tp, "name");
|
||||||
value = Getattr(p, "value");
|
value = Getattr(p, "value");
|
||||||
tydef = Getattr(p, "typedef");
|
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
if (!value)
|
if (!value)
|
||||||
|
|
@ -365,9 +364,6 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
|
||||||
/* Printf(stdout,"'%s'\n", s); */
|
/* Printf(stdout,"'%s'\n", s); */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tydef) {
|
|
||||||
tydef = dvalue;
|
|
||||||
}
|
|
||||||
tmp = NewStringf("#%s", name);
|
tmp = NewStringf("#%s", name);
|
||||||
tmpr = NewStringf("\"%s\"", valuestr);
|
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++) {
|
for (i = 0; i < sz; i++) {
|
||||||
String *s = Getitem(cpatchlist, i);
|
String *s = Getitem(cpatchlist, i);
|
||||||
Replace(s, tmp, tmpr, DOH_REPLACE_ID);
|
Replace(s, tmp, tmpr, DOH_REPLACE_ID);
|
||||||
/* Replace(s,name,tydef, DOH_REPLACE_ID); */
|
|
||||||
Replace(s, name, valuestr, DOH_REPLACE_ID);
|
Replace(s, name, valuestr, DOH_REPLACE_ID);
|
||||||
}
|
}
|
||||||
Delete(tmp);
|
Delete(tmp);
|
||||||
|
|
|
||||||
|
|
@ -1583,8 +1583,6 @@ public:
|
||||||
String *cleanup = NewString("");
|
String *cleanup = NewString("");
|
||||||
String *outarg = NewString("");
|
String *outarg = NewString("");
|
||||||
|
|
||||||
idx = 0;
|
|
||||||
|
|
||||||
tm = Swig_typemap_lookup("directorout", n, "c_result", w);
|
tm = Swig_typemap_lookup("directorout", n, "c_result", w);
|
||||||
if (tm != 0) {
|
if (tm != 0) {
|
||||||
Replaceall(tm, "$input", "swig_result");
|
Replaceall(tm, "$input", "swig_result");
|
||||||
|
|
@ -1742,7 +1740,6 @@ public:
|
||||||
p = NewParm(type, NewString("self"), n);
|
p = NewParm(type, NewString("self"), n);
|
||||||
q = Copy(p);
|
q = Copy(p);
|
||||||
set_nextSibling(p, parms);
|
set_nextSibling(p, parms);
|
||||||
parms = p;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Wrapper *w = NewWrapper();
|
Wrapper *w = NewWrapper();
|
||||||
|
|
|
||||||
|
|
@ -1371,7 +1371,6 @@ public:
|
||||||
outputs++;
|
outputs++;
|
||||||
|
|
||||||
// build argument list and type conversion string
|
// build argument list and type conversion string
|
||||||
idx = 0;
|
|
||||||
p = l;
|
p = l;
|
||||||
while (p) {
|
while (p) {
|
||||||
if (checkAttribute(p, "tmap:in:numinputs", "0")) {
|
if (checkAttribute(p, "tmap:in:numinputs", "0")) {
|
||||||
|
|
|
||||||
|
|
@ -610,7 +610,6 @@ public:
|
||||||
Printf(f->code, "}\n");
|
Printf(f->code, "}\n");
|
||||||
|
|
||||||
/* Write code to extract parameters. */
|
/* Write code to extract parameters. */
|
||||||
i = 0;
|
|
||||||
for (i = 0, p = l; i < num_arguments; i++) {
|
for (i = 0, p = l; i < num_arguments; i++) {
|
||||||
|
|
||||||
/* Skip ignored arguments */
|
/* Skip ignored arguments */
|
||||||
|
|
|
||||||
|
|
@ -787,7 +787,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
f = NewWrapper();
|
f = NewWrapper();
|
||||||
numopt = 0;
|
|
||||||
|
|
||||||
String *outarg = NewStringEmpty();
|
String *outarg = NewStringEmpty();
|
||||||
String *cleanup = NewStringEmpty();
|
String *cleanup = NewStringEmpty();
|
||||||
|
|
@ -1736,7 +1735,6 @@ public:
|
||||||
if (!class_node) {
|
if (!class_node) {
|
||||||
/* This is needed when we're returning a pointer to a type
|
/* This is needed when we're returning a pointer to a type
|
||||||
* rather than returning the type by value or reference. */
|
* rather than returning the type by value or reference. */
|
||||||
class_node = current_class;
|
|
||||||
Delete(mangled);
|
Delete(mangled);
|
||||||
mangled = NewString(SwigType_manglestr(ret_type));
|
mangled = NewString(SwigType_manglestr(ret_type));
|
||||||
class_node = Getattr(zend_types, mangled);
|
class_node = Getattr(zend_types, mangled);
|
||||||
|
|
|
||||||
|
|
@ -746,7 +746,6 @@ SwigType *SwigType_add_function(SwigType *t, ParmList *parms) {
|
||||||
|
|
||||||
Insert(t, 0, ").");
|
Insert(t, 0, ").");
|
||||||
pstr = NewString("f(");
|
pstr = NewString("f(");
|
||||||
p = parms;
|
|
||||||
for (p = parms; p; p = nextSibling(p)) {
|
for (p = parms; p; p = nextSibling(p)) {
|
||||||
if (p != parms)
|
if (p != parms)
|
||||||
Putc(',', pstr);
|
Putc(',', pstr);
|
||||||
|
|
@ -844,7 +843,6 @@ SwigType *SwigType_add_template(SwigType *t, ParmList *parms) {
|
||||||
Parm *p;
|
Parm *p;
|
||||||
|
|
||||||
Append(t, "<(");
|
Append(t, "<(");
|
||||||
p = parms;
|
|
||||||
for (p = parms; p; p = nextSibling(p)) {
|
for (p = parms; p; p = nextSibling(p)) {
|
||||||
String *v;
|
String *v;
|
||||||
if (Getattr(p, "default"))
|
if (Getattr(p, "default"))
|
||||||
|
|
|
||||||
|
|
@ -820,7 +820,7 @@ SwigType *SwigType_typedef_resolve(const SwigType *t) {
|
||||||
|
|
||||||
type_elem = SwigType_split(type);
|
type_elem = SwigType_split(type);
|
||||||
type_sz = Len(type_elem);
|
type_sz = Len(type_elem);
|
||||||
i = 0;
|
|
||||||
for (i = 0; i < type_sz; ++i) {
|
for (i = 0; i < type_sz; ++i) {
|
||||||
String *e = Getitem(type_elem, i);
|
String *e = Getitem(type_elem, i);
|
||||||
if (!SwigType_isarray(e))
|
if (!SwigType_isarray(e))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue