aboutsummaryrefslogtreecommitdiff
path: root/src/input_common/touch_from_button.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-10-15 20:59:34 -0700
committerGitHub <noreply@github.com>2020-10-15 20:59:34 -0700
commite0cc7f3b6e9f7781441aaef163db02c3b4585eab (patch)
tree97a73da4871f006b39eafca3a881ae2ea42f206a /src/input_common/touch_from_button.cpp
parent1ccbb35400222370144b8550faef7f45d6efe85c (diff)
parentd44d662529f7753ab1f20a25cf2e6e536b9cb952 (diff)
Merge pull request #4790 from lioncash/input-common
input_common/CMakeLists: Make some warnings errors
Diffstat (limited to 'src/input_common/touch_from_button.cpp')
-rw-r--r--src/input_common/touch_from_button.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp
index 98da0ef1a7..c37716aaea 100644
--- a/src/input_common/touch_from_button.cpp
+++ b/src/input_common/touch_from_button.cpp
@@ -11,9 +11,11 @@ namespace InputCommon {
class TouchFromButtonDevice final : public Input::TouchDevice {
public:
TouchFromButtonDevice() {
- for (const auto& config_entry :
- Settings::values.touch_from_button_maps[Settings::values.touch_from_button_map_index]
- .buttons) {
+ const auto button_index =
+ static_cast<std::size_t>(Settings::values.touch_from_button_map_index);
+ const auto& buttons = Settings::values.touch_from_button_maps[button_index].buttons;
+
+ for (const auto& config_entry : buttons) {
const Common::ParamPackage package{config_entry};
map.emplace_back(
Input::CreateDevice<Input::ButtonDevice>(config_entry),