DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2521
Version: 1.3.0


WRT dependencies: yes, I'm surprised as well, but that seems to be a
feature (others would call it a bug) in VC6, since later versions behave
differently. So now I think that it would be good to do it as Brian
proposed.

WRT performance warnings: I tried to use a cast, but this doesn't work as
easy as one would think. Heck, this is another MS feature ("by design").
You must change a simple automatic cast (using an int where a bool is
required) by making a comparison to express that you
*really,really,really* want to use an int where a bool is required and
take the "performance penalty" for the conversion. See the link [1] below,
but beware: Microsoft's world is the other way around, you must read the
comments bottom-up ;-)

Attached diff visualc_performance_warning.diff fixes these warnings, but
I'm not sure whether we want this.

[1]
<http://connect.microsoft.com/VisualStudio/feedback/details/99633/bogus-performance-warning-c4800>


Link: http://www.fltk.org/str.php?L2521
Version: 1.3.0
Index: FL/Fl.H
===================================================================
--- FL/Fl.H     (Revision 8296)
+++ FL/Fl.H     (Arbeitskopie)
@@ -940,7 +940,7 @@
     non-text widgets. The default mode is to enable keyboard focus
     for all widgets.
   */
-  static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, v);  }
+  static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, 
(bool)(v!=0)); }
   /**
     Gets or sets the visible keyboard focus on buttons and other
     non-text widgets. The default mode is to enable keyboard focus
@@ -955,7 +955,7 @@
     be dragged from text fields or dragged within a text field as a
     cut/paste shortcut.
   */
-  static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, v); }
+  static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (bool)(v!=0)); }
   /**
     Gets or sets whether drag and drop text operations are
     supported. This specifically affects whether selected text can
Index: FL/Fl_Tooltip.H
===================================================================
--- FL/Fl_Tooltip.H     (Revision 8296)
+++ FL/Fl_Tooltip.H     (Arbeitskopie)
@@ -57,7 +57,7 @@
   /**    Returns non-zero if tooltips are enabled.  */
   static int enabled() { return Fl::option(Fl::OPTION_SHOW_TOOLTIPS); }
   /**    Enables tooltips on all widgets (or disables if <i>b</i> is false).  
*/
-  static void enable(int b = 1) { Fl::option(Fl::OPTION_SHOW_TOOLTIPS, b);}
+  static void enable(int b = 1) { Fl::option(Fl::OPTION_SHOW_TOOLTIPS, 
(bool)(b!=0));}
   /**    Same as enable(0), disables tooltips on all widgets.  */
   static void disable() { enable(0); }
   static void (*enter)(Fl_Widget* w);
Index: src/Fl.cxx
===================================================================
--- src/Fl.cxx  (Revision 8296)
+++ src/Fl.cxx  (Arbeitskopie)
@@ -1806,7 +1806,7 @@
   }
   if (opt<0 || opt>=OPTION_LAST) 
     return false;
-  return (bool)options_[opt];
+  return (bool)(options_[opt]!=0);
 }
 
 /**
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to