From b73ea457cc9870b7846982a4d8633b368fe02e9a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Jun 2019 16:19:22 -0400 Subject: 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. --- src/input_common/sdl/sdl_impl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/input_common') diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index edd4affe2..c5589eb73 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(userdata); +static int SDLEventWatcher(void* user_data, SDL_Event* event) { + auto* const sdl_state = static_cast(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; } -- cgit v1.2.3