From cf1bca29adb02cda27b70f547cf817e23c418af2 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Tue, 8 Feb 2022 20:26:21 -0330 Subject: [PATCH] Fix minor warnings. --- src/debugger/gui/CartEnhancedWidget.cxx | 4 ++-- src/emucore/Driving.cxx | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/debugger/gui/CartEnhancedWidget.cxx b/src/debugger/gui/CartEnhancedWidget.cxx index 384df429c..8f9eb08cd 100644 --- a/src/debugger/gui/CartEnhancedWidget.cxx +++ b/src/debugger/gui/CartEnhancedWidget.cxx @@ -331,14 +331,14 @@ void CartridgeEnhancedWidget::loadConfig() ostringstream buf; ByteArray arr = myCart.myPlusROM->getSend(); - for(int i = 0; i < arr.size(); ++i) + for(size_t i = 0; i < arr.size(); ++i) buf << Common::Base::HEX2 << int(arr[i]) << " "; myPlusROMSendWidget->setText(buf.str(), arr != myOldState.send); buf.str(""); arr = myCart.myPlusROM->getReceive(); - for(int i = 0; i < arr.size(); ++i) + for(size_t i = 0; i < arr.size(); ++i) buf << Common::Base::HEX2 << int(arr[i]) << " "; myPlusROMReceiveWidget->setText(buf.str(), arr != myOldState.receive); } diff --git a/src/emucore/Driving.cxx b/src/emucore/Driving.cxx index 32d94c7f3..50b118dc9 100644 --- a/src/emucore/Driving.cxx +++ b/src/emucore/Driving.cxx @@ -123,7 +123,8 @@ void Driving::updateControllerAxes() // Analog events (from joystick axes) int a_axis = myEvent.get(myAnalogEvent); - if( abs(a_axis) > Controller::analogDeadZone()) { + if( abs(a_axis) > Controller::analogDeadZone()) + { /* a_axis is in -2^15 to +2^15-1; adding 1 when non-negative and dividing by 2^9 gives us -2^6 to +2^6, which gives us the same range as digital inputs. @@ -132,7 +133,7 @@ void Driving::updateControllerAxes() } // Only consider the lower-most bits (corresponding to pins 1 & 2) - myGrayIndex = Int32((myCounterHires / 256.0) * SENSITIVITY) & 0b11; + myGrayIndex = Int32((myCounterHires / 256.0F) * SENSITIVITY) & 0b11; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -240,4 +241,4 @@ void Driving::setSensitivity(int sensitivity) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -float Driving::SENSITIVITY = 1.0; +float Driving::SENSITIVITY = 1.0F;