summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--fluid/Fl_Function_Type.cxx28
2 files changed, 27 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 52da1824a..2ba39f8d2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
CHANGES IN FLTK 1.1.0rc2
- Portability fixes.
+ - FLUID now properly handles default argument parameters
+ properly.
- Fixed WM_PAINT handling under WIN32 - didn't validate
the correct region that was drawn.
- Fl_Multiline_Output would insert the enter key.
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx
index 661379cc7..8d232c6c2 100644
--- a/fluid/Fl_Function_Type.cxx
+++ b/fluid/Fl_Function_Type.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.4 2002/05/04 05:28:11 easysw Exp $"
+// "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.5 2002/05/12 01:02:17 easysw Exp $"
//
// C function type code for the Fast Light Tool Kit (FLTK).
//
@@ -257,7 +257,29 @@ void Fl_Function_Type::write_code1() {
*sptr = '\0';
write_h("%s;\n", s);
- write_c("%s::%s {\n", k, name());
+ // skip all function default param. init in body:
+ int skips=0;
+ int nc=0,level=0;
+ for (sptr=s,nptr=(char*)name(); *nptr; nc++,nptr++) {
+ if (!skips && *nptr=='(') level++;
+ else if (!skips && *nptr==')') level--;
+
+ if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') )
+ skips = skips ? 0 : 1;
+ if(!skips && level==1 && *nptr =='=' &&
+ !(nc && *(nptr-1)=='\'') ) // ignore '=' case
+ while(*++nptr && (skips || *(nptr-1)=='\'' ||
+ (*nptr!=',' && (*nptr!=')' || level!=1) ))) {
+ if ( *nptr=='"' && *(nptr-1)!='\\' )
+ skips = skips ? 0 : 1;
+ if (!skips && *nptr=='(') level++;
+ else if (!skips && *nptr==')') level--;
+ }
+ *sptr++ = *nptr;
+ }
+ *sptr = '\0';
+
+ write_c("%s::%s {\n", k, s);
} else {
if (public_) {
if (cdecl_)
@@ -680,5 +702,5 @@ void Fl_Class_Type::write_code2() {
}
//
-// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.4 2002/05/04 05:28:11 easysw Exp $".
+// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.5 2002/05/12 01:02:17 easysw Exp $".
//