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:
parent
37863d349b
commit
bbb97f8e6d
4 changed files with 105 additions and 90 deletions
|
|
@ -3308,11 +3308,14 @@ 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);
|
||||
Printv(f_directors_h, declaration, NIL);
|
||||
if (!Getattr(n,"defaultargs")) {
|
||||
Wrapper_print(w, f_directors);
|
||||
Printv(f_directors_h, declaration, NIL);
|
||||
}
|
||||
}
|
||||
|
||||
Delete(qualified_return);
|
||||
|
|
@ -3382,28 +3385,30 @@ class JAVA : public Language {
|
|||
|
||||
directorPrefixArgs(n);
|
||||
|
||||
/* constructor */
|
||||
{
|
||||
String *basetype = Getattr(parent, "classtype");
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 0);
|
||||
String *call = Swig_csuperclass_call(0, basetype, superparms);
|
||||
String *classtype = SwigType_namestr(Getattr(n, "name"));
|
||||
String *dirclass_type = SwigType_namestr(Getattr(n, "sym:name"));
|
||||
if (!Getattr(n,"defaultargs")) {
|
||||
/* constructor */
|
||||
{
|
||||
String *basetype = Getattr(parent, "classtype");
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 0);
|
||||
String *call = Swig_csuperclass_call(0, basetype, superparms);
|
||||
String *classtype = SwigType_namestr(Getattr(n, "name"));
|
||||
String *dirclass_type = SwigType_namestr(Getattr(n, "sym:name"));
|
||||
|
||||
Printf(f_directors, "%s::%s: %s, %s {\n", classname, target, call, Getattr(parent, "director:ctor"));
|
||||
Printf(f_directors, "}\n\n");
|
||||
Printf(f_directors, "%s::%s: %s, %s {\n", classname, target, call, Getattr(parent, "director:ctor"));
|
||||
Printf(f_directors, "}\n\n");
|
||||
|
||||
Delete(dirclass_type);
|
||||
Delete(classtype);
|
||||
Delete(target);
|
||||
Delete(call);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
|
||||
Printf(f_directors_h, " %s;\n", target);
|
||||
Delete(target);
|
||||
Delete(dirclass_type);
|
||||
Delete(classtype);
|
||||
Delete(target);
|
||||
Delete(call);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
|
||||
Printf(f_directors_h, " %s;\n", target);
|
||||
Delete(target);
|
||||
}
|
||||
}
|
||||
|
||||
Delete(sub);
|
||||
|
|
|
|||
|
|
@ -1750,8 +1750,10 @@ 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 */
|
||||
|
|
@ -1795,30 +1797,30 @@ public:
|
|||
Setattr(p, "value", "0");
|
||||
set_nextSibling(ip, p);
|
||||
|
||||
/* constructor */
|
||||
{
|
||||
Wrapper *w = NewWrapper();
|
||||
String *call;
|
||||
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, disown) { }",
|
||||
classname, target, call );
|
||||
Delete(target);
|
||||
Wrapper_print(w, f_directors);
|
||||
Delete(call);
|
||||
DelWrapper(w);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
String *target = Swig_method_decl(decl, classname,
|
||||
parms, 0, 1);
|
||||
Printf(f_directors_h, " %s;\n", target);
|
||||
Delete(target);
|
||||
}
|
||||
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);
|
||||
call = Swig_csuperclass_call(0, basetype, superparms);
|
||||
Printf( w->def,
|
||||
"%s::%s: %s, Swig::Director(self, disown) { }",
|
||||
classname, target, call );
|
||||
Delete(target);
|
||||
Wrapper_print(w, f_directors);
|
||||
Delete(call);
|
||||
DelWrapper(w);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -1993,8 +1993,10 @@ public:
|
|||
|
||||
/* emit the director method */
|
||||
if (status == SWIG_OK) {
|
||||
Wrapper_print(w, f_directors);
|
||||
Printv(f_directors_h, declaration, NIL);
|
||||
if (!Getattr(n,"defaultargs")) {
|
||||
Wrapper_print(w, f_directors);
|
||||
Printv(f_directors_h, declaration, NIL);
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up */
|
||||
|
|
@ -2038,25 +2040,27 @@ public:
|
|||
Setattr(p, "value", "false");
|
||||
set_nextSibling(ip, p);
|
||||
|
||||
/* constructor */
|
||||
{
|
||||
Wrapper *w = NewWrapper();
|
||||
String *call;
|
||||
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, disown) { }", classname, target, call);
|
||||
Delete(target);
|
||||
Wrapper_print(w, f_directors);
|
||||
Delete(call);
|
||||
DelWrapper(w);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
|
||||
Printf(f_directors_h, " %s;\n", target);
|
||||
Delete(target);
|
||||
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);
|
||||
call = Swig_csuperclass_call(0, basetype, superparms);
|
||||
Printf(w->def, "%s::%s: %s, Swig::Director(self, disown) { }", classname, target, call);
|
||||
Delete(target);
|
||||
Wrapper_print(w, f_directors);
|
||||
Delete(call);
|
||||
DelWrapper(w);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
|
||||
Printf(f_directors_h, " %s;\n", target);
|
||||
Delete(target);
|
||||
}
|
||||
}
|
||||
|
||||
Delete(sub);
|
||||
|
|
|
|||
|
|
@ -1911,25 +1911,27 @@ public:
|
|||
Setattr(p, "value", "false");
|
||||
set_nextSibling(ip, p);
|
||||
|
||||
/* constructor */
|
||||
{
|
||||
Wrapper *w = NewWrapper();
|
||||
String *call;
|
||||
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, disown) { }", classname, target, call);
|
||||
Delete(target);
|
||||
Wrapper_print(w, f_directors);
|
||||
Delete(call);
|
||||
DelWrapper(w);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
|
||||
Printf(f_directors_h, " %s;\n", target);
|
||||
Delete(target);
|
||||
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);
|
||||
call = Swig_csuperclass_call(0, basetype, superparms);
|
||||
Printf(w->def, "%s::%s: %s, Swig::Director(self, disown) { }", classname, target, call);
|
||||
Delete(target);
|
||||
Wrapper_print(w, f_directors);
|
||||
Delete(call);
|
||||
DelWrapper(w);
|
||||
}
|
||||
|
||||
/* constructor header */
|
||||
{
|
||||
String *target = Swig_method_decl(decl, classname, parms, 0, 1);
|
||||
Printf(f_directors_h, " %s;\n", target);
|
||||
Delete(target);
|
||||
}
|
||||
}
|
||||
|
||||
Delete(sub);
|
||||
|
|
@ -1953,7 +1955,7 @@ public:
|
|||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* classDirectorMethod()
|
||||
* exceptionSafeMethodCall()
|
||||
*
|
||||
* Emit a virtual director method to pass a method call on to the
|
||||
* underlying Ruby instance.
|
||||
|
|
@ -2377,8 +2379,10 @@ public:
|
|||
|
||||
/* emit the director method */
|
||||
if (status == SWIG_OK) {
|
||||
Wrapper_print(w, f_directors);
|
||||
Printv(f_directors_h, declaration, NIL);
|
||||
if (!Getattr(n,"defaultargs")) {
|
||||
Wrapper_print(w, f_directors);
|
||||
Printv(f_directors_h, declaration, NIL);
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue