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

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6354 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-10-06 21:10:24 +00:00
commit 9b40e16ea8
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 (status == SWIG_OK && output_director) {
if(!is_void) { if(!is_void) {
Replaceall(w->code,"$null", qualified_return); Replaceall(w->code,"$null", qualified_return);
} else } else {
Replaceall(w->code,"$null",""); Replaceall(w->code,"$null","");
Wrapper_print(w, f_directors); }
Wrapper_print(imw, imclass_directors); Wrapper_print(imw, imclass_directors);
if (!Getattr(n,"defaultargs")) {
Wrapper_print(w, f_directors);
Printv(f_directors_h, declaration, NIL); Printv(f_directors_h, declaration, NIL);
} }
}
Delete(qualified_return); Delete(qualified_return);
Delete(jnidesc); Delete(jnidesc);
@ -3382,6 +3385,7 @@ class JAVA : public Language {
directorPrefixArgs(n); directorPrefixArgs(n);
if (!Getattr(n,"defaultargs")) {
/* constructor */ /* constructor */
{ {
String *basetype = Getattr(parent, "classtype"); String *basetype = Getattr(parent, "classtype");
@ -3405,6 +3409,7 @@ class JAVA : public Language {
Printf(f_directors_h, " %s;\n", target); Printf(f_directors_h, " %s;\n", target);
Delete(target); Delete(target);
} }
}
Delete(sub); Delete(sub);
Delete(supername); Delete(supername);

View file

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

View file

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

View file

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