From 1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2 Mon Sep 17 00:00:00 2001 From: ameerj Date: Fri, 17 Jul 2020 12:10:32 -0400 Subject: std::size_t where appropriate, make error message more clear if can't read --- src/input_common/gcadapter/gc_adapter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/input_common/gcadapter') diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp index 0fc609184..02d06876f 100644 --- a/src/input_common/gcadapter/gc_adapter.cpp +++ b/src/input_common/gcadapter/gc_adapter.cpp @@ -34,7 +34,7 @@ Adapter::Adapter() { GCPadStatus Adapter::GetPadStatus(std::size_t port, const std::array& adapter_payload) { GCPadStatus pad = {}; - const size_t offset = 1 + (9 * port); + const std::size_t offset = 1 + (9 * port); adapter_controllers_status[port] = static_cast(adapter_payload[offset] >> 4); @@ -77,7 +77,7 @@ GCPadStatus Adapter::GetPadStatus(std::size_t port, const std::array& ad } } for (PadAxes axis : axes) { - const int index = static_cast(axis); + const std::size_t index = static_cast(axis); pad.axis_values[index] = adapter_payload[offset + 3 + index]; } @@ -112,7 +112,8 @@ void Adapter::Read() { sizeof(adapter_payload), &payload_size, 16); if (payload_size != sizeof(adapter_payload) || adapter_payload[0] != LIBUSB_DT_HID) { - LOG_ERROR(Input, "error reading payload (size: {}, type: {:02x}) Possible disconnect?", + LOG_ERROR(Input, + "Error reading payload (size: {}, type: {:02x}) Is the adapter connected?", payload_size, adapter_payload[0]); adapter_thread_running = false; // error reading from adapter, stop reading. break; -- cgit v1.2.3