summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2019-03-18 11:32:49 -0400
committerGravatar Lioncash2019-03-18 11:40:38 -0400
commiteb335f51ca15774330219a9c65778db39cdebac1 (patch)
tree80b2280dbfadad42b685f7e9eda7ef8bd479b689
parentinput_common/sdl: Use a type alias to shorten declaration of GetPollers (diff)
downloadyuzu-eb335f51ca15774330219a9c65778db39cdebac1.tar.gz
yuzu-eb335f51ca15774330219a9c65778db39cdebac1.tar.xz
yuzu-eb335f51ca15774330219a9c65778db39cdebac1.zip
input_common/sdl: Correct return values within implementations of GetPollers()
In both cases, we weren't actually returning anything, which is undefined behavior.
-rw-r--r--src/input_common/sdl/sdl.h4
-rw-r--r--src/input_common/sdl/sdl_impl.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/input_common/sdl/sdl.h b/src/input_common/sdl/sdl.h
index 940ca7f1b..d7f24c68a 100644
--- a/src/input_common/sdl/sdl.h
+++ b/src/input_common/sdl/sdl.h
@@ -34,7 +34,9 @@ public:
34 34
35class NullState : public State { 35class NullState : public State {
36public: 36public:
37 Pollers GetPollers(Polling::DeviceType type) override {} 37 Pollers GetPollers(Polling::DeviceType type) override {
38 return {};
39 }
38}; 40};
39 41
40std::unique_ptr<State> Init(); 42std::unique_ptr<State> Init();
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index f44a4a332..b132d77f5 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -652,6 +652,7 @@ private:
652 652
653SDLState::Pollers SDLState::GetPollers(InputCommon::Polling::DeviceType type) { 653SDLState::Pollers SDLState::GetPollers(InputCommon::Polling::DeviceType type) {
654 Pollers pollers; 654 Pollers pollers;
655
655 switch (type) { 656 switch (type) {
656 case InputCommon::Polling::DeviceType::Analog: 657 case InputCommon::Polling::DeviceType::Analog:
657 pollers.emplace_back(std::make_unique<Polling::SDLAnalogPoller>(*this)); 658 pollers.emplace_back(std::make_unique<Polling::SDLAnalogPoller>(*this));
@@ -659,8 +660,9 @@ SDLState::Pollers SDLState::GetPollers(InputCommon::Polling::DeviceType type) {
659 case InputCommon::Polling::DeviceType::Button: 660 case InputCommon::Polling::DeviceType::Button:
660 pollers.emplace_back(std::make_unique<Polling::SDLButtonPoller>(*this)); 661 pollers.emplace_back(std::make_unique<Polling::SDLButtonPoller>(*this));
661 break; 662 break;
662 return pollers;
663 } 663 }
664
665 return pollers;
664} 666}
665 667
666} // namespace SDL 668} // namespace SDL