diff options
| author | Anthony <Helios747@users.noreply.github.com> | 2017-02-12 01:21:44 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-12 01:21:44 -0800 |
| commit | 7d36f1a7aa38394d0a15b7eef4e88522b7bcae9d (patch) | |
| tree | d2b72489e1c455ddf2993a98d5d19c07fdf93ba9 /Source/Core/InputCommon/ControllerEmu/ControlGroup | |
| parent | 0e961776e68c66b2e05f01291ff455b814dec645 (diff) | |
| parent | 1a99e70ed78acb30719eb3c11f8f2e71185e89b4 (diff) | |
Merge pull request #4899 from lioncash/array
ControlGroup: Use std::array for Force and Tilt groups
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup')
4 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp index 29413ada2c..fba3fb6097 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp @@ -5,7 +5,6 @@ #include "InputCommon/ControllerEmu/ControlGroup/Force.h" #include <cmath> -#include <cstring> #include <memory> #include <string> @@ -19,8 +18,6 @@ namespace ControllerEmu { Force::Force(const std::string& name_) : ControlGroup(name_, GROUP_TYPE_FORCE) { - memset(m_swing, 0, sizeof(m_swing)); - controls.emplace_back(std::make_unique<Input>(_trans("Up"))); controls.emplace_back(std::make_unique<Input>(_trans("Down"))); controls.emplace_back(std::make_unique<Input>(_trans("Left"))); diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.h index 767009a1f8..f640b0d3b2 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.h +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.h @@ -4,6 +4,7 @@ #pragma once +#include <array> #include <string> #include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" @@ -17,6 +18,6 @@ public: void GetState(ControlState* axis); private: - ControlState m_swing[3]; + std::array<ControlState, 3> m_swing{}; }; } // namespace ControllerEmu diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp index 5481d92606..1aaeab15e0 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp @@ -6,7 +6,6 @@ #include <algorithm> #include <cmath> -#include <cstring> #include <memory> #include <string> @@ -19,8 +18,6 @@ namespace ControllerEmu { Tilt::Tilt(const std::string& name_) : ControlGroup(name_, GROUP_TYPE_TILT) { - memset(m_tilt, 0, sizeof(m_tilt)); - controls.emplace_back(std::make_unique<Input>("Forward")); controls.emplace_back(std::make_unique<Input>("Backward")); controls.emplace_back(std::make_unique<Input>("Left")); diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h index 940d7d9722..78884f41ab 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h @@ -4,6 +4,7 @@ #pragma once +#include <array> #include <string> #include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" @@ -17,6 +18,6 @@ public: void GetState(ControlState* x, ControlState* y, bool step = true); private: - ControlState m_tilt[2]; + std::array<ControlState, 2> m_tilt{}; }; } // namespace ControllerEmu |
