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

@ -331,7 +331,9 @@ static void add_symbols(Node *n) {
Delete(prefix); Delete(prefix);
} }
if (0 && !Getattr(n,"parentNode") && class_level) set_parentNode(n,class_decl[class_level - 1]); /*
if (!Getattr(n,"parentNode") && class_level) set_parentNode(n,class_decl[class_level - 1]);
*/
Setattr(n,"ismember","1"); Setattr(n,"ismember","1");
} }
} }
@ -4109,10 +4111,11 @@ cpp_destructor_decl : NOT idtemplate LPAREN parms RPAREN cpp_end {
/* Check for template names. If the class is a template /* Check for template names. If the class is a template
and the constructor is missing the template part, we and the constructor is missing the template part, we
add it */ add it */
if (Classprefix && (c = strchr(Char(Classprefix),'<'))) { if (Classprefix) {
if (!Strchr($3,'<')) { c = strchr(Char(Classprefix),'<');
$3 = NewStringf("%s%s",$3,c); if (c && !Strchr($3,'<')) {
} $3 = NewStringf("%s%s",$3,c);
}
} }
Setattr($$,"storage","virtual"); Setattr($$,"storage","virtual");
name = NewStringf("%s",$3); name = NewStringf("%s",$3);
@ -4428,12 +4431,8 @@ parms : rawparms {
; ;
rawparms : parm ptail { rawparms : parm ptail {
if (1) { set_nextSibling($1,$2);
set_nextSibling($1,$2); $$ = $1;
$$ = $1;
} else {
$$ = $2;
}
} }
| empty { $$ = 0; } | empty { $$ = 0; }
; ;
@ -4486,12 +4485,8 @@ valparms : rawvalparms {
; ;
rawvalparms : valparm valptail { rawvalparms : valparm valptail {
if (1) { set_nextSibling($1,$2);
set_nextSibling($1,$2); $$ = $1;
$$ = $1;
} else {
$$ = $2;
}
} }
| empty { $$ = 0; } | empty { $$ = 0; }
; ;

View file

@ -281,13 +281,13 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
Delete(ptargs); Delete(ptargs);
} }
if (0) { /*
Parm *p = tparms; Parm *p = tparms;
while (p) { while (p) {
Printf(stdout, "tparm: '%s' '%s' '%s'\n", Getattr(p, "name"), Getattr(p, "type"), Getattr(p, "value")); Printf(stdout, "tparm: '%s' '%s' '%s'\n", Getattr(p, "name"), Getattr(p, "type"), Getattr(p, "value"));
p = nextSibling(p); p = nextSibling(p);
} }
} */
/* Printf(stdout,"targs = '%s'\n", templateargs); /* Printf(stdout,"targs = '%s'\n", templateargs);
Printf(stdout,"rname = '%s'\n", rname); Printf(stdout,"rname = '%s'\n", rname);

View file

@ -112,12 +112,11 @@ static void DelHash(DOH *ho) {
int i; int i;
for (i = 0; i < h->hashsize; i++) { for (i = 0; i < h->hashsize; i++) {
if ((n = h->hashtable[i])) { n = h->hashtable[i];
while (n) { while (n) {
next = n->next; next = n->next;
DelNode(n); DelNode(n);
n = next; n = next;
}
} }
} }
DohFree(h->hashtable); DohFree(h->hashtable);
@ -138,12 +137,11 @@ static void Hash_clear(DOH *ho) {
int i; int i;
for (i = 0; i < h->hashsize; i++) { for (i = 0; i < h->hashsize; i++) {
if ((n = h->hashtable[i])) { n = h->hashtable[i];
while (n) { while (n) {
next = n->next; next = n->next;
DelNode(n); DelNode(n);
n = next; n = next;
}
} }
h->hashtable[i] = 0; h->hashtable[i] = 0;
} }
@ -454,11 +452,10 @@ static DOH *CopyHash(DOH *ho) {
nho = DohObjMalloc(&DohHashType, nh); nho = DohObjMalloc(&DohHashType, nh);
for (i = 0; i < h->hashsize; i++) { for (i = 0; i < h->hashsize; i++) {
if ((n = h->hashtable[i])) { n = h->hashtable[i];
while (n) { while (n) {
Hash_setattr(nho, n->key, n->object); Hash_setattr(nho, n->key, n->object);
n = n->next; n = n->next;
}
} }
} }
return nho; return nho;

View file

@ -2935,11 +2935,9 @@ int ALLEGROCL::classHandler(Node *n) {
#endif #endif
if (Generate_Wrapper) if (Generate_Wrapper)
return cppClassHandler(n); return cppClassHandler(n);
else else
return cClassHandler(n); return cClassHandler(n);
return SWIG_OK;
} }
int ALLEGROCL::cClassHandler(Node *n) { int ALLEGROCL::cClassHandler(Node *n) {

View file

@ -329,7 +329,6 @@ int CHICKEN::functionWrapper(Node *n) {
Parm *p; Parm *p;
int i; int i;
String *wname; String *wname;
String *source;
Wrapper *f; Wrapper *f;
String *mangle = NewString(""); String *mangle = NewString("");
String *get_pointers; String *get_pointers;
@ -398,8 +397,6 @@ int CHICKEN::functionWrapper(Node *n) {
SwigType *pt = Getattr(p, "type"); SwigType *pt = Getattr(p, "type");
String *ln = Getattr(p, "lname"); String *ln = Getattr(p, "lname");
source = NewStringf("scm%d", i + 1);
Printf(f->def, ", C_word scm%d", i + 1); Printf(f->def, ", C_word scm%d", i + 1);
Printf(declfunc, ",C_word"); Printf(declfunc, ",C_word");
@ -407,6 +404,7 @@ int CHICKEN::functionWrapper(Node *n) {
if ((tm = Getattr(p, "tmap:in"))) { if ((tm = Getattr(p, "tmap:in"))) {
String *parse = Getattr(p, "tmap:in:parse"); String *parse = Getattr(p, "tmap:in:parse");
if (!parse) { if (!parse) {
String *source = NewStringf("scm%d", i + 1);
Replaceall(tm, "$source", source); Replaceall(tm, "$source", source);
Replaceall(tm, "$target", ln); Replaceall(tm, "$target", ln);
Replaceall(tm, "$input", source); Replaceall(tm, "$input", source);
@ -445,20 +443,15 @@ int CHICKEN::functionWrapper(Node *n) {
} }
} }
} }
Delete(source);
} else {
} }
p = Getattr(p, "tmap:in:next"); p = Getattr(p, "tmap:in:next");
continue; continue;
} else { } else {
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
break; break;
} }
Delete(source);
p = nextSibling(p);
} }
/* finish argument marshalling */ /* finish argument marshalling */

View file

@ -1097,38 +1097,33 @@ int Language::globalfunctionHandler(Node *n) {
String *name = Getattr(n, "name"); String *name = Getattr(n, "name");
String *symname = Getattr(n, "sym:name"); String *symname = Getattr(n, "sym:name");
SwigType *type = Getattr(n, "type"); SwigType *type = Getattr(n, "type");
String *storage = Getattr(n, "storage");
ParmList *parms = Getattr(n, "parms"); ParmList *parms = Getattr(n, "parms");
if (0 && (Cmp(storage, "static") == 0)) { /* Check for callback mode */
Swig_restore(n); String *cb = GetFlagAttr(n, "feature:callback");
return SWIG_NOWRAP; /* Can't wrap static functions */ if (cb) {
} else { String *cbname = Getattr(n, "feature:callback:name");
/* Check for callback mode */ if (!cbname) {
String *cb = GetFlagAttr(n, "feature:callback"); cbname = NewStringf(cb, symname);
if (cb) { Setattr(n, "feature:callback:name", cbname);
String *cbname = Getattr(n, "feature:callback:name");
if (!cbname) {
cbname = NewStringf(cb, symname);
Setattr(n, "feature:callback:name", cbname);
}
callbackfunctionHandler(n);
if (Cmp(cbname, symname) == 0) {
Delete(cbname);
Swig_restore(n);
return SWIG_NOWRAP;
}
Delete(cbname);
} }
Setattr(n, "parms", nonvoid_parms(parms));
String *call = Swig_cfunction_call(name, parms); callbackfunctionHandler(n);
String *cres = Swig_cresult(type, "result", call); if (Cmp(cbname, symname) == 0) {
Setattr(n, "wrap:action", cres); Delete(cbname);
Delete(cres); Swig_restore(n);
Delete(call); return SWIG_NOWRAP;
functionWrapper(n); }
Delete(cbname);
} }
Setattr(n, "parms", nonvoid_parms(parms));
String *call = Swig_cfunction_call(name, parms);
String *cres = Swig_cresult(type, "result", call);
Setattr(n, "wrap:action", cres);
Delete(cres);
Delete(call);
functionWrapper(n);
Swig_restore(n); Swig_restore(n);
return SWIG_OK; return SWIG_OK;
} }
@ -1376,9 +1371,6 @@ int Language::variableHandler(Node *n) {
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
int Language::globalvariableHandler(Node *n) { int Language::globalvariableHandler(Node *n) {
String *storage = Getattr(n, "storage");
if (0 && (Cmp(storage, "static") == 0))
return SWIG_NOWRAP;
variableWrapper(n); variableWrapper(n);
return SWIG_OK; return SWIG_OK;
} }
@ -2108,8 +2100,8 @@ int Language::classDirector(Node *n) {
String *using_protected_members_code = NewString(""); String *using_protected_members_code = NewString("");
for (ni = Getattr(n, "firstChild"); ni; ni = nextSibling(ni)) { for (ni = Getattr(n, "firstChild"); ni; ni = nextSibling(ni)) {
Node *nodeType = Getattr(ni, "nodeType"); Node *nodeType = Getattr(ni, "nodeType");
bool cdecl = (Cmp(nodeType, "cdecl") == 0); bool cdeclaration = (Cmp(nodeType, "cdecl") == 0);
if (cdecl && !GetFlag(ni, "feature:ignore")) { if (cdeclaration && !GetFlag(ni, "feature:ignore")) {
if (is_non_virtual_protected_access(ni)) { if (is_non_virtual_protected_access(ni)) {
Node *overloaded = Getattr(ni, "sym:overloaded"); Node *overloaded = Getattr(ni, "sym:overloaded");
// emit the using base::member statement (but only once if the method is overloaded) // emit the using base::member statement (but only once if the method is overloaded)
@ -3391,7 +3383,8 @@ int Language::is_assignable(Node *n) {
SwigType *ftd = SwigType_typedef_resolve_all(type); SwigType *ftd = SwigType_typedef_resolve_all(type);
SwigType *td = SwigType_strip_qualifiers(ftd); SwigType *td = SwigType_strip_qualifiers(ftd);
if (SwigType_type(td) == T_USER) { if (SwigType_type(td) == T_USER) {
if ((cn = Swig_symbol_clookup(td, 0))) { cn = Swig_symbol_clookup(td, 0);
if (cn) {
if ((Strcmp(nodeType(cn), "class") == 0)) { if ((Strcmp(nodeType(cn), "class") == 0)) {
if (Getattr(cn, "allocate:noassign")) { if (Getattr(cn, "allocate:noassign")) {
SetFlag(n, "feature:immutable"); SetFlag(n, "feature:immutable");

View file

@ -490,8 +490,6 @@ public:
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
break; break;
} }
p = nextSibling(p);
} }
// add all argcheck code // add all argcheck code
@ -1101,7 +1099,6 @@ public:
virtual int staticmemberfunctionHandler(Node *n) { virtual int staticmemberfunctionHandler(Node *n) {
current = STATIC_FUNC; current = STATIC_FUNC;
return Language::staticmemberfunctionHandler(n); return Language::staticmemberfunctionHandler(n);
current = NO_CPP;
} }
/* ------------------------------------------------------------ /* ------------------------------------------------------------
@ -1123,7 +1120,6 @@ public:
// REPORT("staticmembervariableHandler",n); // REPORT("staticmembervariableHandler",n);
current = STATIC_VAR; current = STATIC_VAR;
return Language::staticmembervariableHandler(n); return Language::staticmembervariableHandler(n);
current = NO_CPP;
} }
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------

View file

@ -472,9 +472,9 @@ MODULA3():
cap = true; cap = true;
} else { } else {
if (cap) { if (cap) {
m3sym[i] = toupper(c); m3sym[i] = (char)toupper(c);
} else { } else {
m3sym[i] = tolower(c); m3sym[i] = (char)tolower(c);
} }
cap = false; cap = false;
} }

View file

@ -150,45 +150,44 @@ void SwigPHP_emit_resource_registrations() {
ki = First(zend_types); ki = First(zend_types);
if (ki.key) if (ki.key)
Printf(s_oinit, "\n/* Register resource destructors for pointer types */\n"); Printf(s_oinit, "\n/* Register resource destructors for pointer types */\n");
while (ki.key) while (ki.key) {
if (1 /* is pointer type */ ) { DOH *key = ki.key;
DOH *key = ki.key; Node *class_node = ki.item;
Node *class_node = ki.item; String *human_name = key;
String *human_name = key;
// Write out destructor function header // Write out destructor function header
Printf(s_wrappers, "/* NEW Destructor style */\nstatic ZEND_RSRC_DTOR_FUNC(_wrap_destroy%s) {\n", key); Printf(s_wrappers, "/* NEW Destructor style */\nstatic ZEND_RSRC_DTOR_FUNC(_wrap_destroy%s) {\n", key);
// write out body // write out body
if ((class_node != NOTCLASS)) { if ((class_node != NOTCLASS)) {
String *destructor = Getattr(class_node, "destructor"); String *destructor = Getattr(class_node, "destructor");
human_name = Getattr(class_node, "sym:name"); human_name = Getattr(class_node, "sym:name");
if (!human_name) if (!human_name)
human_name = Getattr(class_node, "name"); human_name = Getattr(class_node, "name");
// Do we have a known destructor for this type? // Do we have a known destructor for this type?
if (destructor) { if (destructor) {
Printf(s_wrappers, " %s(rsrc, SWIGTYPE%s->name TSRMLS_CC);\n", destructor, key); Printf(s_wrappers, " %s(rsrc, SWIGTYPE%s->name TSRMLS_CC);\n", destructor, key);
} else {
Printf(s_wrappers, " /* No destructor for class %s */\n", human_name);
}
} else { } else {
Printf(s_wrappers, " /* No destructor for simple type %s */\n", key); Printf(s_wrappers, " /* No destructor for class %s */\n", human_name);
} }
} else {
// close function Printf(s_wrappers, " /* No destructor for simple type %s */\n", key);
Printf(s_wrappers, "}\n");
// declare le_swig_<mangled> to store php registration
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
// register with php
Printf(s_oinit, "le_swig_%s=zend_register_list_destructors_ex" "(_wrap_destroy%s,NULL,(char *)(SWIGTYPE%s->name),module_number);\n", key, key, key);
// store php type in class struct
Printf(s_oinit, "SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
ki = Next(ki);
} }
// close function
Printf(s_wrappers, "}\n");
// declare le_swig_<mangled> to store php registration
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
// register with php
Printf(s_oinit, "le_swig_%s=zend_register_list_destructors_ex" "(_wrap_destroy%s,NULL,(char *)(SWIGTYPE%s->name),module_number);\n", key, key, key);
// store php type in class struct
Printf(s_oinit, "SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
ki = Next(ki);
}
} }
class PHP:public Language { class PHP:public Language {

View file

@ -1773,7 +1773,6 @@ public:
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
break; break;
} }
p = nextSibling(p);
} }
/* finish argument marshalling */ /* finish argument marshalling */

View file

@ -57,11 +57,13 @@ static String * getRTypeName(SwigType *t, int *outCount = NULL) {
Insert(tmp, 0, retName); Insert(tmp, 0, retName);
return tmp; return tmp;
/*
if(count) if(count)
return(b); return(b);
Delete(b); Delete(b);
return(NewString("")); return(NewString(""));
*/
} }
#if 0 #if 0
@ -104,7 +106,7 @@ static String * getRType(Node *n) {
Now handles arrays, i.e. struct A[2] Now handles arrays, i.e. struct A[2]
****************/ ****************/
static String *getRClassName(String *retType, int addRef = 1, int upRef=0) { static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
String *tmp = NewString(""); String *tmp = NewString("");
SwigType *resolved = SwigType_typedef_resolve_all(retType); SwigType *resolved = SwigType_typedef_resolve_all(retType);
char *retName = Char(SwigType_manglestr(resolved)); char *retName = Char(SwigType_manglestr(resolved));
@ -115,6 +117,7 @@ static String *getRClassName(String *retType, int addRef = 1, int upRef=0) {
} }
return tmp; return tmp;
/*
#if 1 #if 1
List *l = SwigType_split(retType); List *l = SwigType_split(retType);
int n = Len(l); int n = Len(l);
@ -160,6 +163,7 @@ static String *getRClassName(String *retType, int addRef = 1, int upRef=0) {
#endif #endif
return tmp; return tmp;
*/
} }
/********************* /*********************
@ -2030,14 +2034,18 @@ int R::functionWrapper(Node *n) {
Replaceall(tm,"$owner", "R_SWIG_EXTERNAL"); Replaceall(tm,"$owner", "R_SWIG_EXTERNAL");
} }
if(0 && addCopyParam) { #if 0
if(addCopyParam) {
Printf(f->code, "if(LOGICAL(s_swig_copy)[0]) {\n"); Printf(f->code, "if(LOGICAL(s_swig_copy)[0]) {\n");
Printf(f->code, "/* Deal with returning a reference. */\nr_ans = R_NilValue;\n"); Printf(f->code, "/* Deal with returning a reference. */\nr_ans = R_NilValue;\n");
Printf(f->code, "}\n else {\n"); Printf(f->code, "}\n else {\n");
} }
#endif
Printf(f->code, "%s\n", tm); Printf(f->code, "%s\n", tm);
if(0 && addCopyParam) #if 0
if(addCopyParam)
Printf(f->code, "}\n"); /* end of if(s_swig_copy) ... else { ... } */ Printf(f->code, "}\n"); /* end of if(s_swig_copy) ... else { ... } */
#endif
} else { } else {
Swig_warning(WARN_TYPEMAP_OUT_UNDEF, input_file, line_number, Swig_warning(WARN_TYPEMAP_OUT_UNDEF, input_file, line_number,

View file

@ -448,7 +448,7 @@ private:
parent_name = Copy( Getattr(mod, "name") ); parent_name = Copy( Getattr(mod, "name") );
if ( parent_name ) if ( parent_name )
{ {
(Char(parent_name))[0] = toupper((Char(parent_name))[0]); (Char(parent_name))[0] = (char)toupper((Char(parent_name))[0]);
} }
} }
if ( parent_name ) if ( parent_name )
@ -1194,7 +1194,7 @@ public:
while (m.item) { while (m.item) {
if (Len(m.item) > 0) { if (Len(m.item) > 0) {
String *cap = NewString(m.item); String *cap = NewString(m.item);
(Char(cap))[0] = toupper((Char(cap))[0]); (Char(cap))[0] = (char)toupper((Char(cap))[0]);
if (last != 0) { if (last != 0) {
Append(module, "::"); Append(module, "::");
} }
@ -1206,7 +1206,7 @@ public:
if (feature == 0) { if (feature == 0) {
feature = Copy(last); feature = Copy(last);
} }
(Char(last))[0] = toupper((Char(last))[0]); (Char(last))[0] = (char)toupper((Char(last))[0]);
modvar = NewStringf("m%s", last); modvar = NewStringf("m%s", last);
Delete(modules); Delete(modules);
} }
@ -2219,7 +2219,7 @@ public:
return name; return name;
if (islower(name[0])) { if (islower(name[0])) {
name[0] = toupper(name[0]); name[0] = (char)toupper(name[0]);
Swig_warning(WARN_RUBY_WRONG_NAME, input_file, line_number, "Wrong %s name (corrected to `%s')\n", reason, name); Swig_warning(WARN_RUBY_WRONG_NAME, input_file, line_number, "Wrong %s name (corrected to `%s')\n", reason, name);
return name; return name;
} }
@ -2545,7 +2545,7 @@ public:
String *name = Copy(symname); String *name = Copy(symname);
char *cname = Char(name); char *cname = Char(name);
if (cname) if (cname)
cname[0] = toupper(cname[0]); cname[0] = (char)toupper(cname[0]);
Printv(director_prot_ctor_code, Printv(director_prot_ctor_code,
"if ( $comparison ) { /* subclassed */\n", "if ( $comparison ) { /* subclassed */\n",
" $director_new \n", " $director_new \n",

View file

@ -36,6 +36,7 @@ static int error_as_warning = 0; /* Understand the cpp #error directive as a spe
/* Test a character to see if it valid in an identifier (after the first letter) */ /* Test a character to see if it valid in an identifier (after the first letter) */
#define isidchar(c) ((isalnum(c)) || (c == '_') || (c == '$')) #define isidchar(c) ((isalnum(c)) || (c == '_') || (c == '$'))
DOH *Preprocessor_replace(DOH *);
/* Skip whitespace */ /* Skip whitespace */
static void skip_whitespace(String *s, String *out) { static void skip_whitespace(String *s, String *out) {
@ -698,7 +699,6 @@ static String *get_options(String *str) {
static String *expand_macro(String *name, List *args) { static String *expand_macro(String *name, List *args) {
String *ns; String *ns;
DOH *symbols, *macro, *margs, *mvalue, *temp, *tempa, *e; DOH *symbols, *macro, *margs, *mvalue, *temp, *tempa, *e;
DOH *Preprocessor_replace(DOH *);
int i, l; int i, l;
int isvarargs = 0; int isvarargs = 0;
@ -935,7 +935,6 @@ static String *expand_macro(String *name, List *args) {
List *evaluate_args(List *x) { List *evaluate_args(List *x) {
Iterator i; Iterator i;
String *Preprocessor_replace(String *);
List *nl = NewList(); List *nl = NewList();
for (i = First(x); i.item; i = Next(i)) { for (i = First(x); i.item; i = Next(i)) {
@ -1795,7 +1794,7 @@ String *Preprocessor_parse(String *s) {
for (i = 0; i < 6;) { for (i = 0; i < 6;) {
c = Getc(s); c = Getc(s);
Putc(c, value); Putc(c, value);
statement[i++] = c; statement[i++] = (char)c;
if (strncmp(statement, ed, i) && strncmp(statement, df, i)) if (strncmp(statement, ed, i) && strncmp(statement, df, i))
break; break;
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -108,6 +108,8 @@ static Hash *typedef_resolve_cache = 0;
static Hash *typedef_all_cache = 0; static Hash *typedef_all_cache = 0;
static Hash *typedef_qualified_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 */ /* 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) { int SwigType_typedef(SwigType *type, String_or_char *name) {
Typetab *SwigType_find_scope(Typetab *, String *s);
if (Getattr(current_typetab, name)) if (Getattr(current_typetab, name))
return -1; /* Already defined */ return -1; /* Already defined */
if (Strcmp(type, name) == 0) { /* Can't typedef a name to itself */ 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; Typetab *ss;
String *nnameprefix = 0; String *nnameprefix = 0;
static int check_parent = 1; static int check_parent = 1;
@ -1311,7 +1312,8 @@ SwigType *SwigType_alttype(SwigType *t, int local_tmap) {
SwigType *ftd = SwigType_typedef_resolve_all(t); SwigType *ftd = SwigType_typedef_resolve_all(t);
td = SwigType_strip_qualifiers(ftd); td = SwigType_strip_qualifiers(ftd);
Delete(ftd); Delete(ftd);
if ((n = Swig_symbol_clookup(td, 0))) { n = Swig_symbol_clookup(td, 0);
if (n) {
if (GetFlag(n, "feature:valuewrapper")) { if (GetFlag(n, "feature:valuewrapper")) {
use_wrapper = 1; use_wrapper = 1;
} else { } else {
@ -1334,7 +1336,8 @@ SwigType *SwigType_alttype(SwigType *t, int local_tmap) {
Delete(ftd); Delete(ftd);
if (SwigType_type(td) == T_USER) { if (SwigType_type(td) == T_USER) {
use_wrapper = 1; use_wrapper = 1;
if ((n = Swig_symbol_clookup(td, 0))) { n = Swig_symbol_clookup(td, 0);
if (n) {
if ((Checkattr(n, "nodeType", "class") if ((Checkattr(n, "nodeType", "class")
&& !Getattr(n, "allocate:noassign") && !Getattr(n, "allocate:noassign")
&& (Getattr(n, "allocate:default_constructor"))) && (Getattr(n, "allocate:default_constructor")))