FLTK logo

[master] 55f3df2 - Fix remaining VS compiler warnings in example programs

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   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] 55f3df2 - Fix remaining VS compiler warnings in example programs "Albrecht Schlosser" Nov 16, 2021  
 
commit 55f3df268c0f6e2fabc055bef51c195e51dd8716
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Tue Nov 16 21:21:23 2021 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Tue Nov 16 21:25:54 2021 +0100

    Fix remaining VS compiler warnings in example programs

 examples/chart-simple.cxx        | 2 +-
 examples/howto-drag-and-drop.cxx | 2 +-
 examples/progress-simple.cxx     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git examples/chart-simple.cxx examples/chart-simple.cxx
index 3f05b36..6898ce0 100644
--- examples/chart-simple.cxx
+++ examples/chart-simple.cxx
@@ -31,7 +31,7 @@ Fl_Choice *G_choice = 0;
 // Fl_Choice callback for changing chart type()
 static void chart_type_cb(Fl_Widget *w, void*) {
     const Fl_Menu_Item *item = G_choice->mvalue();  // item picked
-    G_chart->type( item->argument() );              // apply change
+    G_chart->type( (uchar)item->argument() );       // apply change
     G_chart->redraw();
     // printf("Choice: '%s', argument=%ld\n", G_choice->text(), item->argument());
 }
diff --git examples/howto-drag-and-drop.cxx examples/howto-drag-and-drop.cxx
index 35a45ed..856838d 100644
--- examples/howto-drag-and-drop.cxx
+++ examples/howto-drag-and-drop.cxx
@@ -43,7 +43,7 @@ public:
     switch ( event ) {
       case FL_PUSH: {             // do 'copy/dnd' when someone clicks on box
         const char *msg = "It works!";
-        Fl::copy(msg,strlen(msg),0);
+        Fl::copy(msg, (int)strlen(msg), 0);
         Fl::dnd();
         ret = 1;
         break;
diff --git examples/progress-simple.cxx examples/progress-simple.cxx
index e0536f4..4631e4e 100644
--- examples/progress-simple.cxx
+++ examples/progress-simple.cxx
@@ -48,7 +48,7 @@ void butt_cb(Fl_Widget *butt, void *data) {
     w->end();                                  // end adding to window
     // Computation loop..
     for ( int t=1; t<=500; t++ ) {
-        progress->value(t/500.0);              // update progress bar with 0.0 ~ 1.0 value
+        progress->value(float(t/500.0));       // update progress bar with 0.0 ~ 1.0 value
         char percent[10];
         sprintf(percent, "%d%%", int((t/500.0)*100.0));
         progress->label(percent);              // update progress bar's label
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

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