WiimoteScannerDarwin: Fix lint

This commit is contained in:
OatmealDome 2021-06-24 17:59:58 -04:00
parent b494d109d4
commit 156ffef98c
5 changed files with 14 additions and 13 deletions

View File

@ -46,8 +46,8 @@ public:
~WiimoteScannerLinux() override; ~WiimoteScannerLinux() override;
bool IsReady() const override; bool IsReady() const override;
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override; void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
void Update() override {} // not needed on Linux void Update() override {} // not needed on Linux
void RequestStopSearching() override {} // not needed on Linux void RequestStopSearching() override {} // not needed on Linux
private: private:
int m_device_id; int m_device_id;
int m_device_sock; int m_device_sock;

View File

@ -25,6 +25,7 @@ public:
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override; void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
void Update() override {} // not needed void Update() override {} // not needed
void RequestStopSearching() override { m_stop_scanning = true; } void RequestStopSearching() override { m_stop_scanning = true; }
private: private:
IOBluetoothHostController* m_host_controller; IOBluetoothHostController* m_host_controller;
bool m_stop_scanning = false; bool m_stop_scanning = false;

View File

@ -27,13 +27,13 @@ WiimoteScannerDarwin::WiimoteScannerDarwin()
if (![m_host_controller addressAsString]) if (![m_host_controller addressAsString])
{ {
WARN_LOG_FMT(WIIMOTE, "No Bluetooth host controller"); WARN_LOG_FMT(WIIMOTE, "No Bluetooth host controller");
[m_host_controller release]; [m_host_controller release];
m_host_controller = nil; m_host_controller = nil;
return; return;
} }
[m_host_controller retain]; [m_host_controller retain];
} }
@ -41,7 +41,7 @@ WiimoteScannerDarwin::~WiimoteScannerDarwin()
{ {
[m_host_controller release]; [m_host_controller release];
m_host_controller = nil; m_host_controller = nil;
m_stop_scanning = true; m_stop_scanning = true;
} }
@ -52,7 +52,7 @@ void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
{ {
return; return;
} }
IOBluetoothDeviceInquiry* bti; IOBluetoothDeviceInquiry* bti;
found_board = nullptr; found_board = nullptr;
@ -66,7 +66,7 @@ void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
{ {
ERROR_LOG_FMT(WIIMOTE, "Unable to do Bluetooth discovery"); ERROR_LOG_FMT(WIIMOTE, "Unable to do Bluetooth discovery");
[sbt release]; [sbt release];
return; return;
} }
@ -98,7 +98,7 @@ void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
found_wiimotes.push_back(wm); found_wiimotes.push_back(wm);
} }
} }
[bti release]; [bti release];
[sbt release]; [sbt release];
} }

View File

@ -38,8 +38,8 @@ public:
~WiimoteScannerHidapi(); ~WiimoteScannerHidapi();
bool IsReady() const override; bool IsReady() const override;
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override; void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
void Update() override {} // not needed for hidapi void Update() override {} // not needed for hidapi
void RequestStopSearching() override {} // not needed for hidapi void RequestStopSearching() override {} // not needed for hidapi
}; };
} // namespace WiimoteReal } // namespace WiimoteReal

View File

@ -545,12 +545,12 @@ void WiimoteScanner::StopThread()
if (m_scan_thread_running.TestAndClear()) if (m_scan_thread_running.TestAndClear())
{ {
SetScanMode(WiimoteScanMode::DO_NOT_SCAN); SetScanMode(WiimoteScanMode::DO_NOT_SCAN);
for (const auto& backend : m_backends) for (const auto& backend : m_backends)
{ {
backend->RequestStopSearching(); backend->RequestStopSearching();
} }
m_scan_thread.join(); m_scan_thread.join();
} }
} }