static analysis: suspicious code

This commit is contained in:
Megamouse 2025-03-04 19:44:39 +01:00
parent 7a6a96254c
commit 4f52c67566

View file

@ -77,7 +77,7 @@ bool mm_joystick_handler::Init()
m_devices.clear();
m_max_devices = joyGetNumDevs();
if (m_max_devices <= 0)
if (!m_max_devices)
{
input_log.error("mmjoy: Driver doesn't support Joysticks");
return false;
@ -408,7 +408,7 @@ std::unordered_map<u64, u16> mm_joystick_handler::GetButtonValues(const JOYINFOE
if (entry.first == NO_BUTTON)
continue;
button_values.emplace(entry.first, js_info.dwButtons & entry.first ? 255 : 0);
button_values.emplace(entry.first, (js_info.dwButtons & entry.first) ? 255 : 0);
}
if (js_caps.wCaps & JOYCAPS_HASPOV)