From: Marcelo M. <mar...@us...> - 2005-10-21 10:44:06
|
Update of /cvsroot/swig/SWIG/Source/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30062/Source/Modules Modified Files: csharp.cxx java.cxx python.cxx Log Message: replace bad parameter names when neccessary Index: java.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/java.cxx,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** java.cxx 15 Oct 2005 01:14:21 -0000 1.105 --- java.cxx 21 Oct 2005 10:43:41 -0000 1.106 *************** *** 15,18 **** --- 15,19 ---- #include <limits.h> // for INT_MAX #include "swigmod.h" + #include "cparse.h" #include <ctype.h> *************** *** 2507,2511 **** plist = nextSibling(plist); } ! arg = (!pn || (count > 1)) ? NewStringf("arg%d",arg_num) : Copy(pn); } --- 2508,2513 ---- plist = nextSibling(plist); } ! String *wrn = pn ? Swig_name_object_get(Swig_cparse_namewarn(),0,pn,0) : 0; ! arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d",arg_num) : Copy(pn); } Index: python.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** python.cxx 20 Oct 2005 09:47:56 -0000 1.111 --- python.cxx 21 Oct 2005 10:43:41 -0000 1.112 *************** *** 1271,1278 **** /* Keyword argument handling */ ! if (Len(pn)) { Printf(kwargs,"(char *) \"%s\",", pn); } else { ! Printf(kwargs,"\"arg%d\",", i+1); } --- 1271,1288 ---- /* Keyword argument handling */ ! String *wrn = pn ? Swig_name_object_get(Swig_cparse_namewarn(),0,pn,0) : 0; ! if (!wrn && Len(pn)) { Printf(kwargs,"(char *) \"%s\",", pn); } else { ! if (wrn) { ! /* ! we change the parameter name just a little. ! do we need to emit a warning? ! */ ! Printf(kwargs,"(char *) \"_%s\",", pn); ! Swig_warning(0,Getfile(n),Getline(n), "%s, renaming parameter to _%s\n", wrn, pn); ! } else { ! Printf(kwargs,"(char *)\"arg%d\",", i+1); ! } } *************** *** 1318,1322 **** Printf(kwargs," NULL }"); if (allow_kwargs) { ! Printv(f->locals,tab4, "char *kwnames[] = ", kwargs, ";\n", NIL); } --- 1328,1332 ---- Printf(kwargs," NULL }"); if (allow_kwargs) { ! Printv(f->locals,tab4, "char * kwnames[] = ", kwargs, ";\n", NIL); } Index: csharp.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/csharp.cxx,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** csharp.cxx 15 Oct 2005 01:14:21 -0000 1.72 --- csharp.cxx 21 Oct 2005 10:43:41 -0000 1.73 *************** *** 15,18 **** --- 15,19 ---- #include <limits.h> // for INT_MAX #include "swigmod.h" + #include "cparse.h" #include <ctype.h> *************** *** 2355,2359 **** plist = nextSibling(plist); } ! arg = (!pn || (count > 1)) ? NewStringf("arg%d",arg_num) : Copy(pn); } --- 2356,2361 ---- plist = nextSibling(plist); } ! String *wrn = pn ? Swig_name_object_get(Swig_cparse_namewarn(),0,pn,0) : 0; ! arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d",arg_num) : Copy(pn); } |