diff options
author | ameerj <aj662@drexel.edu> | 2020-07-17 18:10:32 +0200 |
---|---|---|
committer | ameerj <aj662@drexel.edu> | 2020-07-17 18:10:32 +0200 |
commit | 1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2 (patch) | |
tree | eb2944b429c28d9e6222d853a5084f29d69f4e12 /src/input_common/gcadapter | |
parent | Refactor adapter code (diff) | |
download | yuzu-1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2.tar yuzu-1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2.tar.gz yuzu-1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2.tar.bz2 yuzu-1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2.tar.lz yuzu-1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2.tar.xz yuzu-1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2.tar.zst yuzu-1e7bed0a456a6771377a6ee9c8a45afb4c2b80a2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/input_common/gcadapter/gc_adapter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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<u8, 37>& 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<ControllerTypes>(adapter_payload[offset] >> 4); @@ -77,7 +77,7 @@ GCPadStatus Adapter::GetPadStatus(std::size_t port, const std::array<u8, 37>& ad } } for (PadAxes axis : axes) { - const int index = static_cast<int>(axis); + const std::size_t index = static_cast<std::size_t>(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; |