diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 22:25:22 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 23:05:21 +0200 |
commit | d65936200a2756e6619a109fa6fa673b91df802e (patch) | |
tree | 80b6b6fc7ba9023cbe47290b8ae1bc5468a19bb1 /dinput/keybinding-worker.cpp | |
parent | 4046773c41ee3c0f65840828ab983cfd13451c85 (diff) |
modernize C++ syntax
No visible changes (hopefully).
Diffstat (limited to 'dinput/keybinding-worker.cpp')
-rw-r--r-- | dinput/keybinding-worker.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp index 40754b4f..0bdc18cd 100644 --- a/dinput/keybinding-worker.cpp +++ b/dinput/keybinding-worker.cpp @@ -47,7 +47,7 @@ bool KeybindingWorker::init() return false; } - if (din->CreateDevice(GUID_SysKeyboard, &dinkeyboard, NULL) != DI_OK) { + if (din->CreateDevice(GUID_SysKeyboard, &dinkeyboard, nullptr) != DI_OK) { qDebug() << "setup CreateDevice function failed!" << GetLastError(); return false; } @@ -55,13 +55,13 @@ bool KeybindingWorker::init() if (dinkeyboard->SetDataFormat(&c_dfDIKeyboard) != DI_OK) { qDebug() << "setup SetDataFormat function failed!" << GetLastError(); dinkeyboard->Release(); - dinkeyboard = 0; + dinkeyboard = nullptr; return false; } if (dinkeyboard->SetCooperativeLevel((HWND) fake_main_window.winId(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) != DI_OK) { dinkeyboard->Release(); - dinkeyboard = 0; + dinkeyboard = nullptr; qDebug() << "setup SetCooperativeLevel function failed!" << GetLastError(); return false; } @@ -77,7 +77,7 @@ bool KeybindingWorker::init() { qDebug() << "setup keyboard buffer mode failed!"; dinkeyboard->Release(); - dinkeyboard = 0; + dinkeyboard = nullptr; return false; } } @@ -85,7 +85,7 @@ bool KeybindingWorker::init() if (dinkeyboard->Acquire() != DI_OK) { dinkeyboard->Release(); - dinkeyboard = 0; + dinkeyboard = nullptr; qDebug() << "setup dinkeyboard Acquire failed!" << GetLastError(); return false; } @@ -112,7 +112,7 @@ void KeybindingWorker::run() { QMutexLocker l(&mtx); - if (receivers.size()) + if (!receivers.empty()) { /* There are some problems reported on various forums * with regard to key-up events. But that's what I dug up: |