Author: greg.ercolano
Date: 2010-11-14 20:49:46 -0800 (Sun, 14 Nov 2010)
New Revision: 7836
Log:
Solves STR #2428: Silence float->int conversion warnings



Modified:
   branches/branch-1.3/src/fl_cursor.cxx
   branches/branch-1.3/src/fl_font_mac.cxx

Modified: branches/branch-1.3/src/fl_cursor.cxx
===================================================================
--- branches/branch-1.3/src/fl_cursor.cxx       2010-11-15 04:38:21 UTC (rev 
7835)
+++ branches/branch-1.3/src/fl_cursor.cxx       2010-11-15 04:49:46 UTC (rev 
7836)
@@ -182,8 +182,8 @@
   fl_pie(-r, -r, 2*r, 2*r, 0, 360);
   fl_color(FL_BLACK);
   fl_circle(0,0,r);
-  fl_xyline(0, 0, -r*.7);
-  fl_xyline(0, 0, 0, -r*.7);
+  fl_xyline(0, 0, int(-r*.7));
+  fl_xyline(0, 0, 0, int(-r*.7));
   fl_end_offscreen();
   return (CGContextRef)off;
 }

Modified: branches/branch-1.3/src/fl_font_mac.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_mac.cxx     2010-11-15 04:38:21 UTC (rev 
7835)
+++ branches/branch-1.3/src/fl_font_mac.cxx     2010-11-15 04:49:46 UTC (rev 
7836)
@@ -129,8 +129,8 @@
   float fa = -FixedToFloat(bAscent), fd = -FixedToFloat(bDescent);
   if (fa>0.0f && fd>0.0f) {
     //float f = Size/(fa+fd);
-    ascent = fa; //int(fa*f+0.5f);
-    descent = fd; //Size - ascent;
+    ascent = int(fa); //int(fa*f+0.5f);
+    descent = int(fd); //Size - ascent;
   }
   int w = FixedToInt(bAfter);
   if (w)
@@ -335,8 +335,8 @@
   if (!fl_fontsize) {
     check_default_font(); // avoid a crash!
     if (!fl_fontsize)
-      w = 8.0 * n; // user must select a font first!
-      h = 8.0;
+      w = int(8.0 * n); // user must select a font first!
+      h = int(8.0);
       return;
   }
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
@@ -493,7 +493,7 @@
 }
 
 void Fl_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
-  draw(c, n, x - fl_width(c, n), y);
+  draw(c, n, int(x - fl_width(c, n)), y);
 }
 
 //

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to