From e3bc507ed3b2d89738429bd6ade1a127abf11781 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Jul 2017 03:26:01 +0200 Subject: logic/shortcuts: fix signed vs unsigned comparison --- logic/win32-shortcuts.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/logic/win32-shortcuts.cpp b/logic/win32-shortcuts.cpp index 15e87877..8e53df83 100644 --- a/logic/win32-shortcuts.cpp +++ b/logic/win32-shortcuts.cpp @@ -168,10 +168,9 @@ bool win_key::from_qt(QKeySequence qt_, int& dik, Qt::KeyboardModifiers& mods) const unsigned our_mods = unsigned(qt & Qt::KeyboardModifierMask); { - const auto key_ = qt; - for (auto& wk : windows_key_sequences) + for (const win_key& wk : windows_key_sequences) { - if (wk.qt == key_) + if (unsigned(wk.qt) == qt) { dik = wk.win; mods = Qt::NoModifier; @@ -181,9 +180,9 @@ bool win_key::from_qt(QKeySequence qt_, int& dik, Qt::KeyboardModifiers& mods) } { const unsigned key = qt & ~Qt::KeyboardModifierMask; - for (auto& wk : windows_key_sequences) + for (const win_key& wk : windows_key_sequences) { - if (wk.qt == key) + if (unsigned(wk.qt) == key) { dik = wk.win; mods = static_cast(our_mods); -- cgit v1.2.3