From 0b791a311bef43df929fa9c2c5de8be09f822f34 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 11 Aug 2019 21:53:06 -0230 Subject: [PATCH] Fix minor compile warnings in gcc and clang. --- src/gui/DialogContainer.cxx | 6 +++--- src/gui/DialogContainer.hxx | 5 +---- src/gui/EventMappingWidget.cxx | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index 5700b8ab5..6f1d36fe9 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -287,7 +287,7 @@ void DialogContainer::handleJoyBtnEvent(int stick, int button, bool pressed) { myCurrentButtonDown.stick = stick; myCurrentButtonDown.button = button; - myButtonRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : kRepeatNone); + myButtonRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : _REPEAT_NONE); activeDialog->handleJoyDown(stick, button); } @@ -326,7 +326,7 @@ void DialogContainer::handleJoyAxisEvent(int stick, int axis, int value, int but myCurrentAxisDown.stick = stick; myCurrentAxisDown.axis = axis; myCurrentAxisDown.value = value; - myAxisRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : kRepeatNone); + myAxisRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : _REPEAT_NONE); } activeDialog->handleJoyAxis(stick, axis, value, button); } @@ -352,7 +352,7 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHat value, int bu myCurrentHatDown.stick = stick; myCurrentHatDown.hat = hat; myCurrentHatDown.value = value; - myHatRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : kRepeatNone); + myHatRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : _REPEAT_NONE); } activeDialog->handleJoyHat(stick, hat, value, button); } diff --git a/src/gui/DialogContainer.hxx b/src/gui/DialogContainer.hxx index ec9da824d..e20884481 100644 --- a/src/gui/DialogContainer.hxx +++ b/src/gui/DialogContainer.hxx @@ -180,16 +180,13 @@ class DialogContainer Common::FixedStack myDialogStack; private: - enum { - kRepeatNone = 1 << 24 // loooong - }; - // Indicates the most current time (in milliseconds) as set by updateTime() uInt64 myTime; static uInt64 _DOUBLE_CLICK_DELAY; static uInt64 _REPEAT_INITIAL_DELAY; static uInt64 _REPEAT_SUSTAIN_DELAY; + static constexpr uInt64 _REPEAT_NONE = 1 << 24; // loooong // For continuous 'mouse down' events struct { diff --git a/src/gui/EventMappingWidget.cxx b/src/gui/EventMappingWidget.cxx index 76571bad6..9f977dad1 100644 --- a/src/gui/EventMappingWidget.cxx +++ b/src/gui/EventMappingWidget.cxx @@ -265,7 +265,7 @@ bool EventMappingWidget::handleKeyDown(StellaKey key, StellaMod mod) { // Mod keys are only recorded if no other key has been recorded before if (key < KBDK_LCTRL || key > KBDK_RGUI - || (!myLastKey || myLastKey >= KBDK_LCTRL && myLastKey <= KBDK_RGUI)) + || (!myLastKey || (myLastKey >= KBDK_LCTRL && myLastKey <= KBDK_RGUI))) { myLastKey = key; }