diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-10-24 08:38:17 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-10-24 19:37:56 +0100 |
commit | 6c4dcbb8fe62cd8802bb683eb9fc14b32e8459c3 (patch) | |
tree | d4c03ddf73e59734bf20305bde8adf5139f92505 /Source | |
parent | 0fec14ba34c6fdfcf369ee5fe7a364937ad22866 (diff) | |
download | swig-6c4dcbb8fe62cd8802bb683eb9fc14b32e8459c3.tar.gz |
R shared_ptr fixes
Fix problems in shared_ptr wrappers where the class names were
not consistent when using the shared_ptr template or the actual
underlying type. Move $R_class substitution to typemaps.
Issue #2386
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Modules/r.cxx | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 3d9cab0d4..e1fd422dd 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -2088,21 +2088,6 @@ int R::functionWrapper(Node *n) { /*If the user gave us something to convert the result in */ if ((tm = Swig_typemap_lookup("scoerceout", n, Swig_cresult_name(), sfun))) { Replaceall(tm,"$result","ans"); - if (constructor) { - Node * parent = Getattr(n, "parentNode"); - String * smartname = Getattr(parent, "feature:smartptr"); - if (smartname) { // SmartName handling - has to be aligned to the other implementation in this file - SwigType *spt = Swig_cparse_type(smartname); - String *smart = SwigType_typedef_resolve_all(spt); - String *smart_rname = SwigType_manglestr(smart); - String *smart_rname_p = NewStringf("_p%s", smart_rname); - Replaceall(tm, "$R_class", smart_rname_p); - Delete(spt); - Delete(smart); - Delete(smart_rname); - Delete(smart_rname_p); - } - } if (debugMode) { Printf(stdout, "Calling replace B: %s, %s, %s\n", Getattr(n, "type"), Getattr(n, "sym:name"), getNSpace()); } @@ -2328,31 +2313,6 @@ void R::registerClass(Node *n) { Printf(s_classes, "setClass('%s', contains = %s)\n", sname, base); Delete(base); - String *smartptr = Getattr(n, "feature:smartptr"); - if (smartptr) {// SmartName handling - has to be aligned to the other implementation in this file - List *l = Getattr(n, "bases"); - SwigType *spt = Swig_cparse_type(smartptr); - String *smart = SwigType_typedef_resolve_all(spt); - String *smart_rname = SwigType_manglestr(smart); - Printf(s_classes, "setClass('_p%s', contains = c('%s'", smart_rname, sname); - Delete(spt); - Delete(smart); - Delete(smart_rname); - for(int i = 0; i < Len(l); i++) { - Node * b = Getitem(l, i); - smartptr = Getattr(b, "feature:smartptr"); - if (smartptr) { - spt = Swig_cparse_type(smartptr); - smart = SwigType_typedef_resolve_all(spt); - smart_rname = SwigType_manglestr(smart); - Printf(s_classes, ", '_p%s'", smart_rname); - Delete(spt); - Delete(smart); - Delete(smart_rname); - } - } - Printf(s_classes, "))\n"); - } } } |