diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index d792021c6..9ce51b576 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -2768,7 +2768,6 @@ types_directive : TYPES LPAREN parms RPAREN stringbracesemi { template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN valparms GREATERTHAN SEMI { Parm *p, *tp; Node *n; - Node *tnode = 0; Symtab *tscope = 0; int specialized = 0; @@ -2929,7 +2928,6 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va } Delattr(templnode,"templatetype"); Setattr(templnode,"template",nn); - tnode = templnode; Setfile(templnode,cparse_file); Setline(templnode,cparse_line); Delete(temparms); diff --git a/Source/DOH/string.c b/Source/DOH/string.c index c326e9f40..b067d239c 100644 --- a/Source/DOH/string.c +++ b/Source/DOH/string.c @@ -269,7 +269,6 @@ static void String_clear(DOH *so) { static int String_insert(DOH *so, int pos, DOH *str) { String *s; - char *nstr; int len; char *data; @@ -289,7 +288,6 @@ static int String_insert(DOH *so, int pos, DOH *str) { data = (char *) (str); len = (int) strlen(data); } - nstr = s->str; if (pos < 0) pos = 0; diff --git a/Source/Modules/allegrocl.cxx b/Source/Modules/allegrocl.cxx index f450697a6..df0b3b3d1 100644 --- a/Source/Modules/allegrocl.cxx +++ b/Source/Modules/allegrocl.cxx @@ -2500,11 +2500,8 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) { Delete(parsed); - int isPtrReturn = 0; - if (cl_t) { lclass = lookup_defined_foreign_ltype(cl_t); - isPtrReturn = 1; } int ff_foreign_ptr = 0; @@ -2523,17 +2520,8 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) { Replaceall(wrap->code, "$out_fftype", out_ffitype); if (deref_out_ffitype) Replaceall(wrap->code, "$*out_fftype", deref_out_ffitype); - // if(Replaceall(wrap->code,"$lclass", lclass) && !isPtrReturn) { - // Swig_warning(WARN_LANG_RETURN_TYPE,Getfile(n), Getline(n), - // "While Wrapping %s, replaced a $lclass reference when return type is non-pointer %s!\n", - // Getattr(n,"name"), cl_t); - // } Replaceall(wrap->code, "$body", NewStringf("(swig-ff-call%s)", wrap->locals)); -// Replaceall(wrap->code,"$body", -// (!Strcmp(result_type,"void") ? -// NewStringf("(swig-ff-call%s)", wrap->locals) : -// NewStringf("(push (swig-ff-call%s) ACL_result)", wrap->locals))); String *ldestructor = Copy(lclass); if (ff_foreign_ptr) Replaceall(ldestructor, ldestructor, "cl::identity"); @@ -2870,23 +2858,13 @@ int ALLEGROCL::globalvariableHandler(Node *n) { // String *name = Getattr(n, "name"); SwigType *type = Getattr(n, "type"); - SwigType *ctype; SwigType *rtype = SwigType_typedef_resolve_all(type); - int pointer_added = 0; - if (SwigType_isclass(rtype)) { SwigType_add_pointer(type); SwigType_add_pointer(rtype); - pointer_added = 1; } - ctype = SwigType_str(type, 0); - // EXPORT ; - // = ; - // Printf(f_runtime, "EXPORT %s %s;\n%s %s = %s%s;\n", ctype, mangled_name, - // ctype, mangled_name, (pointer_added ? "&" : ""), name); - Printf(f_clwrap, "(swig-defvar \"%s\" \"%s\" :type %s)\n", Getattr(n, "sym:name"), Getattr(n, "sym:name"), ((SwigType_isconst(type)) ? ":constant" : ":variable")); diff --git a/Source/Modules/allocate.cxx b/Source/Modules/allocate.cxx index 110a92939..563680a10 100644 --- a/Source/Modules/allocate.cxx +++ b/Source/Modules/allocate.cxx @@ -386,10 +386,6 @@ class Allocate:public Dispatcher { } Node *c = firstChild(cls); - String *kind = Getattr(cls, "kind"); - int mode = PUBLIC; - if (kind && (Strcmp(kind, "class") == 0)) - mode = PRIVATE; while (c) { if (Getattr(c, "error") || GetFlag(c, "feature:ignore")) { @@ -457,13 +453,6 @@ class Allocate:public Dispatcher { } } - if (Strcmp(nodeType(c), "access") == 0) { - kind = Getattr(c, "kind"); - if (Strcmp(kind, "public") == 0) - mode = PUBLIC; - else - mode = PRIVATE; - } c = nextSibling(c); } /* Look for methods in base classes */ diff --git a/Source/Modules/chicken.cxx b/Source/Modules/chicken.cxx index 0bb2193de..f5378af3e 100644 --- a/Source/Modules/chicken.cxx +++ b/Source/Modules/chicken.cxx @@ -684,9 +684,6 @@ int CHICKEN::variableWrapper(Node *n) { String *overname = 0; String *scmname; - int num_required; - int num_arguments; - scmname = NewString(iname); Replaceall(scmname, "_", "-"); @@ -705,10 +702,6 @@ int CHICKEN::variableWrapper(Node *n) { emit_attach_parmmaps(l, f); Setattr(n, "wrap:parms", l); - /* Get number of required and total arguments */ - num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); - // evaluation function names Append(wname, Swig_name_wrapper(iname)); if (overname) { @@ -845,9 +838,6 @@ int CHICKEN::constantWrapper(Node *n) { String *rvalue; SwigType *nctype; - int num_required; - int num_arguments; - scmname = NewString(iname); Replaceall(scmname, "_", "-"); @@ -903,10 +893,6 @@ int CHICKEN::constantWrapper(Node *n) { emit_attach_parmmaps(l, f); Setattr(n, "wrap:parms", l); - /* Get number of required and total arguments */ - num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); - // evaluation function names // Check for interrupts @@ -1382,12 +1368,10 @@ void CHICKEN::dispatchFunction(Node *n) { SortList(flist, compareTypeLists); String *clos_name; - int construct = 0; if (have_constructor && !has_constructor_args) { has_constructor_args = 1; constructor_dispatch = NewStringf("%s@SWIG@new@dispatch", short_class_name); clos_name = Copy(constructor_dispatch); - construct = 1; Printf(clos_methods, "(declare (hide %s))\n", clos_name); } else if (in_class) clos_name = NewString(member_name); diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index 6667f2ba8..b70f626b3 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -646,7 +646,6 @@ public: UpcallData *addUpcallMethod(String *imclass_method, String *class_method, String *decl, String *overloaded_name) { UpcallData *udata; - String *imclass_methodidx; String *class_methodidx; Hash *new_udata; String *key = NewStringf("%s|%s", imclass_method, decl); @@ -659,7 +658,6 @@ public: return Getattr(udata, "methodoff"); } - imclass_methodidx = NewStringf("%d", n_dmethods); class_methodidx = NewStringf("%d", n_dmethods - first_class_dmethod); n_dmethods++; @@ -668,10 +666,6 @@ public: Setattr(dmethods_table, key, new_udata); Setattr(new_udata, "method", Copy(class_method)); - // TODO: remove fdesc -// Setattr(new_udata, "fdesc", Copy(class_desc)); -// Setattr(new_udata, "imclass_method", Copy(imclass_method)); -// Setattr(new_udata, "imclass_methodidx", imclass_methodidx); Setattr(new_udata, "class_methodidx", class_methodidx); Setattr(new_udata, "decl", Copy(decl)); Setattr(new_udata, "overname", Copy(overloaded_name)); @@ -736,7 +730,6 @@ public: String *body = NewString(""); String *im_outattributes = 0; int num_arguments = 0; - int num_required = 0; bool is_void_return; String *overloaded_name = getOverloadedName(n); @@ -815,7 +808,6 @@ public: /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); int gencomma = 0; // Now walk the function parameter list and generate code to get arguments @@ -2707,7 +2699,6 @@ public: String *return_type = NewString(""); String *function_code = NewString(""); int num_arguments = 0; - int num_required = 0; String *overloaded_name = getOverloadedName(n); String *func_name = NULL; bool setter_flag = false; @@ -2767,7 +2758,6 @@ public: /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); bool global_or_member_variable = global_variable_flag || (wrapping_member_flag && !enum_constant_flag); int gencomma = 0; @@ -4020,7 +4010,6 @@ public: int classDirectorDestructor(Node *n) { Node *current_class = getCurrentClass(); - String *full_classname = Getattr(current_class, "name"); String *classname = Swig_class_name(current_class); Wrapper *w = NewWrapper(); @@ -4032,22 +4021,11 @@ public: Printf(w->def, "SwigDirector_%s::~SwigDirector_%s() {\n", classname, classname); } - /* Ensure that correct directordisconnect typemap's method name is called - * here: */ - - const String *disconn_tm = NULL; - Node *disconn_attr = NewHash(); - String *disconn_methodname = NULL; - - disconn_tm = typemapLookup(n, "directordisconnect", full_classname, WARN_NONE, disconn_attr); - disconn_methodname = Getattr(disconn_attr, "tmap:directordisconnect:methodname"); - Printv(w->code, "}\n", NIL); Wrapper_print(w, f_directors); DelWrapper(w); - Delete(disconn_attr); Delete(classname); return SWIG_OK; } diff --git a/Source/Modules/d.cxx b/Source/Modules/d.cxx index e2ce9f384..2040a79c8 100644 --- a/Source/Modules/d.cxx +++ b/Source/Modules/d.cxx @@ -1506,7 +1506,6 @@ public: String *outarg = NewString(""); String *body = NewString(""); int num_arguments = 0; - int num_required = 0; bool is_void_return; String *overloaded_name = getOverloadedName(n); @@ -1581,7 +1580,6 @@ public: /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); int gencomma = 0; // Now walk the function parameter list and generate code to get arguments @@ -2917,7 +2915,6 @@ private: String *return_type = NewString(""); String *function_code = NewString(""); int num_arguments = 0; - int num_required = 0; String *overloaded_name = getOverloadedName(n); String *func_name = NULL; String *pre_code = NewString(""); @@ -2973,7 +2970,6 @@ private: /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); int gencomma = 0; @@ -3716,7 +3712,6 @@ private: String *decl, String *overloaded_name, String *return_type, String *param_list) { UpcallData *udata; - String *imclass_methodidx; String *class_methodidx; Hash *new_udata; String *key = NewStringf("%s|%s", imclass_method, decl); @@ -3729,7 +3724,6 @@ private: return Getattr(udata, "methodoff"); } - imclass_methodidx = NewStringf("%d", n_dmethods); class_methodidx = NewStringf("%d", n_dmethods - first_class_dmethod); n_dmethods++; diff --git a/Source/Modules/emit.cxx b/Source/Modules/emit.cxx index 0c6c6515f..914cb0da0 100644 --- a/Source/Modules/emit.cxx +++ b/Source/Modules/emit.cxx @@ -402,7 +402,6 @@ String *emit_action(Node *n) { String *tm; String *action; String *wrap; - SwigType *rt; ParmList *catchlist = Getattr(n, "catchlist"); /* Look for fragments */ @@ -440,9 +439,6 @@ String *emit_action(Node *n) { action = Getattr(n, "wrap:action"); assert(action != 0); - /* Get the return type */ - rt = Getattr(n, "type"); - /* Emit contract code (if any) */ if (Swig_contract_mode_get()) { /* Preassertion */ diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx index f263a76ca..2b4ff37d0 100644 --- a/Source/Modules/go.cxx +++ b/Source/Modules/go.cxx @@ -1397,7 +1397,6 @@ private: } Printv(current, Getattr(parms, "lname"), NULL); - String *last = NULL; int vc = 0; for (Iterator bi = First(base); bi.item; bi = Next(bi)) { Printf(actioncode, " %s *swig_b%d = (%s *)%s;\n", bi.item, vc, bi.item, current); @@ -1405,7 +1404,6 @@ private: current = NewString(""); Printf(current, "swig_b%d", vc); ++vc; - last = bi.item; } String *code = Copy(Getattr(n, "wrap:action")); diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 752a6165a..5574cce59 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -808,7 +808,6 @@ public: String *outarg = NewString(""); String *body = NewString(""); int num_arguments = 0; - int num_required = 0; int gencomma = 0; bool is_void_return; String *overloaded_name = getOverloadedName(n); @@ -885,9 +884,7 @@ public: Printf(imclass_class_code, " public final static native %s %s(", im_return_type, overloaded_name); - /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); // Now walk the function parameter list and generate code to get arguments for (i = 0, p = l; i < num_arguments; i++) { @@ -2619,7 +2616,6 @@ public: String *return_type = NewString(""); String *function_code = NewString(""); int num_arguments = 0; - int num_required = 0; String *overloaded_name = getOverloadedName(n); String *func_name = NULL; bool setter_flag = false; @@ -2667,7 +2663,6 @@ public: /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); bool global_or_member_variable = global_variable_flag || (wrapping_member_flag && !enum_constant_flag); int gencomma = 0; @@ -4227,11 +4222,10 @@ public: /* Ensure that correct directordisconnect typemap's method name is called * here: */ - const String *disconn_tm = NULL; Node *disconn_attr = NewHash(); String *disconn_methodname = NULL; - disconn_tm = typemapLookup(n, "directordisconnect", full_classname, WARN_NONE, disconn_attr); + typemapLookup(n, "directordisconnect", full_classname, WARN_NONE, disconn_attr); disconn_methodname = Getattr(disconn_attr, "tmap:directordisconnect:methodname"); Printv(w->code, " swig_disconnect_director_self(\"", disconn_methodname, "\");\n", "}\n", NIL); diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 95327018d..87a0bed8d 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -1192,7 +1192,7 @@ int SWIG_main(int argc, char *argv[], Language *l) { } if (dump_typedef) { - SwigType_print_scope(0); + SwigType_print_scope(); } if (dump_symtabs) { diff --git a/Source/Modules/mzscheme.cxx b/Source/Modules/mzscheme.cxx index 89d267cbc..3f6a97d63 100644 --- a/Source/Modules/mzscheme.cxx +++ b/Source/Modules/mzscheme.cxx @@ -240,7 +240,6 @@ public: String *outarg = NewString(""); String *build = NewString(""); String *tm; - int argout_set = 0; int i = 0; int numargs; int numreq; @@ -381,7 +380,6 @@ public: Replaceall(tm, "$input", Getattr(p, "emit:input")); Printv(outarg, tm, "\n", NIL); p = Getattr(p, "tmap:argout:next"); - argout_set = 1; } else { p = nextSibling(p); } diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index 801b0ca70..3007e0b86 100644 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -445,7 +445,6 @@ public: String *outarg = NewString(""); String *build = NewString(""); String *tm; - int argout_set = 0; int i = 0; int numargs; int numreq; @@ -608,7 +607,6 @@ public: Replaceall(tm, "$ntype", normalizeTemplatedClassName(Getattr(p, "type"))); Printv(outarg, tm, "\n", NIL); p = Getattr(p, "tmap:argout:next"); - argout_set = 1; } else { p = nextSibling(p); } @@ -881,9 +879,8 @@ public: * ------------------------------------------------------------ */ virtual int staticmemberfunctionHandler(Node *n) { - int rv; static_member_function = 1; - rv = Language::staticmemberfunctionHandler(n); + Language::staticmemberfunctionHandler(n); static_member_function = 0; return SWIG_OK; } diff --git a/Source/Modules/octave.cxx b/Source/Modules/octave.cxx index 7753e669e..ab53340fe 100644 --- a/Source/Modules/octave.cxx +++ b/Source/Modules/octave.cxx @@ -359,13 +359,11 @@ public: String *name = 0; String *type = 0; String *value = 0; - String *ptype = 0; String *pdoc = Getattr(p, "tmap:doc"); if (pdoc) { name = Getattr(p, "tmap:doc:name"); type = Getattr(p, "tmap:doc:type"); value = Getattr(p, "tmap:doc:value"); - ptype = Getattr(p, "tmap:doc:pytype"); } name = name ? name : Getattr(p, "name"); @@ -1243,7 +1241,6 @@ public: // build argument list and type conversion string idx = 0; p = l; - int use_parse = 0; while (p) { if (checkAttribute(p, "tmap:in:numinputs", "0")) { p = Getattr(p, "tmap:in:next"); @@ -1266,7 +1263,6 @@ public: Printf(wrap_args, "args.append(tmpv);\n"); Putc('O', parse_args); } else { - use_parse = 1; Append(parse_args, parse); Replaceall(tm, "$input", pname); Replaceall(tm, "$owner", "0"); diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 466641c47..1eb9a86de 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -250,7 +250,6 @@ public: virtual int top(Node *n) { String *filen; - String *s_type; /* Check if directors are enabled for this module. */ Node *mod = Getattr(n, "module"); @@ -283,7 +282,6 @@ public: r_shutdown = NewString("/* rshutdown section */\n"); s_header = NewString("/* header section */\n"); s_wrappers = NewString("/* wrapper section */\n"); - s_type = NewStringEmpty(); /* subsections of the init section */ s_vinit = NewString("/* vinit subsection */\n"); s_vdecl = NewString("/* vdecl subsection */\n"); @@ -2522,7 +2520,6 @@ done: /* build argument list and type conversion string */ idx = 0; p = l; - int use_parse = 0; while (p) { if (checkAttribute(p, "tmap:in:numinputs", "0")) { p = Getattr(p, "tmap:in:next"); @@ -2549,7 +2546,6 @@ done: Printv(wrap_args, tm, "\n", NIL); Putc('O', parse_args); } else { - use_parse = 1; Append(parse_args, parse); Replaceall(tm, "$input", pname); Replaceall(tm, "$owner", "0"); diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index e91a3812e..0cae46bf8 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -1215,13 +1215,11 @@ public: String *name = 0; String *type = 0; String *value = 0; - String *ptype = 0; String *pdoc = Getattr(p, "tmap:doc"); if (pdoc) { name = Getattr(p, "tmap:doc:name"); type = Getattr(p, "tmap:doc:type"); value = Getattr(p, "tmap:doc:value"); - ptype = Getattr(p, "tmap:doc:pytype"); } name = name ? name : Getattr(p, "name"); diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 0f0024325..dd43565d0 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -15,8 +15,6 @@ char cvsroot_r_cxx[] = "$Id$"; #include "swigmod.h" -#define UNUSED(a) (void)a - static const double DEFAULT_NUMBER = .0000123456712312312323; static const int MAX_OVERLOAD_ARGS = 5; @@ -268,12 +266,9 @@ static void replaceRClass(String *tm, SwigType *type) { Delete(tmp); Delete(tmp_base); Delete(tmp_ref); } -static double getNumber(String *value, String *type) { - UNUSED(type); - +static double getNumber(String *value) { double d = DEFAULT_NUMBER; if(Char(value)) { - // Printf(stderr, "getNumber %s %s\n", Char(value), type); if(sscanf(Char(value), "%lf", &d) != 1) return(DEFAULT_NUMBER); } @@ -1016,7 +1011,6 @@ int R::OutputClassMemberTable(Hash *tb, File *out) { int R::OutputMemberReferenceMethod(String *className, int isSet, List *el, File *out) { int numMems = Len(el), j; - int has_getitem = 0, has_setitem = 0, has_str = 0; int varaccessor = 0; if (numMems == 0) return SWIG_OK; @@ -1036,9 +1030,6 @@ int R::OutputMemberReferenceMethod(String *className, int isSet, if (Getattr(itemList, item)) continue; Setattr(itemList, item, "1"); - if (!Strcmp(item, "__getitem__")) has_getitem = 1; - if (!Strcmp(item, "__setitem__")) has_setitem = 1; - if (!Strcmp(item, "__str__")) has_str = 1; String *dup = Getitem(el, j + 1); char *ptr = Char(dup); @@ -1212,10 +1203,9 @@ int R::enumDeclaration(Node *n) { // const char *tag = Char(nodeType(c)); // if (Strcmp(tag,"cdecl") == 0) { name = Getattr(c, "name"); - String *type = Getattr(c, "type"); String *val = Getattr(c, "enumvalue"); if(val && Char(val)) { - int inval = (int) getNumber(val, type); + int inval = (int) getNumber(val); if(inval == DEFAULT_NUMBER) value++; else @@ -1738,8 +1728,7 @@ int R::functionWrapper(Node *n) { } int i; - int nargs, num_required, varargs; - UNUSED(varargs); + int nargs; String *wname = Swig_name_wrapper(iname); Replace(wname, "_wrap", "R_swig", DOH_REPLACE_FIRST); @@ -1788,8 +1777,6 @@ int R::functionWrapper(Node *n) { Setattr(n,"wrap:parms",l); nargs = emit_num_arguments(l); - num_required = emit_num_required(l); - varargs = emit_isvarargs(l); Wrapper_add_local(f, "r_nprotect", "unsigned int r_nprotect = 0"); Wrapper_add_localv(f, "r_ans", "SEXP", "r_ans = R_NilValue", NIL); @@ -2134,11 +2121,6 @@ int R::functionWrapper(Node *n) { Would like to be able to do this so that we can potentialy insert */ if(processing_member_access_function || processing_class_member_function) { - String *tmp; - if(member_name) - tmp = member_name; - else - tmp = Getattr(n, "memberfunctionHandler:name"); addAccessor(member_name, sfun, iname); } diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index 784b81973..dfb199b6e 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -322,13 +322,11 @@ private: String *name = 0; String *type = 0; String *value = 0; - String *ptype = 0; String *pdoc = Getattr(p, "tmap:doc"); if (pdoc) { name = Getattr(p, "tmap:doc:name"); type = Getattr(p, "tmap:doc:type"); value = Getattr(p, "tmap:doc:value"); - ptype = Getattr(p, "tmap:doc:pytype"); } name = name ? name : Getattr(p, "name"); @@ -1608,9 +1606,7 @@ public: virtual int functionWrapper(Node *n) { String *nodeType; - bool constructor; bool destructor; - String *storage; String *symname = Copy(Getattr(n, "sym:name")); SwigType *t = Getattr(n, "type"); @@ -1625,9 +1621,7 @@ public: return SWIG_NOWRAP; nodeType = Getattr(n, "nodeType"); - constructor = (!Cmp(nodeType, "constructor")); destructor = (!Cmp(nodeType, "destructor")); - storage = Getattr(n, "storage"); /* If the C++ class constructor is overloaded, we only want to * write out the "new" singleton method once since it is always diff --git a/Source/Modules/typepass.cxx b/Source/Modules/typepass.cxx index 3e2c9ca1e..74996207f 100644 --- a/Source/Modules/typepass.cxx +++ b/Source/Modules/typepass.cxx @@ -1062,11 +1062,11 @@ class TypePass:private Dispatcher { * which is hacked. */ if (Getattr(n, "sym:overloaded")) { -#ifdef DEBUG_OVERLOADED -show_overloaded(n); -#endif int cnt = 0; +#ifdef DEBUG_OVERLOADED Node *debugnode = n; + show_overloaded(n); +#endif if (!firstChild(n)) { // Remove from overloaded list ('using' node does not actually end up adding in any methods) Node *ps = Getattr(n, "sym:previousSibling"); @@ -1113,14 +1113,16 @@ show_overloaded(n); Setattr(ns, "sym:previousSibling", pp); Setattr(pp, "sym:nextSibling", ns); } +#ifdef DEBUG_OVERLOADED debugnode = firstoverloaded; +#endif } Delattr(n, "sym:previousSibling"); Delattr(n, "sym:nextSibling"); Delattr(n, "sym:overloaded"); Delattr(n, "sym:overname"); #ifdef DEBUG_OVERLOADED -show_overloaded(debugnode); + show_overloaded(debugnode); #endif clean_overloaded(n); // Needed? } diff --git a/Source/Modules/uffi.cxx b/Source/Modules/uffi.cxx index 56ba045e6..728319dfb 100644 --- a/Source/Modules/uffi.cxx +++ b/Source/Modules/uffi.cxx @@ -278,7 +278,8 @@ int UFFI::functionWrapper(Node *n) { String *funcname = Getattr(n, "sym:name"); ParmList *pl = Getattr(n, "parms"); Parm *p; - int argnum = 0, first = 1, varargs = 0; + int argnum = 0, first = 1; +// int varargs = 0; //Language::functionWrapper(n); @@ -291,7 +292,7 @@ int UFFI::functionWrapper(Node *n) { Printf(f_cl, ":void"); } else if (any_varargs(pl)) { Printf(f_cl, "#| varargs |#"); - varargs = 1; +// varargs = 1; } else { for (p = pl; p; p = nextSibling(p), argnum++) { String *argname = Getattr(p, "name"); diff --git a/Source/Swig/cwrap.c b/Source/Swig/cwrap.c index 8a7ecd074..c6750b205 100644 --- a/Source/Swig/cwrap.c +++ b/Source/Swig/cwrap.c @@ -1041,10 +1041,8 @@ int Swig_ConstructorToFunction(Node *n, const_String_or_char_ptr nspace, String Parm *p; ParmList *directorparms; SwigType *type; - Node *classNode; int use_director; - classNode = Swig_methodclass(n); use_director = Swig_directorclass(n); parms = CopyParmList(nonvoid_parms(Getattr(n, "parms"))); diff --git a/Source/Swig/scanner.c b/Source/Swig/scanner.c index 0cdadaa7f..31dc7522f 100644 --- a/Source/Swig/scanner.c +++ b/Source/Swig/scanner.c @@ -1156,11 +1156,9 @@ void Scanner_skip_line(Scanner * s) { int Scanner_skip_balanced(Scanner * s, int startchar, int endchar) { char c; int num_levels = 1; - int l; int state = 0; char temp[2] = { 0, 0 }; String *locator = 0; - l = s->line; temp[0] = (char) startchar; Clear(s->text); Setfile(s->text, Getfile(s->str)); diff --git a/Source/Swig/swig.h b/Source/Swig/swig.h index 6607c333d..03284bda5 100644 --- a/Source/Swig/swig.h +++ b/Source/Swig/swig.h @@ -194,7 +194,7 @@ extern "C" { extern void SwigType_inherit_scope(Typetab *scope); extern Typetab *SwigType_pop_scope(void); extern Typetab *SwigType_set_scope(Typetab *h); - extern void SwigType_print_scope(Typetab *t); + extern void SwigType_print_scope(void); extern SwigType *SwigType_typedef_resolve(const SwigType *t); extern SwigType *SwigType_typedef_resolve_all(const SwigType *t); extern SwigType *SwigType_typedef_qualified(const SwigType *t); diff --git a/Source/Swig/symbol.c b/Source/Swig/symbol.c index 4ec18e8c7..b16573606 100644 --- a/Source/Swig/symbol.c +++ b/Source/Swig/symbol.c @@ -1206,19 +1206,17 @@ Node *Swig_symbol_clookup_check(const_String_or_char_ptr name, Symtab *n, int (* * ----------------------------------------------------------------------------- */ Node *Swig_symbol_clookup_local(const_String_or_char_ptr name, Symtab *n) { - Hash *h, *hsym; + Hash *hsym; Node *s = 0; if (!n) { hsym = current_symtab; - h = ccurrent; } else { if (!Checkattr(n, "nodeType", "symboltable")) { n = Getattr(n, "sym:symtab"); } assert(n); hsym = n; - h = Getattr(n, "csymtab"); } if (Swig_scopename_check(name)) { @@ -1256,19 +1254,17 @@ Node *Swig_symbol_clookup_local(const_String_or_char_ptr name, Symtab *n) { * ----------------------------------------------------------------------------- */ Node *Swig_symbol_clookup_local_check(const_String_or_char_ptr name, Symtab *n, int (*checkfunc) (Node *)) { - Hash *h, *hsym; + Hash *hsym; Node *s = 0; if (!n) { hsym = current_symtab; - h = ccurrent; } else { if (!Checkattr(n, "nodeType", "symboltable")) { n = Getattr(n, "sym:symtab"); } assert(n); hsym = n; - h = Getattr(n, "csymtab"); } if (Swig_scopename_check(name)) { diff --git a/Source/Swig/typesys.c b/Source/Swig/typesys.c index a1445f200..153bbbace 100644 --- a/Source/Swig/typesys.c +++ b/Source/Swig/typesys.c @@ -389,12 +389,11 @@ void SwigType_attach_symtab(Symtab *sym) { * Debugging function for printing out current scope * ----------------------------------------------------------------------------- */ -void SwigType_print_scope(Typetab *t) { +void SwigType_print_scope(void) { Hash *ttab; Iterator i, j; for (i = First(scopes); i.key; i = Next(i)) { - t = i.item; ttab = Getattr(i.item, "typetab"); Printf(stdout, "Type scope '%s' (%x)\n", i.key, i.item);