diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-05-01 19:14:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 19:14:07 +0200 |
commit | de97339a2d66cc9e3bd9ab77dd4e0c5c6534a869 (patch) | |
tree | 90a5f1949ce557c33e5f97147d4021c96500dadd /main | |
parent | c9abe88110abdc51bf520cd9af95e59374f7c0cc (diff) | |
parent | bf7ca623a65f25cc4ac7a3ca0d6635331ec07c25 (diff) |
Merge pull request #18291 from akien-mga/coverity-uninitialized-scalar-var
Fix Coverity reports of uninitialized scalar variable
Diffstat (limited to 'main')
-rw-r--r-- | main/input_default.cpp | 4 | ||||
-rw-r--r-- | main/input_default.h | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 3c40be5082..de7f8ebb4d 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -194,8 +194,6 @@ void InputDefault::joy_connection_changed(int p_idx, bool p_connected, String p_ Joypad js; js.name = p_connected ? p_name : ""; js.uid = p_connected ? p_guid : ""; - js.mapping = -1; - js.hat_current = 0; if (p_connected) { @@ -797,12 +795,12 @@ InputDefault::JoyEvent InputDefault::_find_to_event(String p_to) { JoyEvent ret; ret.type = -1; + ret.index = 0; int i = 0; while (buttons[i]) { if (p_to == buttons[i]) { - //printf("mapping button %s\n", buttons[i]); ret.type = TYPE_BUTTON; ret.index = i; ret.value = 0; diff --git a/main/input_default.h b/main/input_default.h index 6dd88cd31e..8a65303df3 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -97,7 +97,6 @@ class InputDefault : public Input { int hat_current; Joypad() { - for (int i = 0; i < JOY_AXIS_MAX; i++) { last_axis[i] = 0.0f; @@ -110,6 +109,7 @@ class InputDefault : public Input { last_hat = HAT_MASK_CENTER; filter = 0.01f; mapping = -1; + hat_current = 0; } }; |