From 2e6a4eb69a80d57770b462af55f0c3c722c219d7 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 15 Dec 2018 13:27:39 +0100 Subject: Fix clang-tidy unused variable warning (issue #5, part 3). https://github.com/fltk/fltk/issues/5 --- src/drivers/X11/Fl_X11_Screen_Driver.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index d305e81ee..b21079ab6 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -1239,9 +1239,9 @@ static bool use_monitors_xml(float &factor) { FILE *in = fopen(path, "r"); if (!in) return false; p = fgets(line, sizeof(line), in); - if (strstr(line, "")) { + if (p && strstr(line, "")) { while (fgets(line, sizeof(line), in)) { - if( (p = strstr(line, "")) && strstr(p, "") ) { + if ( (p = strstr(line, "")) && strstr(p, "") ) { p += 7; sscanf(p, "%f", &factor); if (factor == 2) { found = true; break; } -- cgit v1.2.3 From 59cd39a50531c255cb1855fb9133529872ee115c Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 16 Dec 2018 13:13:46 +0100 Subject: Fix another clang-tidy warning (issue #5, part 1). See https://github.com/fltk/fltk/issues/5 As Manolo pointed out the questionable variable was not used (read) in this case of the switch statement, hence it can be removed. --- src/drivers/X11/Fl_X11_Screen_Driver.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index b21079ab6..34310a8dc 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -968,10 +968,8 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int line_ptr[2] = cvals[i][2]; if (index_shift > 0) { - index_mask >>= 2; index_shift -= 2; } else { - index_mask = 192; index_shift = 6; pixel ++; } -- cgit v1.2.3