diff options
| author | Lioncash <mathew1800@gmail.com> | 2020-08-28 20:58:29 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2020-08-28 20:58:49 -0400 |
| commit | 4dc59a4b648be72705811fdf200b2276d744680b (patch) | |
| tree | e32bb82e2cba38dbb4c29f5f85add400862a4e3d /src/input_common/sdl/sdl_impl.cpp | |
| parent | 62b70f5226e46966f7433ea83b1a53350dc25374 (diff) | |
sdl_impl: Mark FromEvent() as a const member function
This doesn't modify internal member state, so it can be marked as const.
Diffstat (limited to 'src/input_common/sdl/sdl_impl.cpp')
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index c8d9eb2bca..43fac76500 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -784,7 +784,7 @@ public: } return {}; } - std::optional<Common::ParamPackage> FromEvent(const SDL_Event& event) { + [[nodiscard]] std::optional<Common::ParamPackage> FromEvent(const SDL_Event& event) const { switch (event.type) { case SDL_JOYAXISMOTION: if (std::abs(event.jaxis.value / 32767.0) < 0.5) { @@ -795,7 +795,7 @@ public: case SDL_JOYHATMOTION: return {SDLEventToButtonParamPackage(state, event)}; } - return {}; + return std::nullopt; } }; |
