From 9a7af1110889036fd88914fe49e65c03dbc01784 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 3 Apr 2022 22:30:59 +0200 Subject: Silence compiler warnings [-Wunused-but-set-variable] --- png/pngread.c | 1 + src/Fl_Preferences.cxx | 1 + src/Fl_cocoa.mm | 7 +------ src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx | 2 -- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/png/pngread.c b/png/pngread.c index 8fa7d9f16..bf3c4fb89 100644 --- a/png/pngread.c +++ b/png/pngread.c @@ -3559,6 +3559,7 @@ png_image_read_background(png_voidp argument) } row += display->row_bytes; + (void)row; // FLTK: silence warning: FIXME - remove variable 'row'? } } } diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 27e80564c..d77824ed6 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1427,6 +1427,7 @@ int Fl_Preferences::Node::write( FILE *f ) { fputc( '\n', f ); src += cnt; } + (void)written; // silence warning } else fprintf( f, "%s\n", entry_[i].name ); diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index d978ebfc1..722472eed 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1775,6 +1775,7 @@ void Fl_Cocoa_Screen_Driver::open_display_platform() { // We create a thread that does nothing so it completes very fast: [NSThread detachNewThreadSelector:@selector(doNothing:) toTarget:[FLWindowDelegate singleInstance] withObject:nil]; } + (void)localPool; // silence warning } } @@ -3021,8 +3022,6 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() } int xp = w->x(); int yp = w->y(); - int wp = w->w(); - int hp = w->h(); int xwm = xp, ywm = yp, bt, bx, by; @@ -3040,10 +3039,6 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() winlevel = non_modal_window_level(); } - if (by+bt) { - wp += 2*bx; - hp += 2*by+bt; - } if (force_position()) { if (!Fl::grab()) { xp = xwm; yp = ywm; diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx index f11c2955d..8d826e8fb 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx @@ -33,7 +33,6 @@ extern unsigned fl_cmap[256]; // defined in fl_color.cxx void Fl_Quartz_Graphics_Driver::color(Fl_Color i) { Fl_Graphics_Driver::color(i); - int index; uchar r, g, b; if (i & 0xFFFFFF00) { // translate rgb colors into color index @@ -42,7 +41,6 @@ void Fl_Quartz_Graphics_Driver::color(Fl_Color i) { b = i>> 8; } else { // translate index into rgb: - index = i; unsigned c = fl_cmap[i]; r = c>>24; g = c>>16; -- cgit v1.2.3