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,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);