Remove some vc++ /W4 warnings

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10540 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-06-21 15:23:02 +00:00
commit 49675199f4
20 changed files with 146 additions and 152 deletions

View file

@ -513,7 +513,8 @@ String *Swig_cppconstructor_base_call(String_or_char *name, ParmList *parms, int
pname = Swig_cparm_name(p, i);
i++;
} else {
if ((pname = Getattr(p, "value")))
pname = Getattr(p, "value");
if (pname)
pname = Copy(pname);
else
pname = Copy(Getattr(p, "name"));

View file

@ -352,7 +352,8 @@ char *Swig_file_filename(const String_or_char *filename) {
char *c;
strcpy(tmp, Char(filename));
if ((c = strrchr(tmp, *delim)))
c = strrchr(tmp, *delim);
if (c)
return c + 1;
else
return tmp;

View file

@ -614,7 +614,8 @@ void Swig_scopename_split(String *s, String **rprefix, String **rlast) {
*rlast = Copy(s);
}
if ((co = strstr(cc, "operator "))) {
co = strstr(cc, "operator ");
if (co) {
if (co == cc) {
*rprefix = 0;
*rlast = Copy(s);
@ -664,7 +665,9 @@ String *Swig_scopename_prefix(String *s) {
char *co = 0;
if (!strstr(c, "::"))
return 0;
if ((co = strstr(cc, "operator "))) {
co = strstr(cc, "operator ");
if (co) {
if (co == cc) {
return 0;
} else {
@ -715,7 +718,8 @@ String *Swig_scopename_last(String *s) {
if (!strstr(c, "::"))
return NewString(s);
if ((co = strstr(cc, "operator "))) {
co = strstr(cc, "operator ");
if (co) {
return NewString(co);
}
@ -756,7 +760,9 @@ String *Swig_scopename_first(String *s) {
char *co = 0;
if (!strstr(c, "::"))
return 0;
if ((co = strstr(c, "operator "))) {
co = strstr(c, "operator ");
if (co) {
if (co == c) {
return 0;
}
@ -804,7 +810,9 @@ String *Swig_scopename_suffix(String *s) {
char *co = 0;
if (!strstr(c, "::"))
return 0;
if ((co = strstr(c, "operator "))) {
co = strstr(c, "operator ");
if (co) {
if (co == c)
return 0;
}
@ -842,8 +850,9 @@ String *Swig_scopename_suffix(String *s) {
int Swig_scopename_check(String *s) {
char *c = Char(s);
char *co = 0;
if ((co = strstr(c, "operator "))) {
char *co = strstr(c, "operator ");
if (co) {
if (co == c)
return 0;
}

View file

@ -482,7 +482,8 @@ DOH *Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType
Delete(t_name);
}
/* A template-based class lookup */
if (0 && !rn && SwigType_istemplate(prefix)) {
/*
if (!rn && SwigType_istemplate(prefix)) {
String *t_prefix = SwigType_templateprefix(prefix);
if (Strcmp(t_prefix, prefix) != 0) {
String *t_name = SwigType_templateprefix(name);
@ -491,6 +492,7 @@ DOH *Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType
}
Delete(t_prefix);
}
*/
}
/* A wildcard-based class lookup */
if (!rn) {

View file

@ -200,7 +200,7 @@ static char nextchar(Scanner * s) {
if ((nc == '\n') && (!s->freeze_line))
s->line++;
Putc(nc,s->text);
return nc;
return (char)nc;
}
/* -----------------------------------------------------------------------------
@ -349,7 +349,7 @@ static void get_escape(Scanner *s) {
} else {
char tmp[3];
tmp[0] = '\\';
tmp[1] = c;
tmp[1] = (char)c;
tmp[2] = 0;
Delitem(s->text, DOH_END);
Append(s->text, tmp);

View file

@ -937,7 +937,8 @@ String *SwigType_templateargs(const SwigType *t) {
int SwigType_istemplate(const SwigType *t) {
char *ct = Char(t);
if ((ct = strstr(ct, "<(")) && (strstr(ct + 2, ")>")))
ct = strstr(ct, "<(");
if (ct && (strstr(ct + 2, ")>")))
return 1;
return 0;
}

View file

@ -108,6 +108,8 @@ static Hash *typedef_resolve_cache = 0;
static Hash *typedef_all_cache = 0;
static Hash *typedef_qualified_cache = 0;
static Typetab *SwigType_find_scope(Typetab *s, String *nameprefix);
/* common attribute keys, to avoid calling find_key all the times */
/*
@ -162,7 +164,6 @@ void SwigType_typesystem_init() {
* ----------------------------------------------------------------------------- */
int SwigType_typedef(SwigType *type, String_or_char *name) {
Typetab *SwigType_find_scope(Typetab *, String *s);
if (Getattr(current_typetab, name))
return -1; /* Already defined */
if (Strcmp(type, name) == 0) { /* Can't typedef a name to itself */
@ -409,7 +410,7 @@ void SwigType_print_scope(Typetab *t) {
}
}
Typetab *SwigType_find_scope(Typetab *s, String *nameprefix) {
static Typetab *SwigType_find_scope(Typetab *s, String *nameprefix) {
Typetab *ss;
String *nnameprefix = 0;
static int check_parent = 1;
@ -1311,7 +1312,8 @@ SwigType *SwigType_alttype(SwigType *t, int local_tmap) {
SwigType *ftd = SwigType_typedef_resolve_all(t);
td = SwigType_strip_qualifiers(ftd);
Delete(ftd);
if ((n = Swig_symbol_clookup(td, 0))) {
n = Swig_symbol_clookup(td, 0);
if (n) {
if (GetFlag(n, "feature:valuewrapper")) {
use_wrapper = 1;
} else {
@ -1334,7 +1336,8 @@ SwigType *SwigType_alttype(SwigType *t, int local_tmap) {
Delete(ftd);
if (SwigType_type(td) == T_USER) {
use_wrapper = 1;
if ((n = Swig_symbol_clookup(td, 0))) {
n = Swig_symbol_clookup(td, 0);
if (n) {
if ((Checkattr(n, "nodeType", "class")
&& !Getattr(n, "allocate:noassign")
&& (Getattr(n, "allocate:default_constructor")))