From 0a1a0e9df00f37a210b67a11cf8f99550cafeeaf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 25 Oct 2018 03:11:42 +0200 Subject: cleanups only --- dinput/keybinding-worker.cpp | 4 ++-- dinput/keybinding-worker.hpp | 3 ++- dinput/win32-joystick.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'dinput') diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp index a16432ae..a3331323 100644 --- a/dinput/keybinding-worker.cpp +++ b/dinput/keybinding-worker.cpp @@ -22,8 +22,8 @@ bool Key::should_process() { if (!enabled || (keycode == 0 && guid == "")) return false; - bool ret = prog1(!held || timer.elapsed_ms() > 100, - timer.start()); + bool ret = !held || timer.elapsed_ms() > 100; + timer.start(); return ret; } diff --git a/dinput/keybinding-worker.hpp b/dinput/keybinding-worker.hpp index 9d067c10..fad9ec7e 100644 --- a/dinput/keybinding-worker.hpp +++ b/dinput/keybinding-worker.hpp @@ -73,9 +73,10 @@ public: class Token { fun* pos; + public: Token(const Token&) = delete; Token& operator=(Token&) = delete; - public: + ~Token() { make().remove_receiver(pos); diff --git a/dinput/win32-joystick.cpp b/dinput/win32-joystick.cpp index 8f2b4085..4da5c57d 100644 --- a/dinput/win32-joystick.cpp +++ b/dinput/win32-joystick.cpp @@ -222,7 +222,7 @@ bool win32_joy_ctx::joy::poll(fn const& f) } } } - else if (i >= 0 && i < max_buttons) + else if ((unsigned)i < max_buttons) { const bool new_value = !!(event.dwData & 0x80); if (last_state[i] != new_value) -- cgit v1.2.3