From b6717a4b9a1648c3836bdd4e9132e72a6832bfba Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 26 Mar 2020 12:30:33 -0230 Subject: [PATCH] Fix some minor warnings from Clang. --- src/emucore/Paddles.cxx | 3 ++- src/emucore/Paddles.hxx | 6 +++--- src/gui/InputDialog.cxx | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index eb6171411..31ba8875d 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -400,7 +400,8 @@ void Paddles::setAnalogYCenter(int ycenter) float Paddles::setAnalogSensitivity(int sensitivity) { // BASE_ANALOG_SENSE * (1.1 ^ 20) = 1.0 - SENSITIVITY = BASE_ANALOG_SENSE * std::pow(1.1, BSPF::clamp(sensitivity, 0, MAX_ANALOG_SENSE)); + SENSITIVITY = BASE_ANALOG_SENSE * std::pow(1.1F, + static_cast(BSPF::clamp(sensitivity, 0, MAX_ANALOG_SENSE))); return SENSITIVITY; } diff --git a/src/emucore/Paddles.hxx b/src/emucore/Paddles.hxx index 7628e840c..57acda958 100644 --- a/src/emucore/Paddles.hxx +++ b/src/emucore/Paddles.hxx @@ -48,7 +48,7 @@ class Paddles : public Controller virtual ~Paddles() = default; public: - static constexpr float BASE_ANALOG_SENSE = 0.148643628f; + static constexpr float BASE_ANALOG_SENSE = 0.148643628F; static constexpr int MAX_ANALOG_SENSE = 30; static constexpr int MIN_ANALOG_CENTER = -10; static constexpr int MAX_ANALOG_CENTER = 30; @@ -95,14 +95,14 @@ class Paddles : public Controller /** Sets the x-center for analog paddles. - @param center Value from -10 to 30, representing the center offset/860 + @param xcenter Value from -10 to 30, representing the center offset/860 */ static void setAnalogXCenter(int xcenter); /** Sets the y-center for analog paddles. - @param center Value from -10 to 30, representing the center offset/860 + @param ycenter Value from -10 to 30, representing the center offset/860 */ static void setAnalogYCenter(int ycenter); diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 5b34d1800..5931ed44a 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -229,8 +229,7 @@ void InputDialog::addDevicePortTab() void InputDialog::addMouseTab() { const int lineHeight = _font.getLineHeight(), - fontWidth = _font.getMaxCharWidth(), - fontHeight = _font.getFontHeight(); + fontWidth = _font.getMaxCharWidth(); int ypos, lwidth, pwidth, tabID; WidgetArray wid; VariantList items; @@ -607,7 +606,7 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, break; case kPSpeedChanged: - myPaddleSpeed->setValueLabel(Paddles::setAnalogSensitivity(myPaddleSpeed->getValue()) * 100.0 + 0.5); + myPaddleSpeed->setValueLabel(Paddles::setAnalogSensitivity(myPaddleSpeed->getValue()) * 100.F + 0.5F); break; case kDejitterAvChanged: