From 9ce6ea648f7cb51f5411d3e0753ef9a3439381c5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 12 Jul 2020 15:36:27 -0400 Subject: gc_adapter: Silence sign conversion warnings --- src/input_common/gcadapter/gc_adapter.cpp | 8 ++++---- src/input_common/gcadapter/gc_adapter.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/input_common') diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp index 6d9f4d9eb..9fa170711 100644 --- a/src/input_common/gcadapter/gc_adapter.cpp +++ b/src/input_common/gcadapter/gc_adapter.cpp @@ -33,7 +33,7 @@ Adapter::Adapter() { } } -GCPadStatus Adapter::GetPadStatus(int port, const std::array& adapter_payload) { +GCPadStatus Adapter::GetPadStatus(std::size_t port, const std::array& adapter_payload) { GCPadStatus pad = {}; bool get_origin = false; @@ -227,7 +227,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(device_count); ++index) { if (CheckDeviceAccess(devices[index])) { // GC Adapter found and accessible, registering it GetGCEndpoint(devices[index]); @@ -357,11 +357,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; } diff --git a/src/input_common/gcadapter/gc_adapter.h b/src/input_common/gcadapter/gc_adapter.h index b1c2a1958..250c2275a 100644 --- a/src/input_common/gcadapter/gc_adapter.h +++ b/src/input_common/gcadapter/gc_adapter.h @@ -104,7 +104,7 @@ public: const std::array& GetPadState() const; private: - GCPadStatus GetPadStatus(int port, const std::array& adapter_payload); + GCPadStatus GetPadStatus(std::size_t port, const std::array& adapter_payload); void PadToState(const GCPadStatus& pad, GCState& state); @@ -117,10 +117,10 @@ private: void StopScanThread(); /// Returns true if there is a device connected to port - bool DeviceConnected(int port); + bool DeviceConnected(std::size_t port); /// Resets status of device connected to port - void ResetDeviceType(int port); + void ResetDeviceType(std::size_t port); /// Returns true if we successfully gain access to GC Adapter bool CheckDeviceAccess(libusb_device* device); -- cgit v1.2.3