From: <wsf...@us...> - 2010-01-20 19:58:35
|
Revision: 11823 http://swig.svn.sourceforge.net/swig/?rev=11823&view=rev Author: wsfulton Date: 2010-01-20 19:58:28 +0000 (Wed, 20 Jan 2010) Log Message: ----------- remove some dead code using which should be using SwigType_typedef_resolve_all instead of SwigType_typedef_resolve Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2010-01-13 11:53:18 UTC (rev 11822) +++ trunk/Source/Modules/r.cxx 2010-01-20 19:58:28 UTC (rev 11823) @@ -66,40 +66,6 @@ */ } -#if 0 -static String * getRType(Node *n) { - SwigType *elType = Getattr(n, "type"); - SwigType *elDecl = Getattr(n, "decl"); - //XXX How can we tell if this is already done. - SwigType_push(elType, elDecl); - String *ans; - - String *rtype = Swig_typemap_lookup("rtype", n, "", 0); - String *i = getRTypeName(elType); - - if(Len(i) == 0) { - SwigType *td = SwigType_typedef_resolve(elType); - if(td) { - // Printf(stderr, "Resolving typedef %s -> %s\n", elType, td); - i = getRTypeName(td); - } - } - // Printf(stderr, "<getRType> i = %s, rtype = %s (for %s)\n", - // i, rtype, elType); - if(rtype) { - ans = NewString(""); - Printf(ans, "%s", rtype); - Replaceall(ans, "$R_class", Char(i)); - // Printf(stderr, "Found r type in typemap for %s (for %s) => %s (%s) => %s\n", - // SwigType_str(elType, 0), Getattr(n, "name"), rtype, i, ans); - } else { - ans = i; - } - - return(ans); -} -#endif - /********************* Tries to get the name of the R class corresponding to the given type e.g. struct A * is ARef, struct A** is ARefRef. @@ -530,12 +496,7 @@ n = Getattr(n, "type"); if (debugMode) Printf(stderr, "type: %s\n", n); -#if 0 - SwigType *tmp = SwigType_typedef_resolve(tt); - - n = SwigType_typedef_resolve(tt); -#endif - + ParmList *parms = Getattr(n, "parms"); if (debugMode) Printf(stderr, "parms = %p\n", parms); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2010-04-01 18:29:43
|
Revision: 11959 http://swig.svn.sourceforge.net/swig/?rev=11959&view=rev Author: wsfulton Date: 2010-04-01 18:29:36 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Remove some R debugging output Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2010-04-01 18:26:37 UTC (rev 11958) +++ trunk/Source/Modules/r.cxx 2010-04-01 18:29:36 UTC (rev 11959) @@ -556,10 +556,10 @@ ParmList *parms = SwigType_function_parms(SwigType_del_pointer(Copy(t)), n); - // if (debugMode) { + if (debugMode) { Printf(stderr, "Type: %s\n", t); Printf(stderr, "Return type: %s\n", SwigType_base(t)); - //} + } bool isVoidType = Strcmp(rettype, "void") == 0; if (debugMode) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2010-10-17 09:35:40
|
Revision: 12283 http://swig.svn.sourceforge.net/swig/?rev=12283&view=rev Author: drjoe Date: 2010-10-17 09:35:34 +0000 (Sun, 17 Oct 2010) Log Message: ----------- [R] Improve error message for missing argtypes Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2010-10-17 07:33:58 UTC (rev 12282) +++ trunk/Source/Modules/r.cxx 2010-10-17 09:35:34 UTC (rev 12283) @@ -1628,7 +1628,8 @@ } if (cur_args != -1) { Printf(f->code, "} else {\n" - "stop(\"cannot find overloaded function for %s\");\n" + "stop(\"cannot find overloaded function for %s with argtypes (\"," + "toString(argtypes),\")\");\n" "}", sfname); } Printv(f->code, ";\nf(...)", NIL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2012-03-18 07:56:58
|
Revision: 12932 http://swig.svn.sourceforge.net/swig/?rev=12932&view=rev Author: drjoe Date: 2012-03-18 07:56:52 +0000 (Sun, 18 Mar 2012) Log Message: ----------- change stderr -> stdout for debug messages Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2012-03-18 06:22:04 UTC (rev 12931) +++ trunk/Source/Modules/r.cxx 2012-03-18 07:56:52 UTC (rev 12932) @@ -39,10 +39,10 @@ if(Strncmp(b, "struct ", 7) == 0) Replace(b, "struct ", "", DOH_REPLACE_FIRST); - /* Printf(stderr, "<getRTypeName> %s,base = %s\n", t, b); + /* Printf(stdout, "<getRTypeName> %s,base = %s\n", t, b); for(i = 0; i < Len(els); i++) - Printf(stderr, "%d) %s, ", i, Getitem(els,i)); - Printf(stderr, "\n"); */ + Printf(stdout, "%d) %s, ", i, Getitem(els,i)); + Printf(stdout, "\n"); */ for(i = 0; i < Len(els); i++) { String *el = Getitem(els, i); @@ -92,7 +92,7 @@ if(!l || n == 0) { #ifdef R_SWIG_VERBOSE if (debugMode) - Printf(stderr, "SwigType_split return an empty list for %s\n", + Printf(stdout, "SwigType_split return an empty list for %s\n", retType); #endif return(tmp); @@ -148,7 +148,7 @@ int n = Len(l); if(!l || n == 0) { #ifdef R_SWIG_VERBOSE - Printf(stderr, "SwigType_split return an empty list for %s\n", retType); + Printf(stdout, "SwigType_split return an empty list for %s\n", retType); #endif return(tmp); } @@ -295,7 +295,7 @@ int memberfunctionHandler(Node *n) { if (debugMode) - Printf(stderr, "<memberfunctionHandler> %s %s\n", + Printf(stdout, "<memberfunctionHandler> %s %s\n", Getattr(n, "name"), Getattr(n, "type")); member_name = Getattr(n, "sym:name"); @@ -497,11 +497,11 @@ (void) tt; n = Getattr(n, "type"); if (debugMode) - Printf(stderr, "type: %s\n", n); + Printf(stdout, "type: %s\n", n); ParmList *parms = Getattr(n, "parms"); if (debugMode) - Printf(stderr, "parms = %p\n", parms); + Printf(stdout, "parms = %p\n", parms); return ParmList_len(parms); } @@ -512,7 +512,7 @@ if(!SMethodInfo) SMethodInfo = NewHash(); if (debugMode) - Printf(stderr, "[addMethodInfo] %s\n", name); + Printf(stdout, "[addMethodInfo] %s\n", name); Hash *tb = Getattr(SMethodInfo, name); @@ -543,7 +543,7 @@ return funName; if (debugMode) - Printf(stderr, "<createFunctionPointerHandler> Defining %s\n", t); + Printf(stdout, "<createFunctionPointerHandler> Defining %s\n", t); SwigType *rettype = Copy(Getattr(n, "type")); SwigType *funcparams = SwigType_functionpointer_decompose(rettype); @@ -555,13 +555,13 @@ if (debugMode) { - Printf(stderr, "Type: %s\n", t); - Printf(stderr, "Return type: %s\n", SwigType_base(t)); + Printf(stdout, "Type: %s\n", t); + Printf(stdout, "Return type: %s\n", SwigType_base(t)); } bool isVoidType = Strcmp(rettype, "void") == 0; if (debugMode) - Printf(stderr, "%s is void ? %s (%s)\n", funName, isVoidType ? "yes" : "no", rettype); + Printf(stdout, "%s is void ? %s (%s)\n", funName, isVoidType ? "yes" : "no", rettype); Wrapper *f = NewWrapper(); @@ -608,7 +608,7 @@ if(numArgs) { *numArgs = nargs; if (debugMode) - Printf(stderr, "Setting number of parameters to %d\n", *numArgs); + Printf(stdout, "Setting number of parameters to %d\n", *numArgs); } String *setExprElements = NewString(""); @@ -744,7 +744,7 @@ SwigType *t = Getattr(n, "type"); SwigType *name = Getattr(n, "name"); if (debugMode) - Printf(stderr, "cDeclaration (%s): %s\n", name, SwigType_lstr(t, 0)); + Printf(stdout, "cDeclaration (%s): %s\n", name, SwigType_lstr(t, 0)); return Language::cDeclaration(n); } #endif @@ -846,7 +846,7 @@ Printf(output_filename, "%s%s.R", SWIG_output_directory(), Rpackage); #ifdef R_SWIG_VERBOSE - Printf(stderr, "Writing S code to %s\n", output_filename); + Printf(stdout, "Writing S code to %s\n", output_filename); #endif File *scode = NewFile(output_filename, "w", SWIG_output_files()); @@ -935,15 +935,15 @@ if (debugMode) { for(i = 0; i < n ; i++ ) { key = Getitem(keys, i); - Printf(stderr, "%d) %s\n", i, key); + Printf(stdout, "%d) %s\n", i, key); List *els = Getattr(tb, key); int nels = Len(els); - Printf(stderr, "\t"); + Printf(stdout, "\t"); for(int j = 0; j < nels; j+=2) { - Printf(stderr, "%s%s", Getitem(els, j), j < nels - 1 ? ", " : ""); - Printf(stderr, "%s\n", Getitem(els, j+1)); + Printf(stdout, "%s%s", Getitem(els, j), j < nels - 1 ? ", " : ""); + Printf(stdout, "%s\n", Getitem(els, j+1)); } - Printf(stderr, "\n"); + Printf(stdout, "\n"); } } @@ -1289,7 +1289,7 @@ Append(l, tmp); // if we could put the wrapper in directly: Append(l, Copy(sfun)); if (debugMode) - Printf(stderr, "Adding accessor: %s (%s) => %s\n", memberName, name, tmp); + Printf(stdout, "Adding accessor: %s (%s) => %s\n", memberName, name, tmp); } #define Swig_overload_rank R_swig_overload_rank @@ -1641,7 +1641,7 @@ String *type = Getattr(n, "type"); if (debugMode) { - Printf(stderr, + Printf(stdout, "<functionWrapper> %s %s %s\n", fname, iname, type); } String *overname = 0; @@ -1660,7 +1660,7 @@ } if (debugMode) - Printf(stderr, + Printf(stdout, "<functionWrapper> processing parameters\n"); @@ -1694,11 +1694,11 @@ } } if (debugMode) - Printf(stderr, "<functionWrapper> unresolved_return_type %s\n", + Printf(stdout, "<functionWrapper> unresolved_return_type %s\n", unresolved_return_type); if(processing_member_access_function) { if (debugMode) - Printf(stderr, "<functionWrapper memberAccess> '%s' '%s' '%s' '%s'\n", + Printf(stdout, "<functionWrapper memberAccess> '%s' '%s' '%s' '%s'\n", fname, iname, member_name, class_name); if(opaqueClassDeclaration) @@ -1757,7 +1757,7 @@ // if(addCopyParam) if (debugMode) - Printf(stderr, "Adding a .copy argument to %s for %s = %s\n", + Printf(stdout, "Adding a .copy argument to %s for %s = %s\n", iname, type, addCopyParam ? "yes" : "no"); Printv(f->def, "SWIGEXPORT SEXP\n", wname, " ( ", NIL); @@ -1814,7 +1814,7 @@ //XXX need to free. name = NewStringf("%s", Strchr(name, ':') + 2); if (debugMode) - Printf(stderr, "+++ parameter name with :: in it %s\n", name); + Printf(stdout, "+++ parameter name with :: in it %s\n", name); } if (Len(name) == 0) name = NewStringf("s_arg%d", i+1); @@ -1977,7 +1977,7 @@ /* Deal with the explicit return value. */ if ((tm = Swig_typemap_lookup_out("out", n, Swig_cresult_name(), f, actioncode))) { SwigType *retType = Getattr(n, "type"); - //Printf(stderr, "Return Value for %s, array? %s\n", retType, SwigType_isarray(retType) ? "yes" : "no"); + //Printf(stdout, "Return Value for %s, array? %s\n", retType, SwigType_isarray(retType) ? "yes" : "no"); /* if(SwigType_isarray(retType)) { defineArrayAccessors(retType); } */ @@ -2258,7 +2258,7 @@ if(Getattr(n, "unnamed") && Strcmp(Getattr(n, "storage"), "typedef") == 0 && Getattr(n, "tdname") && Strcmp(Getattr(n, "tdname"), name) == 0) { if (debugMode) - Printf(stderr, "Typedef in the class declaration for %s\n", name); + Printf(stdout, "Typedef in the class declaration for %s\n", name); // typedefHandler(n); } @@ -2340,7 +2340,7 @@ // returns "" tp = processType(elType, c, NULL); - // Printf(stderr, "<classDeclaration> elType %p\n", elType); + // Printf(stdout, "<classDeclaration> elType %p\n", elType); // tp = getRClassNameCopyStruct(Getattr(c, "type"), 1); #endif String *elNameT = replaceInitialDash(elName); @@ -2392,7 +2392,7 @@ String *mangledName = SwigType_manglestr(name); if (debugMode) - Printf(stderr, "generateCopyRoutines: name = %s, %s\n", name, type); + Printf(stdout, "generateCopyRoutines: name = %s, %s\n", name, type); Printf(copyToR->def, "CopyToR%s = function(value, obj = new(\"%s\"))\n{\n", mangledName, name); @@ -2475,7 +2475,7 @@ SwigType *tp = Getattr(n, "type"); String *type = Getattr(n, "type"); if (debugMode) - Printf(stderr, "<typedefHandler> %s\n", Getattr(n, "name")); + Printf(stdout, "<typedefHandler> %s\n", Getattr(n, "name")); processType(tp, n); @@ -2484,7 +2484,7 @@ char *trueName = Char(type); trueName += 7; if (debugMode) - Printf(stderr, "<typedefHandler> Defining S class %s\n", trueName); + Printf(stdout, "<typedefHandler> Defining S class %s\n", trueName); Printf(s_classes, "setClass('_p%s', contains = 'ExternalReference')\n", SwigType_manglestr(name)); } @@ -2506,13 +2506,13 @@ processing_member_access_function = 1; member_name = Getattr(n,"sym:name"); if (debugMode) - Printf(stderr, "<membervariableHandler> name = %s, sym:name = %s\n", + Printf(stdout, "<membervariableHandler> name = %s, sym:name = %s\n", Getattr(n, "name"), member_name); int status(Language::membervariableHandler(n)); if(!opaqueClassDeclaration && debugMode) - Printf(stderr, "<membervariableHandler> %s %s\n", Getattr(n, "name"), Getattr(n, "type")); + Printf(stdout, "<membervariableHandler> %s %s\n", Getattr(n, "name"), Getattr(n, "type")); processing_member_access_function = 0; member_name = NULL; @@ -2527,7 +2527,7 @@ String * R::runtimeCode() { String *s = Swig_include_sys("rrun.swg"); if (!s) { - Printf(stderr, "*** Unable to open 'rrun.swg'\n"); + Printf(stdout, "*** Unable to open 'rrun.swg'\n"); s = NewString(""); } return s; @@ -2659,7 +2659,7 @@ SwigType *tmp = Getattr(n, "tdname"); if (debugMode) - Printf(stderr, "processType %s (tdname = %s)\n", Getattr(n, "name"), tmp); + Printf(stdout, "processType %s (tdname = %s)\n", Getattr(n, "name"), tmp); SwigType *td = t; if (expandTypedef(t) && @@ -2676,7 +2676,7 @@ String *b = getRTypeName(t, &count); if(count && b && !Getattr(SClassDefs, b)) { if (debugMode) - Printf(stderr, "<processType> Defining class %s\n", b); + Printf(stdout, "<processType> Defining class %s\n", b); Printf(s_classes, "setClass('%s', contains = 'ExternalReference')\n", b); Setattr(SClassDefs, b, b); @@ -2690,7 +2690,7 @@ if(SwigType_isfunctionpointer(t)) { if (debugMode) - Printf(stderr, + Printf(stdout, "<processType> Defining pointer handler %s\n", t); String *tmp = createFunctionPointerHandler(t, n, nargs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2012-03-18 08:02:15
|
Revision: 12933 http://swig.svn.sourceforge.net/swig/?rev=12933&view=rev Author: drjoe Date: 2012-03-18 08:02:09 +0000 (Sun, 18 Mar 2012) Log Message: ----------- switch on debugs in debug mode Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2012-03-18 07:56:52 UTC (rev 12932) +++ trunk/Source/Modules/r.cxx 2012-03-18 08:02:09 UTC (rev 12933) @@ -2614,6 +2614,13 @@ if (cppcast) { Preprocessor_define((DOH *) "SWIG_CPLUSPLUS_CAST", 0); } + + if (debugMode) { + Swig_typemap_search_debug_set(); + Swig_typemap_used_debug_set(); + Swig_typemap_register_debug_set(); + Swig_file_debug_set(); + } /// copyToR copyToC functions. } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2012-03-18 13:46:18
|
Revision: 12936 http://swig.svn.sourceforge.net/swig/?rev=12936&view=rev Author: drjoe Date: 2012-03-18 13:46:12 +0000 (Sun, 18 Mar 2012) Log Message: ----------- add rtypecheck fixed function pointer to pass regression tests added some debug Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2012-03-18 10:48:48 UTC (rev 12935) +++ trunk/Source/Modules/r.cxx 2012-03-18 13:46:12 UTC (rev 12936) @@ -292,6 +292,8 @@ int membervariableHandler(Node *n); int typedefHandler(Node *n); + static List *Swig_overload_rank(Node *n, + bool script_lang_wrapping); int memberfunctionHandler(Node *n) { if (debugMode) @@ -616,11 +618,16 @@ for(i = 0; p; i++) { SwigType *tt = Getattr(p, "type"); SwigType *name = Getattr(p, "name"); - // String *lname = Getattr(p,"lname"); + String *tm = Getattr(p, "tmap:out"); Printf(f->def, "%s %s", SwigType_str(tt, 0), name); - String *tm = Getattr(p, "tmap:out"); - if(tm) { + if(tm) { Replaceall(tm, "$1", name); + if (SwigType_isreference(tt)) { + String *tmp = NewString(""); + Append(tmp, "*"); + Append(tmp, name); + Replaceall(tm, tmp, name); + } Replaceall(tm, "$result", "r_tmp"); replaceRClass(tm, Getattr(p,"type")); Replaceall(tm,"$owner", "R_SWIG_EXTERNAL"); @@ -691,11 +698,14 @@ Printv(f->code, "R_SWIG_popCallbackFunctionData(1);\n", NIL); Printv(f->code, "\n", UnProtectWrapupCode, NIL); - - if(!isVoidType) + + if (SwigType_isreference(rettype)) { + Printv(f->code, "return *", Swig_cresult_name(), ";\n", NIL); + } else if(!isVoidType) Printv(f->code, "return ", Swig_cresult_name(), ";\n", NIL); Printv(f->code, "\n}\n", NIL); + Replaceall(f->code, "SWIG_exception_fail", "SWIG_exception_noreturn"); /* To coerce correctly in S, we really want to have an extra/intermediate function that handles the scoerceout. @@ -1292,8 +1302,6 @@ Printf(stdout, "Adding accessor: %s (%s) => %s\n", memberName, name, tmp); } -#define Swig_overload_rank R_swig_overload_rank - #define MAX_OVERLOAD 256 struct Overloaded { @@ -1304,7 +1312,7 @@ }; -static List * Swig_overload_rank(Node *n, +List * R::Swig_overload_rank(Node *n, bool script_lang_wrapping) { Overloaded nodes[MAX_OVERLOAD]; int nnodes = 0; @@ -1362,7 +1370,9 @@ int differ = 0; int num_checked = 0; while (p1 && p2 && (num_checked < nodes[i].argc)) { - // Printf(stdout,"p1 = '%s', p2 = '%s'\n", Getattr(p1,"type"), Getattr(p2,"type")); + if (debugMode) { + Printf(stdout,"p1 = '%s', p2 = '%s'\n", Getattr(p1,"type"), Getattr(p2,"type")); + } if (checkAttribute(p1,"tmap:in:numinputs","0")) { p1 = Getattr(p1,"tmap:in:next"); continue; @@ -1373,6 +1383,9 @@ } String *t1 = Getattr(p1,"tmap:typecheck:precedence"); String *t2 = Getattr(p2,"tmap:typecheck:precedence"); + if (debugMode) { + Printf(stdout,"t1 = '%s', t2 = '%s'\n", t1, t2); + } if ((!t1) && (!nodes[i].error)) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[i].n), Getline(nodes[i].n), "Overloaded method %s not supported (no type checking rule for '%s').\n", @@ -1553,6 +1566,9 @@ Printf(f->def, "`%s` <- function(...) {", sfname); + if (debugMode) { + Swig_print_node(n); + } List *dispatch = Swig_overload_rank(n, true); int nfunc = Len(dispatch); Printv(f->code, @@ -1587,31 +1603,59 @@ } Printv(f->code, "if (", NIL); for (p =pi, j = 0 ; j < num_arguments ; j++) { + if (debugMode) { + Swig_print_node(p); + } String *tm = Swig_typemap_lookup("rtype", p, "", 0); if(tm) { replaceRClass(tm, Getattr(p, "type")); } + + String *tmcheck = Swig_typemap_lookup("rtypecheck", p, "", 0); + if (tmcheck) { + + String *tmp = NewString(""); + Printf(tmp, "argv[[%d]]", j+1); + Replaceall(tmcheck, "$arg", tmp); + Printf(tmp, "argtype[%d]", j+1); + Replaceall(tmcheck, "$argtype", tmp); + if (tm) { + Replaceall(tmcheck, "$rtype", tm); + } + if (debugMode) { + Printf(stdout, "<rtypecheck>%s\n", tmcheck); + } + Printf(f->code, "%s(%s)", + j == 0? "" : " && ", + tmcheck); + p = Getattr(p, "tmap:in:next"); + continue; + } if (DohStrcmp(tm,"numeric")==0) { - Printf(f->code, "%sis.numeric(argv[[%d]])", - j == 0 ? "" : " && ", - j+1); - } - else if (DohStrcmp(tm,"integer")==0) { - Printf(f->code, "%s(is.integer(argv[[%d]]) || is.numeric(argv[[%d]]))", - j == 0 ? "" : " && ", - j+1, j+1); - } - else if (DohStrcmp(tm,"character")==0) { - Printf(f->code, "%sis.character(argv[[%d]])", - j == 0 ? "" : " && ", - j+1); - } - else { - Printf(f->code, "%sextends(argtypes[%d], '%s')", - j == 0 ? "" : " && ", - j+1, - tm); - } + Printf(f->code, "%sis.numeric(argv[[%d]])", + j == 0 ? "" : " && ", + j+1); + } + else if (DohStrcmp(tm,"integer")==0) { + Printf(f->code, "%s(is.integer(argv[[%d]]) || is.numeric(argv[[%d]]))", + j == 0 ? "" : " && ", + j+1, j+1); + } + else if (DohStrcmp(tm,"character")==0) { + Printf(f->code, "%sis.character(argv[[%d]])", + j == 0 ? "" : " && ", + j+1); + } + else { + Printf(f->code, "%sextends(argtypes[%d], '%s')", + j == 0 ? "" : " && ", + j+1, + tm); + } + if (!SwigType_ispointer(Getattr(p, "type"))) { + Printf(f->code, " && length(argv[[%d]]) == 1", + j+1); + } p = Getattr(p, "tmap:in:next"); } Printf(f->code, ") { f <- %s%s; }\n", sfname, overname); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2012-03-18 17:11:08
|
Revision: 12937 http://swig.svn.sourceforge.net/swig/?rev=12937&view=rev Author: drjoe Date: 2012-03-18 17:11:02 +0000 (Sun, 18 Mar 2012) Log Message: ----------- change method of passing arguments into R overloading code Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2012-03-18 13:46:12 UTC (rev 12936) +++ trunk/Source/Modules/r.cxx 2012-03-18 17:11:02 UTC (rev 12937) @@ -1107,12 +1107,11 @@ Printv(f->code, tab8, "f(x, value);\n", NIL); Printv(f->code, tab8, "x;\n", NIL); // make certain to return the S value. } else { - Printv(f->code, tab8, "formals(f)[[1]] = x;\n", NIL); if (varaccessor) { Printv(f->code, tab8, - "if (is.na(match(name, vaccessors))) f else f(x);\n", NIL); + "if (is.na(match(name, vaccessors))) function(...){f(x, ...)} else f(x);\n", NIL); } else { - Printv(f->code, tab8, "f;\n", NIL); + Printv(f->code, tab8, "function(...){f(x, ...)};\n", NIL); } } Printf(f->code, "}\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-08-08 06:07:40
|
Revision: 13557 http://swig.svn.sourceforge.net/swig/?rev=13557&view=rev Author: wsfulton Date: 2012-08-08 06:07:34 +0000 (Wed, 08 Aug 2012) Log Message: ----------- Fix use of deleted memory in R module Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2012-08-08 06:06:31 UTC (rev 13556) +++ trunk/Source/Modules/r.cxx 2012-08-08 06:07:34 UTC (rev 13557) @@ -2451,7 +2451,6 @@ } String *elKind = Getattr(c, "kind"); if (Strcmp(elKind, "variable") != 0) { - Delete(elKind); continue; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2012-12-12 12:41:14
|
Revision: 13957 http://swig.svn.sourceforge.net/swig/?rev=13957&view=rev Author: drjoe Date: 2012-12-12 12:41:07 +0000 (Wed, 12 Dec 2012) Log Message: ----------- add finalizer for class fix. It was missing from earlier additions Modified Paths: -------------- trunk/Source/Modules/r.cxx Modified: trunk/Source/Modules/r.cxx =================================================================== --- trunk/Source/Modules/r.cxx 2012-12-11 18:43:56 UTC (rev 13956) +++ trunk/Source/Modules/r.cxx 2012-12-12 12:41:07 UTC (rev 13957) @@ -2115,7 +2115,7 @@ { String *finalizer = NewString(iname); Replace(finalizer, "new_", "", DOH_REPLACE_FIRST); - Printf(sfun->code, "reg.finalizer(ans, delete_%s)\n", finalizer); + Printf(sfun->code, "reg.finalizer(ans@ref, delete_%s)\n", finalizer); } Printf(sfun->code, "ans\n"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |