Fix minor warnings.

This commit is contained in:
Stephen Anthony 2022-02-08 20:26:21 -03:30
parent 6832465ad1
commit f7895e53b8
2 changed files with 6 additions and 5 deletions

View File

@ -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);
}

View File

@ -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;