From 39abd80eef75eaeb2d1c948677a97fdd289db03b Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 10 Nov 2007 21:10:17 +0000 Subject: [PATCH] Changes to compile with VC++6 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10099 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/cffi.cxx | 6 +++--- Source/Modules/csharp.cxx | 10 ++++++---- Source/Modules/php4.cxx | 7 ++++--- Source/Modules/r.cxx | 9 +++++---- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Source/Modules/cffi.cxx b/Source/Modules/cffi.cxx index 8657e12b5..fae5d9040 100644 --- a/Source/Modules/cffi.cxx +++ b/Source/Modules/cffi.cxx @@ -826,9 +826,9 @@ void CFFI::emit_struct_union(Node *n, bool un = false) { Printf(f_cl, ")\n"); emit_export(n, lisp_name); - for (Node *c = firstChild(n); c; c = nextSibling(c)) { - if (!Strcmp(nodeType(c), "cdecl")) { - emit_export(c, lispify_name(c, Getattr(c, "sym:name"), "'slotname")); + for (Node *child = firstChild(n); child; child = nextSibling(child)) { + if (!Strcmp(nodeType(child), "cdecl")) { + emit_export(child, lispify_name(child, Getattr(child, "sym:name"), "'slotname")); } } diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index d8b9fe0a3..734e5c83c 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -1587,7 +1587,8 @@ public: // put this in classDirectorEnd ??? Printf(proxy_class_code, " private void SwigDirectorConnect() {\n"); - for (int i = first_class_dmethod; i < curr_class_dmethod; ++i) { + int i; + for (i = first_class_dmethod; i < curr_class_dmethod; ++i) { UpcallData *udata = Getitem(dmethods_seq, i); String *method = Getattr(udata, "method"); String *methid = Getattr(udata, "class_methodidx"); @@ -1596,7 +1597,7 @@ public: Printf(proxy_class_code, " swigDelegate%s = new SwigDelegate%s_%s(SwigDirector%s);\n", methid, proxy_class_name, methid, overname); } Printf(proxy_class_code, " %s.%s_director_connect(swigCPtr", imclass_name, proxy_class_name); - for (int i = first_class_dmethod; i < curr_class_dmethod; ++i) { + for (i = first_class_dmethod; i < curr_class_dmethod; ++i) { UpcallData *udata = Getitem(dmethods_seq, i); String *methid = Getattr(udata, "class_methodidx"); Printf(proxy_class_code, ", swigDelegate%s", methid); @@ -3756,6 +3757,7 @@ public: * ------------------------------------------------------------ */ int classDirectorEnd(Node *n) { + int i; String *director_classname = directorClassName(n); Wrapper *w = NewWrapper(); @@ -3768,7 +3770,7 @@ public: Printf(w->def, "void %s::swig_connect_director(", director_classname); - for (int i = first_class_dmethod; i < curr_class_dmethod; ++i) { + for (i = first_class_dmethod; i < curr_class_dmethod; ++i) { UpcallData *udata = Getitem(dmethods_seq, i); String *methid = Getattr(udata, "class_methodidx"); String *overname = Getattr(udata, "overname"); @@ -3794,7 +3796,7 @@ public: Printf(w->code, "}\n\n"); Printf(w->code, "void %s::swig_init_callbacks() {\n", director_classname); - for (int i = first_class_dmethod; i < curr_class_dmethod; ++i) { + for (i = first_class_dmethod; i < curr_class_dmethod; ++i) { UpcallData *udata = Getitem(dmethods_seq, i); String *overname = Getattr(udata, "overname"); Printf(w->code, "swig_callback%s = 0;\n", overname); diff --git a/Source/Modules/php4.cxx b/Source/Modules/php4.cxx index 8e1f3f7a7..1ebb79a7d 100644 --- a/Source/Modules/php4.cxx +++ b/Source/Modules/php4.cxx @@ -945,7 +945,8 @@ public: int newobject = GetFlag(n, "feature:new"); Parm *p; - int i, numopt; + int i; + int numopt; String *tm; Wrapper *f; bool mvr = (shadow && php_version == 4 && wrapperType == membervar); @@ -1414,7 +1415,7 @@ public: fprintf(stderr, "Malloc failed!\n"); exit(1); } - for (int i = 0; i < max_num_of_arguments; ++i) { + for (i = 0; i < max_num_of_arguments; ++i) { arg_names[i] = NULL; } @@ -1425,7 +1426,7 @@ public: fprintf(stderr, "Malloc failed!\n"); exit(1); } - for (int i = 0; i < max_num_of_arguments; ++i) { + for (i = 0; i < max_num_of_arguments; ++i) { arg_values[i] = NULL; } diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 1b97a50fb..05d45ac0b 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -20,7 +20,8 @@ static const int MAX_OVERLOAD_ARGS = 5; static String * getRTypeName(SwigType *t, int *outCount = NULL) { String *b = SwigType_base(t); List *els = SwigType_split(t); - int count = 0, i; + int count = 0; + int i; if(Strncmp(b, "struct ", 7) == 0) Replace(b, "struct ", "", DOH_REPLACE_FIRST); @@ -519,7 +520,7 @@ int R::getFunctionPointerNumArgs(Node *n, SwigType *tt) { n = SwigType_typedef_resolve(tt); #endif - ParmList *parms(Getattr(n, "parms")); + ParmList *parms = Getattr(n, "parms"); if (debugMode) Printf(stderr, "parms = %p\n", parms); return ParmList_len(parms); @@ -635,7 +636,7 @@ String * R::createFunctionPointerHandler(SwigType *t, Node *n, int *numArgs) { String *setExprElements = NewString(""); String *s_paramTypes = NewString(""); - for(int i = 0; p; i++) { + for(i = 0; p; i++) { SwigType *tt = Getattr(p, "type"); SwigType *name = Getattr(p, "name"); // String *lname = Getattr(p,"lname"); @@ -2900,7 +2901,7 @@ int R::typedefHandler(Node *n) { it is for a field element. **********************/ int R::membervariableHandler(Node *n) { - SwigType *t(Getattr(n, "type")); + SwigType *t = Getattr(n, "type"); processType(t, n, NULL); processing_member_access_function = 1; member_name = Getattr(n,"sym:name");