summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-03 22:32:44 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-03 22:32:44 +0100
commitfc9d0a76f47e97f2bdd35edc24695c95654a2a67 (patch)
tree175759910b26b61259728c357a2e3d980b8c2b83 /opentrack
parent35e959cf6836522d1d0e4506a9756470c9e904ee (diff)
api/joy: there's no joy_handle == nullptr case, don't check for it
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/win32-joystick.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/opentrack/win32-joystick.cpp b/opentrack/win32-joystick.cpp
index cd3502b4..1c658c75 100644
--- a/opentrack/win32-joystick.cpp
+++ b/opentrack/win32-joystick.cpp
@@ -51,7 +51,7 @@ bool win32_joy_ctx::poll_axis(const QString &guid, int axes[])
auto iter = joys().find(guid);
- if (iter == joys().end() || iter->second->joy_handle == nullptr)
+ if (iter == joys().end())
return false;
auto& j = iter->second;
@@ -172,9 +172,6 @@ bool win32_joy_ctx::joy::poll(fn f)
HRESULT hr;
bool ok = false;
- if (joy_handle == nullptr)
- return false;
-
(void) joy_handle->Acquire();
if (!FAILED(joy_handle->Poll()))
@@ -252,7 +249,7 @@ win32_joy_ctx::enum_state::EnumJoysticksCallback(const DIDEVICEINSTANCE *pdidIns
const QString name = QString(pdidInstance->tszInstanceName);
auto it = state.joys.find(guid);
- const bool exists = it != state.joys.end() && it->second->joy_handle != nullptr;
+ const bool exists = it != state.joys.end();
state.all.push_back(guid);