summaryrefslogtreecommitdiff
path: root/src/input_common/helpers/joycon_protocol/poller.cpp
diff options
context:
space:
mode:
authorGravatar german772023-01-13 23:29:05 -0600
committerGravatar Narr the Reg2023-01-20 00:51:45 -0600
commit340f15d1fa79594dbe12a6e19140ba012751b533 (patch)
tree7a9ef54a17f927e4b8cf98dd32dd6d41c0d75201 /src/input_common/helpers/joycon_protocol/poller.cpp
parentcore: hid: Only set the polling mode to the correct side (diff)
downloadyuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.gz
yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.xz
yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.zip
input_common: Address byte review
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/poller.cpp')
-rw-r--r--src/input_common/helpers/joycon_protocol/poller.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/input_common/helpers/joycon_protocol/poller.cpp b/src/input_common/helpers/joycon_protocol/poller.cpp
index 940b20b7f..7f8e093fa 100644
--- a/src/input_common/helpers/joycon_protocol/poller.cpp
+++ b/src/input_common/helpers/joycon_protocol/poller.cpp
@@ -224,9 +224,9 @@ void JoyconPoller::UpdatePasiveLeftPadInput(const InputReportPassive& input) {
224 Joycon::PasivePadButton::StickL, 224 Joycon::PasivePadButton::StickL,
225 }; 225 };
226 226
227 for (std::size_t i = 0; i < left_buttons.size(); ++i) { 227 for (auto left_button : left_buttons) {
228 const bool button_status = (input.button_input & static_cast<u32>(left_buttons[i])) != 0; 228 const bool button_status = (input.button_input & static_cast<u32>(left_button)) != 0;
229 const int button = static_cast<int>(left_buttons[i]); 229 const int button = static_cast<int>(left_button);
230 callbacks.on_button_data(button, button_status); 230 callbacks.on_button_data(button, button_status);
231 } 231 }
232} 232}
@@ -241,9 +241,9 @@ void JoyconPoller::UpdatePasiveRightPadInput(const InputReportPassive& input) {
241 Joycon::PasivePadButton::StickR, 241 Joycon::PasivePadButton::StickR,
242 }; 242 };
243 243
244 for (std::size_t i = 0; i < right_buttons.size(); ++i) { 244 for (auto right_button : right_buttons) {
245 const bool button_status = (input.button_input & static_cast<u32>(right_buttons[i])) != 0; 245 const bool button_status = (input.button_input & static_cast<u32>(right_button)) != 0;
246 const int button = static_cast<int>(right_buttons[i]); 246 const int button = static_cast<int>(right_button);
247 callbacks.on_button_data(button, button_status); 247 callbacks.on_button_data(button, button_status);
248 } 248 }
249} 249}
@@ -259,9 +259,9 @@ void JoyconPoller::UpdatePasiveProPadInput(const InputReportPassive& input) {
259 Joycon::PasivePadButton::StickL, Joycon::PasivePadButton::StickR, 259 Joycon::PasivePadButton::StickL, Joycon::PasivePadButton::StickR,
260 }; 260 };
261 261
262 for (std::size_t i = 0; i < pro_buttons.size(); ++i) { 262 for (auto pro_button : pro_buttons) {
263 const bool button_status = (input.button_input & static_cast<u32>(pro_buttons[i])) != 0; 263 const bool button_status = (input.button_input & static_cast<u32>(pro_button)) != 0;
264 const int button = static_cast<int>(pro_buttons[i]); 264 const int button = static_cast<int>(pro_button);
265 callbacks.on_button_data(button, button_status); 265 callbacks.on_button_data(button, button_status);
266 } 266 }
267} 267}