summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-05-27 11:50:57 -0700
committerGravatar Yuri Kunde Schlesner2015-05-27 11:50:57 -0700
commit3c47522e67ab80f69b29969ff2027cf5f8181c8c (patch)
tree17f8e8f42c181af07f34bfc21240b139890a34e4 /src
parentMerge pull request #826 from lioncash/tables (diff)
parenthid: Get rid of undefined behavior (diff)
downloadyuzu-3c47522e67ab80f69b29969ff2027cf5f8181c8c.tar.gz
yuzu-3c47522e67ab80f69b29969ff2027cf5f8181c8c.tar.xz
yuzu-3c47522e67ab80f69b29969ff2027cf5f8181c8c.zip
Merge pull request #828 from lioncash/seq
hid: Get rid of undefined behavior
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/hid/hid.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 2d2133b2e..feac53816 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -58,7 +58,7 @@ void Update() {
58 58
59 mem->pad.current_state.hex = state.hex; 59 mem->pad.current_state.hex = state.hex;
60 mem->pad.index = next_pad_index; 60 mem->pad.index = next_pad_index;
61 ++next_touch_index %= mem->pad.entries.size(); 61 next_touch_index = (next_touch_index + 1) % mem->pad.entries.size();
62 62
63 // Get the previous Pad state 63 // Get the previous Pad state
64 u32 last_entry_index = (mem->pad.index - 1) % mem->pad.entries.size(); 64 u32 last_entry_index = (mem->pad.index - 1) % mem->pad.entries.size();
@@ -88,7 +88,7 @@ void Update() {
88 } 88 }
89 89
90 mem->touch.index = next_touch_index; 90 mem->touch.index = next_touch_index;
91 ++next_touch_index %= mem->touch.entries.size(); 91 next_touch_index = (next_touch_index + 1) % mem->touch.entries.size();
92 92
93 // Get the current touch entry 93 // Get the current touch entry
94 TouchDataEntry* touch_entry = &mem->touch.entries[mem->touch.index]; 94 TouchDataEntry* touch_entry = &mem->touch.entries[mem->touch.index];