FLTK logo

[master] c0f5080 - Fix compiler warnings [-Wunused-variable]

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] c0f5080 - Fix compiler warnings [-Wunused-variable] "Albrecht Schlosser" Jan 21, 2022  
 
commit c0f5080cb056919e898ac572e72fd62568dc307a
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Fri Jan 21 13:38:26 2022 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Fri Jan 21 13:38:26 2022 +0100

    Fix compiler warnings [-Wunused-variable]
    
    ... and missing return value [-Wreturn-type]

 src/drivers/X11/Fl_X11_System_Driver.cxx |  2 ++
 test/coordinates.cxx                     | 16 ++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git src/drivers/X11/Fl_X11_System_Driver.cxx src/drivers/X11/Fl_X11_System_Driver.cxx
index 2f3656a..9ffae3d 100644
--- src/drivers/X11/Fl_X11_System_Driver.cxx
+++ src/drivers/X11/Fl_X11_System_Driver.cxx
@@ -113,6 +113,7 @@ int Fl_X11_System_Driver::clocale_snprintf(char *output, size_t output_size, con
   int retval = vsnprintf(output, output_size, format, args);
   setlocale(LC_NUMERIC, saved_locale);
 #endif
+  return retval;
 }
 
 int Fl_X11_System_Driver::clocale_sscanf(const char *input, const char *format, va_list args) {
@@ -128,6 +129,7 @@ int Fl_X11_System_Driver::clocale_sscanf(const char *input, const char *format,
   int retval = vsscanf(input, format, args);
   setlocale(LC_NUMERIC, saved_locale);
 #endif
+  return retval;
 }
 
 // Find a program in the path...
diff --git test/coordinates.cxx test/coordinates.cxx
index 472bae1..bb3651d 100644
--- test/coordinates.cxx
+++ test/coordinates.cxx
@@ -48,33 +48,33 @@ public:
 
     Fl_Window* tl_window = new Fl_Window(0, 0, 250, 100);
     tl_window->box(FL_ENGRAVED_BOX);
-    Title* tl_title = new Title(10, 10, 230, 40, FL_RED,
+    /* Title* tl_title = */ new Title(10, 10, 230, 40, FL_RED,
       "Fl_Window TL(0, 0, 250, 100)\nx, y relative to main window");
-    Box* tl_box = new Box(25, 50, 200, 40, FL_RED,
+    /* Box* tl_box = */ new Box(25, 50, 200, 40, FL_RED,
       "Fl_Box tl(25, 50, 200, 40)\nx, y relative to TL window");
     tl_window->end();
 
     Fl_Window* br_window = new Fl_Window(250, 100, 250, 100);
     br_window->box(FL_ENGRAVED_BOX);
-    Title* br_title = new Title(10, 10, 230, 40, FL_MAGENTA,
+    /* Title* br_title = */ new Title(10, 10, 230, 40, FL_MAGENTA,
       "Fl_Window BR(250, 100, 250, 100)\nx, y relative to main window");
-    Box* br_box = new Box(25, 50, 200, 40, FL_MAGENTA,
+    /* Box* br_box = */ new Box(25, 50, 200, 40, FL_MAGENTA,
       "Fl_Box br(25, 50, 200, 40)\nx, y relative to BR window");
     br_window->end();
 
     Fl_Group* tr_group = new Fl_Group(250, 0, 250, 100);
     tr_group->box(FL_ENGRAVED_BOX);
-    Title* tr_title = new Title(260, 10, 230, 40, FL_BLUE,
+    /* Title* tr_title = */ new Title(260, 10, 230, 40, FL_BLUE,
       "Fl_Group TR(250, 0, 250, 100)\nx, y relative to main window");
-    Box* tr_box = new Box(275, 50, 200, 40, FL_BLUE,
+    /* Box* tr_box = */ new Box(275, 50, 200, 40, FL_BLUE,
       "Fl_Box tr(275, 50, 200, 40)\nx, y relative to main window");
     tr_group->end();
 
     Fl_Group* bl_group = new Fl_Group(0, 100, 250, 100);
     bl_group->box(FL_ENGRAVED_BOX);
-    Title* bl_title = new Title(10, 110, 230, 40, FL_BLACK,
+    /* Title* bl_title = */ new Title(10, 110, 230, 40, FL_BLACK,
       "Fl_Group BL(0, 100, 250, 100)\nx, y relative to main window");
-    Box* bl_box = new Box(25, 150, 200, 40, FL_BLACK,
+    /* Box* bl_box = */ new Box(25, 150, 200, 40, FL_BLACK,
       "Fl_Box bl(25, 150, 200, 40)\nx, y relative to main window");
     bl_group->end();
 
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'.