aboutsummaryrefslogtreecommitdiff
path: root/src/input_common/gcadapter/gc_adapter.cpp
diff options
context:
space:
mode:
authorAmeer <aj662@drexel.edu>2020-07-14 13:04:02 -0400
committerAmeer <aj662@drexel.edu>2020-07-14 13:04:02 -0400
commit93fe982a0c3a5bfb7fa5df97ebced0a7692ccaf3 (patch)
treec4ab9e3acff296733b00effd85371bf04db6491f /src/input_common/gcadapter/gc_adapter.cpp
parent042c6602a057c990bf2eeec31b88c48e987050c7 (diff)
parente2730372b8b26bf3141bf91107f9982e270f751b (diff)
Rebase to master
Diffstat (limited to 'src/input_common/gcadapter/gc_adapter.cpp')
-rw-r--r--src/input_common/gcadapter/gc_adapter.cpp11
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 05607e0334..898a278a9b 100644
--- a/src/input_common/gcadapter/gc_adapter.cpp
+++ b/src/input_common/gcadapter/gc_adapter.cpp
@@ -4,6 +4,7 @@
#include <chrono>
#include <thread>
+#include <libusb.h>
#include "common/logging/log.h"
#include "input_common/gcadapter/gc_adapter.h"
@@ -34,7 +35,7 @@ Adapter::Adapter() {
}
}
-GCPadStatus Adapter::GetPadStatus(int port, const std::array<u8, 37>& adapter_payload) {
+GCPadStatus Adapter::GetPadStatus(std::size_t port, const std::array<u8, 37>& adapter_payload) {
GCPadStatus pad = {};
ControllerTypes type = ControllerTypes(adapter_payload[1 + (9 * port)] >> 4);
@@ -205,7 +206,7 @@ void Adapter::StartScanThread() {
}
detect_thread_running = true;
- detect_thread = std::thread([=] { ScanThreadFunc(); });
+ detect_thread = std::thread(&Adapter::ScanThreadFunc, this);
}
void Adapter::StopScanThread() {
@@ -234,7 +235,7 @@ void Adapter::Setup() {
}
if (devices != nullptr) {
- for (std::size_t index = 0; index < device_count; ++index) {
+ for (std::size_t index = 0; index < static_cast<std::size_t>(device_count); ++index) {
if (CheckDeviceAccess(devices[index])) {
// GC Adapter found and accessible, registering it
GetGCEndpoint(devices[index]);
@@ -368,11 +369,11 @@ void Adapter::Reset() {
}
}
-bool Adapter::DeviceConnected(int port) {
+bool Adapter::DeviceConnected(std::size_t port) {
return adapter_controllers_status[port] != ControllerTypes::None;
}
-void Adapter::ResetDeviceType(int port) {
+void Adapter::ResetDeviceType(std::size_t port) {
adapter_controllers_status[port] = ControllerTypes::None;
}