From f6a93eb06093c61ee8daab9e01ed809573b991c4 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 6 Apr 2022 13:25:17 +0200 Subject: [PATCH] Remove warnings: comparison of integer expressions of different signedness [-Wsign-compare] --- src/Fl_Input.cxx | 12 ++++++------ src/Fl_Message.cxx | 2 +- .../Quartz/Fl_Quartz_Image_Surface_Driver.cxx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 880b7c676..abb9664af 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -428,20 +428,20 @@ int Fl_Input::handle_key() { return 0; // ignore other combos, pass to parent case 'a': - if (mods==FL_COMMAND) return kf_select_all(); // Ctrl-A, Mac:Meta-A (Standard/OSX-HIG) + if ((int)mods==FL_COMMAND) return kf_select_all(); // Ctrl-A, Mac:Meta-A (Standard/OSX-HIG) break; // handle other combos elsewhere case 'c': - if (mods==FL_COMMAND) return kf_copy(); // Ctrl-C, Mac:Meta-C (Standard/OSX-HIG) + if ((int)mods==FL_COMMAND) return kf_copy(); // Ctrl-C, Mac:Meta-C (Standard/OSX-HIG) break; // handle other combos elsewhere case 'v': - if (mods==FL_COMMAND) return kf_paste(); // Ctrl-V, Mac:Meta-V (Standard/OSX-HIG) + if ((int)mods==FL_COMMAND) return kf_paste(); // Ctrl-V, Mac:Meta-V (Standard/OSX-HIG) break; // handle other combos elsewhere case 'x': - if (mods==FL_COMMAND) return kf_copy_cut(); // Ctrl-X, Mac:Meta-X (Standard/OSX-HIG) + if ((int)mods==FL_COMMAND) return kf_copy_cut(); // Ctrl-X, Mac:Meta-X (Standard/OSX-HIG) break; case 'z': - if (mods==FL_COMMAND && !shift) return kf_undo(); // Ctrl-Z, Mac:Meta-Z (Standard/OSX-HIG) - if (mods==FL_COMMAND && shift) return kf_redo(); // Shift-Ctrl-Z, Mac:Shift-Meta-Z (Standard/OSX-HIG) + if ((int)mods==FL_COMMAND && !shift) return kf_undo(); // Ctrl-Z, Mac:Meta-Z (Standard/OSX-HIG) + if ((int)mods==FL_COMMAND && shift) return kf_redo(); // Shift-Ctrl-Z, Mac:Shift-Meta-Z (Standard/OSX-HIG) break; // handle other combos elsewhere } diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx index 06c2e76f6..09dd5692a 100644 --- a/src/Fl_Message.cxx +++ b/src/Fl_Message.cxx @@ -555,7 +555,7 @@ int Fl_Message_Box::handle(int e) { switch (e) { case FL_KEYBOARD: case FL_SHORTCUT: - if (Fl::event_key() == 'c' && mods == FL_COMMAND) { + if (Fl::event_key() == 'c' && (int)mods == FL_COMMAND) { Fl::copy(label(), int(strlen(label())), 1); return 1; } diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index ff18c2626..c638bfb79 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx @@ -62,7 +62,7 @@ void Fl_Quartz_Image_Surface_Driver::set_current() { pre_window = fl_window; driver()->gc(offscreen); fl_window = 0; - ((Fl_Quartz_Graphics_Driver*)driver())->high_resolution( CGBitmapContextGetWidth(offscreen) > width ); + ((Fl_Quartz_Graphics_Driver*)driver())->high_resolution( CGBitmapContextGetWidth(offscreen) > (size_t)width ); } void Fl_Quartz_Image_Surface_Driver::translate(int x, int y) {