From 6911e2470a66b4cf1cfe6f4df400b401945f2e30 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Wed, 12 Aug 2015 21:14:04 +0200 Subject: [PATCH] Merge pull request #2835 from degasus/master Wiimotes: Initialize all atomic globally. --- Source/Core/Core/HW/WiimoteReal/IONix.cpp | 3 +-- Source/Core/Core/HW/WiimoteReal/IOWin.cpp | 2 -- Source/Core/Core/HW/WiimoteReal/IOdarwin.mm | 2 -- Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 1 - Source/Core/Core/HW/WiimoteReal/WiimoteReal.h | 12 ++++++------ 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteReal/IONix.cpp b/Source/Core/Core/HW/WiimoteReal/IONix.cpp index 687a9af3a2..afbaa434b4 100644 --- a/Source/Core/Core/HW/WiimoteReal/IONix.cpp +++ b/Source/Core/Core/HW/WiimoteReal/IONix.cpp @@ -36,8 +36,7 @@ private: }; WiimoteScanner::WiimoteScanner() - : m_want_wiimotes() - , device_id(-1) + : device_id(-1) , device_sock(-1) { // Get the id of the first Bluetooth device. diff --git a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp index b41c02ca66..4f9402e2ac 100644 --- a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp +++ b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp @@ -220,8 +220,6 @@ void RemoveWiimote(BLUETOOTH_DEVICE_INFO_STRUCT&); bool ForgetWiimote(BLUETOOTH_DEVICE_INFO_STRUCT&); WiimoteScanner::WiimoteScanner() - : m_run_thread() - , m_want_wiimotes() { init_lib(); } diff --git a/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm index 253c93b5a2..9da63d93d6 100644 --- a/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm +++ b/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm @@ -46,8 +46,6 @@ private: }; WiimoteScanner::WiimoteScanner() - : m_run_thread() - , m_want_wiimotes() {} WiimoteScanner::~WiimoteScanner() diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 7bbd3d75bd..188f1d4ea8 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -42,7 +42,6 @@ Wiimote::Wiimote() , m_last_input_report() , m_channel(0) , m_rumble_state() - , m_need_prepare() {} void Wiimote::Shutdown() diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h index 2047314392..946236ec60 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h @@ -97,11 +97,11 @@ private: std::thread m_wiimote_thread; // Whether to keep running the thread. - std::atomic m_run_thread; + std::atomic m_run_thread {false}; // Whether to call PrepareOnThread. - std::atomic m_need_prepare; + std::atomic m_need_prepare {false}; // Whether the thread has finished ConnectInternal. - std::atomic m_thread_ready; + std::atomic m_thread_ready {false}; std::mutex m_thread_ready_mutex; std::condition_variable m_thread_ready_cond; @@ -135,9 +135,9 @@ private: std::thread m_scan_thread; - std::atomic m_run_thread; - std::atomic m_want_wiimotes; - std::atomic m_want_bb; + std::atomic m_run_thread {false}; + std::atomic m_want_wiimotes {false}; + std::atomic m_want_bb {false}; #if defined(_WIN32) void CheckDeviceType(std::basic_string &devicepath, bool &real_wiimote, bool &is_bb);