fixes for the new default argument wrapping in director constructors and virtual methods

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6354 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-10-06 21:10:24 +00:00
commit bbb97f8e6d
4 changed files with 105 additions and 90 deletions

View file

@ -3308,12 +3308,15 @@ class JAVA : public Language {
if (status == SWIG_OK && output_director) {
if(!is_void) {
Replaceall(w->code,"$null", qualified_return);
} else
} else {
Replaceall(w->code,"$null","");
Wrapper_print(w, f_directors);
}
Wrapper_print(imw, imclass_directors);
if (!Getattr(n,"defaultargs")) {
Wrapper_print(w, f_directors);
Printv(f_directors_h, declaration, NIL);
}
}
Delete(qualified_return);
Delete(jnidesc);
@ -3382,6 +3385,7 @@ class JAVA : public Language {
directorPrefixArgs(n);
if (!Getattr(n,"defaultargs")) {
/* constructor */
{
String *basetype = Getattr(parent, "classtype");
@ -3405,6 +3409,7 @@ class JAVA : public Language {
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
}
Delete(sub);
Delete(supername);

View file

@ -1750,9 +1750,11 @@ public:
/* emit the director method */
if (status == SWIG_OK) {
if (!Getattr(n,"defaultargs")) {
Wrapper_print(w, f_directors);
Printv(f_directors_h, declaration, NIL);
}
}
/* clean up */
Delete(wrap_args);
@ -1795,13 +1797,13 @@ public:
Setattr(p, "value", "0");
set_nextSibling(ip, p);
if (!Getattr(n,"defaultargs")) {
/* constructor */
{
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(decl, classname, parms, 0, 0);
call = Swig_csuperclass_call(0, basetype, superparms);
Printf( w->def,
"%s::%s: %s, Swig::Director(self, disown) { }",
@ -1814,11 +1816,11 @@ public:
/* constructor header */
{
String *target = Swig_method_decl(decl, classname,
parms, 0, 1);
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
}
Setattr(n,"parms",q);
Language::classDirectorConstructor(n);

View file

@ -1993,9 +1993,11 @@ public:
/* emit the director method */
if (status == SWIG_OK) {
if (!Getattr(n,"defaultargs")) {
Wrapper_print(w, f_directors);
Printv(f_directors_h, declaration, NIL);
}
}
/* clean up */
Delete(wrap_args);
@ -2038,6 +2040,7 @@ public:
Setattr(p, "value", "false");
set_nextSibling(ip, p);
if (!Getattr(n,"defaultargs")) {
/* constructor */
{
Wrapper *w = NewWrapper();
@ -2058,6 +2061,7 @@ public:
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
}
Delete(sub);
Delete(classname);

View file

@ -1911,6 +1911,7 @@ public:
Setattr(p, "value", "false");
set_nextSibling(ip, p);
if (!Getattr(n,"defaultargs")) {
/* constructor */
{
Wrapper *w = NewWrapper();
@ -1931,6 +1932,7 @@ public:
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
}
Delete(sub);
Delete(classname);
@ -1953,7 +1955,7 @@ public:
}
/* ---------------------------------------------------------------
* classDirectorMethod()
* exceptionSafeMethodCall()
*
* Emit a virtual director method to pass a method call on to the
* underlying Ruby instance.
@ -2377,9 +2379,11 @@ public:
/* emit the director method */
if (status == SWIG_OK) {
if (!Getattr(n,"defaultargs")) {
Wrapper_print(w, f_directors);
Printv(f_directors_h, declaration, NIL);
}
}
/* clean up */
Delete(wrap_args);