diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 09385f1c0..a97ac8fd5 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -243,10 +243,10 @@ static void set_access_mode(Node *n) { } static void restore_access_mode(Node *n) { - char* mode = Char(Getattr(n, "access")); - if (strcmp(mode, "private") == 0) + String *mode = Getattr(n, "access"); + if (Strcmp(mode, "private") == 0) cplus_mode = CPLUS_PRIVATE; - else if (strcmp(mode, "protected") == 0) + else if (Strcmp(mode, "protected") == 0) cplus_mode = CPLUS_PROTECTED; else cplus_mode = CPLUS_PUBLIC; @@ -800,7 +800,7 @@ static String *make_class_name(String *name) { /* Use typedef name as class name */ -void add_typedef_name(Node *n, Node *decl, String *oldName, Symtab *cscope, String *scpname) { +static void add_typedef_name(Node *n, Node *decl, String *oldName, Symtab *cscope, String *scpname) { String *class_rename = 0; SwigType *decltype = Getattr(decl, "decl"); if (!decltype || !Len(decltype)) { @@ -1043,7 +1043,7 @@ static String *resolve_create_node_scope(String *cname) { } /* look for simple typedef name in typedef list */ -String *try_to_find_a_name_for_unnamed_structure(char *storage, Node *decls) { +static String *try_to_find_a_name_for_unnamed_structure(const char *storage, Node *decls) { String *name = 0; Node *n = decls; if (storage && (strcmp(storage, "typedef") == 0)) { @@ -1058,7 +1058,7 @@ String *try_to_find_a_name_for_unnamed_structure(char *storage, Node *decls) { } /* traverse copied tree segment, and update outer class links*/ -void update_nested_classes(Node *n) +static void update_nested_classes(Node *n) { Node *c = firstChild(n); while (c) { diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx index 25bf7e804..5c701bc85 100644 --- a/Source/Modules/lang.cxx +++ b/Source/Modules/lang.cxx @@ -2391,7 +2391,7 @@ int Language::classDeclaration(Node *n) { } AccessMode oldAccessMode = cplus_mode; Node *outerClass = Getattr(n, "nested:outer"); - if (outerClass && oldAccessMode != Dispatcher::PUBLIC) + if (outerClass && oldAccessMode != PUBLIC) return SWIG_NOWRAP; ClassName = Copy(name); ClassPrefix = Copy(symname); diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 5336159af..290887c6e 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -862,13 +862,9 @@ void SWIG_getoptions(int argc, char *argv[]) { } } -void Swig_flatten_nested() { - String* name = NewString(""); - String* fname = NewString("feature:flatnested"); - String* val = NewString("1"); - Swig_feature_set(Swig_cparse_features(),name,0,fname, val, 0); - Delete(fname); - Delete(name); +static void flatten_nested() { + String *val = NewString("1"); + Swig_feature_set(Swig_cparse_features(), "", 0, "feature:flatnested", val, 0); Delete(val); } @@ -1167,7 +1163,7 @@ int SWIG_main(int argc, char *argv[], Language *l) { // add "ignore" directive if nested classes are not supported if (!lang->nestedClassesSupported()) - Swig_flatten_nested(); + flatten_nested(); Node *top = Swig_cparse(cpps); diff --git a/Source/Swig/naming.c b/Source/Swig/naming.c index 259676971..2921b3c84 100644 --- a/Source/Swig/naming.c +++ b/Source/Swig/naming.c @@ -1683,11 +1683,10 @@ List *Swig_make_inherit_list(String *clsname, List *names, String *Namespacepref ilen = Len(names); for (i = 0; i < ilen; i++) { - Node *s; String *base; String *n = Getitem(names, i); /* Try to figure out where this symbol is */ - s = Swig_symbol_clookup(n,0); + Node *s = Swig_symbol_clookup(n, 0); if (s) { while (s && (Strcmp(nodeType(s), "class") != 0)) { /* Not a class. Could be a typedef though. */ diff --git a/Source/Swig/swigtree.h b/Source/Swig/swigtree.h index 4973400d7..acd0e5e90 100644 --- a/Source/Swig/swigtree.h +++ b/Source/Swig/swigtree.h @@ -38,7 +38,7 @@ extern void appendChild(Node *node, Node *child); extern void prependChild(Node *node, Node *child); extern void removeNode(Node *node); extern Node *copyNode(Node *node); -extern void appendSibling(Node *node, Node *chd); +extern void appendSibling(Node *node, Node *child); /* Node restoration/restore functions */