diff options
Diffstat (limited to 'src/input_common/gcadapter/gc_adapter.cpp')
| -rw-r--r-- | src/input_common/gcadapter/gc_adapter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp index 6d9f4d9eb..38210ffcb 100644 --- a/src/input_common/gcadapter/gc_adapter.cpp +++ b/src/input_common/gcadapter/gc_adapter.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <chrono> | 5 | #include <chrono> |
| 6 | #include <thread> | 6 | #include <thread> |
| 7 | #include <libusb.h> | ||
| 7 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 8 | #include "input_common/gcadapter/gc_adapter.h" | 9 | #include "input_common/gcadapter/gc_adapter.h" |
| 9 | 10 | ||
| @@ -33,7 +34,7 @@ Adapter::Adapter() { | |||
| 33 | } | 34 | } |
| 34 | } | 35 | } |
| 35 | 36 | ||
| 36 | GCPadStatus Adapter::GetPadStatus(int port, const std::array<u8, 37>& adapter_payload) { | 37 | GCPadStatus Adapter::GetPadStatus(std::size_t port, const std::array<u8, 37>& adapter_payload) { |
| 37 | GCPadStatus pad = {}; | 38 | GCPadStatus pad = {}; |
| 38 | bool get_origin = false; | 39 | bool get_origin = false; |
| 39 | 40 | ||
| @@ -198,7 +199,7 @@ void Adapter::StartScanThread() { | |||
| 198 | } | 199 | } |
| 199 | 200 | ||
| 200 | detect_thread_running = true; | 201 | detect_thread_running = true; |
| 201 | detect_thread = std::thread([=] { ScanThreadFunc(); }); | 202 | detect_thread = std::thread(&Adapter::ScanThreadFunc, this); |
| 202 | } | 203 | } |
| 203 | 204 | ||
| 204 | void Adapter::StopScanThread() { | 205 | void Adapter::StopScanThread() { |
| @@ -227,7 +228,7 @@ void Adapter::Setup() { | |||
| 227 | } | 228 | } |
| 228 | 229 | ||
| 229 | if (devices != nullptr) { | 230 | if (devices != nullptr) { |
| 230 | for (std::size_t index = 0; index < device_count; ++index) { | 231 | for (std::size_t index = 0; index < static_cast<std::size_t>(device_count); ++index) { |
| 231 | if (CheckDeviceAccess(devices[index])) { | 232 | if (CheckDeviceAccess(devices[index])) { |
| 232 | // GC Adapter found and accessible, registering it | 233 | // GC Adapter found and accessible, registering it |
| 233 | GetGCEndpoint(devices[index]); | 234 | GetGCEndpoint(devices[index]); |
| @@ -357,11 +358,11 @@ void Adapter::Reset() { | |||
| 357 | } | 358 | } |
| 358 | } | 359 | } |
| 359 | 360 | ||
| 360 | bool Adapter::DeviceConnected(int port) { | 361 | bool Adapter::DeviceConnected(std::size_t port) { |
| 361 | return adapter_controllers_status[port] != ControllerTypes::None; | 362 | return adapter_controllers_status[port] != ControllerTypes::None; |
| 362 | } | 363 | } |
| 363 | 364 | ||
| 364 | void Adapter::ResetDeviceType(int port) { | 365 | void Adapter::ResetDeviceType(std::size_t port) { |
| 365 | adapter_controllers_status[port] = ControllerTypes::None; | 366 | adapter_controllers_status[port] = ControllerTypes::None; |
| 366 | } | 367 | } |
| 367 | 368 | ||