VERY experimental Nintendo Switch 2 emulator
C++
input_common/sdl: Use a type alias to shorten declaration of GetPollers
Lioncashae7b53779257
diff --git a/src/input_common/sdl/sdl.h b/src/input_common/sdl/sdl.hindex 02a8d2e2c9..940ca7f1ba 100644--- a/src/input_common/sdl/sdl.h+++ b/src/input_common/sdl/sdl.h@@ -24,17 +24,17 @@ namespace InputCommon::SDL {class State {public:- /// Unresisters SDL device factories and shut them down.+ using Pollers = std::vector<std::unique_ptr<Polling::DevicePoller>>;++ /// Unregisters SDL device factories and shut them down.virtual ~State() = default;- virtual std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(- InputCommon::Polling::DeviceType type) = 0;+ virtual Pollers GetPollers(Polling::DeviceType type) = 0;};class NullState : public State {public:- std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(- InputCommon::Polling::DeviceType type) override {}+ Pollers GetPollers(Polling::DeviceType type) override {}};std::unique_ptr<State> Init();diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cppindex 6e83765495..f44a4a3321 100644--- a/src/input_common/sdl/sdl_impl.cpp+++ b/src/input_common/sdl/sdl_impl.cpp@@ -650,9 +650,8 @@ private:};} // namespace Polling-std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> SDLState::GetPollers(- InputCommon::Polling::DeviceType type) {- std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> pollers;+SDLState::Pollers SDLState::GetPollers(InputCommon::Polling::DeviceType type) {+ Pollers pollers;switch (type) {case InputCommon::Polling::DeviceType::Analog:pollers.emplace_back(std::make_unique<Polling::SDLAnalogPoller>(*this));diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.hindex fec82fbe63..2579741d65 100644--- a/src/input_common/sdl/sdl_impl.h+++ b/src/input_common/sdl/sdl_impl.h@@ -25,7 +25,7 @@ public:/// Initializes and registers SDL device factoriesSDLState();- /// Unresisters SDL device factories and shut them down.+ /// Unregisters SDL device factories and shut them down.~SDLState() override;/// Handle SDL_Events for joysticks from SDL_PollEvent@@ -35,8 +35,7 @@ public:std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port);/// Get all DevicePoller that use the SDL backend for a specific device type- std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(- InputCommon::Polling::DeviceType type) override;+ Pollers GetPollers(Polling::DeviceType type) override;/// Used by the Pollers during configstd::atomic<bool> polling = false;