diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-19 21:00:26 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-19 21:00:26 +0000 |
| commit | 90e8eb7a4501562728d016eddc31225e7a4bd7fc (patch) | |
| tree | c63dc0778f8c6385cf230aa66978a116426e0d9d /fluid/Fl_Function_Type.cxx | |
| parent | 1a86a0ede02de76c617165fb3555c192f0b74347 (diff) | |
More changes from Bill Spitzak.
git-svn-id: file:///fltk/svn/fltk/trunk@20 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Function_Type.cxx')
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 32926e1ca..21bdb5b37 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -66,8 +66,6 @@ const char *c_check(const char *c, int type) { class Fl_Function_Type : public Fl_Type { const char* return_type; - const char* actual_return_type; - const char* star; char public_, constructor, havewidgets; public: Fl_Type *make(); @@ -168,21 +166,21 @@ void Fl_Function_Type::write_code1() { Fl_Type *child; const char* widget_type = 0; for (child = next; child && child->level > level; child = child->next) - if (child->is_widget() && child->level == level+1) { + if (child->is_widget()) { havewidgets = 1; widget_type = subclassname(child); + break; } write_c("\n"); if (ismain()) write_c("int main(int argc, char **argv) {\n"); else { const char* t = return_type; - star = ""; + const char* star = ""; if (!t) { if (havewidgets) {t = widget_type; star = "*";} else t = "void"; } - actual_return_type=t; const char* k = class_name(); if (k) { write_public(public_); @@ -202,7 +200,7 @@ void Fl_Function_Type::write_code1() { write_c("%s%s %s {\n", t, star, name()); } } - if (havewidgets) write_c(" Fl_Window* w;\n"); + if (havewidgets) write_c(" %s* w;\n", widget_type); indentation += 2; } @@ -211,7 +209,7 @@ void Fl_Function_Type::write_code2() { if (havewidgets) write_c(" w->show(argc, argv);\n"); write_c(" return Fl::run();\n"); } else if (havewidgets && !constructor) - write_c(" return (%s%s)w;\n", actual_return_type, star); + write_c(" return w;\n"); write_c("}\n"); indentation = 0; } |
