[master] 4190cd5 - Fix Windows (Visual Studio) compiler warnings

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 4190cd5 - Fix Windows (Visual Studio) compiler warnings "Albrecht Schlosser" 04:47 May 06 top right image
 
commit 4190cd5426efb4f9c30109bd914a1de12ed241fb
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Thu May 6 13:38:04 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Thu May 6 13:38:04 2021 +0200

    Fix Windows (Visual Studio) compiler warnings

 src/Fl_Shared_Image.cxx | 2 +-
 src/gl_draw.cxx         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git src/Fl_Shared_Image.cxx src/Fl_Shared_Image.cxx
index 979fe32..8b3a34d 100644
--- src/Fl_Shared_Image.cxx
+++ src/Fl_Shared_Image.cxx
@@ -257,7 +257,7 @@ void Fl_Shared_Image::reload() {
   if (!name_) return;
 
   if ((fp = fl_fopen(name_, "rb")) != NULL) {
-    count = fread(header, 1, sizeof(header), fp);
+    count = (int)fread(header, 1, sizeof(header), fp);
     fclose(fp);
     if (count == 0)
       return;
diff --git src/gl_draw.cxx src/gl_draw.cxx
index 6bda567..c64506d 100644
--- src/gl_draw.cxx
+++ src/gl_draw.cxx
@@ -408,13 +408,13 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
   Fl_Fontsize fs = fl_size();
   float s = fl_graphics_driver->scale();
   fl_graphics_driver->Fl_Graphics_Driver::scale(1); // temporarily remove scaling factor
-  fl_font(fl_font(), fs * Fl_Gl_Window_Driver::gl_scale); // the font size to use in the GL scene
+  fl_font(fl_font(), int(fs * Fl_Gl_Window_Driver::gl_scale)); // the font size to use in the GL scene
   int w = (int)ceil( fl_width(fifo[current].utf8, n) );
   w = ((w + 3) / 4) * 4; // make w a multiple of 4
   int h = fl_height();
   fl_graphics_driver->Fl_Graphics_Driver::scale(s); // re-install scaling factor
   fl_font(fl_font(), fs);
-  fs *= Fl_Gl_Window_Driver::gl_scale;
+  fs = int(fs * Fl_Gl_Window_Driver::gl_scale);
   fifo[current].scale = Fl_Gl_Window_Driver::gl_scale;
   fifo[current].fdesc = gl_fontsize;
   char *alpha_buf = Fl_Gl_Window_Driver::global()->alpha_mask_for_string(str, n, w, h, fs);
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.