Fix director operator pointer casts

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-11-09 22:32:28 +00:00
commit 599d64e188
7 changed files with 83 additions and 111 deletions

View file

@ -2362,7 +2362,7 @@ public:
Wrapper *w = NewWrapper();
String *call;
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(decl, classname, parms, 0, 0);
String *target = Swig_method_decl(0, decl, classname, parms, 0, 0);
call = Swig_csuperclass_call(0, basetype, superparms);
Printf(w->def, "%s::%s: %s, Swig::Director(self) { \n", classname, target, call);
Printf(w->def, " SWIG_DIRECTOR_RGTR((%s *)this, this); \n", basetype);
@ -2375,7 +2375,7 @@ public:
/* constructor header */
{
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
String *target = Swig_method_decl(0, decl, classname, parms, 0, 1);
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
@ -3305,20 +3305,14 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
String *target;
String *pclassname = NewStringf("SwigDirector_%s", classname);
String *qualified_name = NewStringf("%s::%s", pclassname, name);
target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s", target);
else
Printf(w->def, "%s %s", rtype, target);
SwigType *rtype = Getattr(n, "conversion_operator") ? 0 : type;
target = Swig_method_decl(rtype, decl, qualified_name, l, 0, 0);
Printf(w->def, "%s", target);
Delete(qualified_name);
Delete(target);
/* header declaration */
target = Swig_method_decl(decl, name, l, 0, 1);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s", target);
else
Printf(declaration, " virtual %s %s", rtype, target);
target = Swig_method_decl(rtype, decl, name, l, 0, 1);
Printf(declaration, " virtual %s", target);
Delete(target);
// Get any exception classes in the throws typemap
@ -3737,7 +3731,6 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
/* clean up */
Delete(wrap_args);
Delete(rtype);
Delete(return_type);
Delete(pclassname);
DelWrapper(w);