mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Turn loops into range-based form
and some things suggested by cppcheck and compiler warnings.
This commit is contained in:
@ -127,8 +127,8 @@ namespace ButtonManager
|
||||
bool pressed = false;
|
||||
pressed = m_buttons[std::make_pair(padID, button)]->Pressed();
|
||||
|
||||
for (auto it = m_controllers.begin(); it != m_controllers.end(); ++it)
|
||||
pressed |= it->second->ButtonValue(padID, button);
|
||||
for (const auto& ctrl : m_controllers)
|
||||
pressed |= ctrl.second->ButtonValue(padID, button);
|
||||
|
||||
return pressed;
|
||||
}
|
||||
@ -172,10 +172,10 @@ namespace ButtonManager
|
||||
}
|
||||
void Shutdown()
|
||||
{
|
||||
for(auto it = m_buttons.begin(); it != m_buttons.end(); ++it)
|
||||
delete it->second;
|
||||
for (auto it = m_controllers.begin(); it != m_controllers.end(); ++it)
|
||||
delete it->second;
|
||||
for (const auto& button : m_buttons)
|
||||
delete button.second;
|
||||
for (const auto& controller : m_controllers)
|
||||
delete controller.second;
|
||||
m_controllers.clear();
|
||||
m_buttons.clear();
|
||||
}
|
||||
|
@ -108,8 +108,8 @@ namespace ButtonManager
|
||||
: _dev(dev) {}
|
||||
~InputDevice()
|
||||
{
|
||||
for (auto it = _binds.begin(); it != _binds.end(); ++it)
|
||||
delete it->second;
|
||||
for (const auto& bind : _binds)
|
||||
delete bind.second;
|
||||
}
|
||||
void AddBind(sBind *bind) { _binds[bind->_buttontype] = bind; _inputbinds[bind->_bind] = bind; }
|
||||
void PressEvent(int button, int action);
|
||||
|
Reference in New Issue
Block a user