forked from ShuriZma/suyu
1
0
Fork 0

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.
This commit is contained in:
Lioncash 2019-06-03 16:19:22 -04:00
parent 2c679cda51
commit b73ea457cc
1 changed files with 4 additions and 2 deletions

View File

@ -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 /// 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 Common::ParamPackage SDLEventToButtonParamPackage(SDLState& state, const SDL_Event& event);
static int SDLEventWatcher(void* userdata, SDL_Event* event) { static int SDLEventWatcher(void* user_data, SDL_Event* event) {
SDLState* sdl_state = reinterpret_cast<SDLState*>(userdata); auto* const sdl_state = static_cast<SDLState*>(user_data);
// Don't handle the event if we are configuring // Don't handle the event if we are configuring
if (sdl_state->polling) { if (sdl_state->polling) {
sdl_state->event_queue.Push(*event); sdl_state->event_queue.Push(*event);
} else { } else {
sdl_state->HandleGameControllerEvent(*event); sdl_state->HandleGameControllerEvent(*event);
} }
return 0; return 0;
} }