diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-06-03 16:19:22 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-06-03 16:56:46 -0400 |
| commit | f0a45d70a896d055344c3b59c2a72eb528273914 (patch) | |
| tree | 2bc4e038ce3246735b33a2a5fa81c7db47d6f81c /src/input_common/sdl/sdl_impl.cpp | |
| parent | ed90a754c57613b5af5183390260c910d88ecb7b (diff) | |
input_common/sdl/sdl_impl: Convert reinterpret_cast into a static_cast
It's valid to static_cast a void pointer back into its proper type.
Diffstat (limited to 'src/input_common/sdl/sdl_impl.cpp')
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index edd4affe26..c5589eb73c 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -33,14 +33,16 @@ static std::string GetGUID(SDL_Joystick* joystick) { /// Creates a ParamPackage from an SDL_Event that can directly be used to create a ButtonDevice static Common::ParamPackage SDLEventToButtonParamPackage(SDLState& state, const SDL_Event& event); -static int SDLEventWatcher(void* userdata, SDL_Event* event) { - SDLState* sdl_state = reinterpret_cast<SDLState*>(userdata); +static int SDLEventWatcher(void* user_data, SDL_Event* event) { + auto* const sdl_state = static_cast<SDLState*>(user_data); + // Don't handle the event if we are configuring if (sdl_state->polling) { sdl_state->event_queue.Push(*event); } else { sdl_state->HandleGameControllerEvent(*event); } + return 0; } |
