make base director class virtual and eliminate compilation warnings

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7712 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-25 09:33:42 +00:00
commit cf9c5fb721
4 changed files with 8 additions and 7 deletions

View file

@ -79,7 +79,7 @@ String *Swig_director_declaration(Node *n) {
String *directorname = NewStringf("SwigDirector_%s", classname);
String *base = Getattr(n, "classtype");
String *declaration = Swig_class_declaration(n, directorname);
Printf(declaration, " : public %s, virtual public Swig::Director {\n", base);
Printf(declaration, " : virtual public Swig::Director, public %s {\n", base);
Delete(classname);
Delete(directorname);
return declaration;

View file

@ -1833,7 +1833,7 @@ public:
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(decl, classname, parms, 0, 0);
call = Swig_csuperclass_call(0, basetype, superparms);
Printf( w->def, "%s::%s: %s, Swig::Director(self) { }", classname, target, call );
Printf( w->def, "%s::%s: Swig::Director(self), %s { }", classname, target, call );
Delete(target);
Wrapper_print(w, f_directors);
Delete(call);

View file

@ -1812,7 +1812,7 @@ public:
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(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, "%s::%s: Swig::Director(self), %s { \n", classname, target, call);
Printf(w->def, " SWIG_DIRECTOR_RGTR((%s *)this, this); \n", basetype);
Printf(w->def, "}\n");
Delete(target);

View file

@ -1227,12 +1227,13 @@ public:
if (current == CONSTRUCTOR_INITIALIZE) {
Node *pn = Swig_methodclass(n);
String *symname = Getattr(pn,"sym:name");
String *classname = NewStringf("const char *classname = \"%s::%s\"", module, symname);
Wrapper_add_local(f, "classname", classname);
String *action = Getattr(n,"wrap:action");
if (directorsEnabled()) {
String *classname = NewStringf("const char *classname SWIGUNUSED = \"%s::%s\"", module, symname);
Wrapper_add_local(f, "classname", classname);
}
if (action) {
Append(action,"DATA_PTR(self) = result;\n");
if (GetFlag(n,"feature:trackobjects")) {
Append(action,"SWIG_RubyAddTracking(result, self);\n");
}
@ -2146,7 +2147,7 @@ public:
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(decl, classname, parms, 0, 0);
call = Swig_csuperclass_call(0, basetype, superparms);
Printf(w->def, "%s::%s: %s, Swig::Director(self) { }", classname, target, call);
Printf(w->def, "%s::%s: Swig::Director(self), %s { }", classname, target, call);
Delete(target);
Wrapper_print(w, f_directors);
Delete(call);