diff --git a/src/openrct2-ui/input/Input.cpp b/src/openrct2-ui/input/Input.cpp index 21d42288a2..cc1521d7c3 100644 --- a/src/openrct2-ui/input/Input.cpp +++ b/src/openrct2-ui/input/Input.cpp @@ -110,7 +110,7 @@ static void game_handle_key_scroll() static int32_t input_scancode_to_rct_keycode(int32_t sdl_key) { - char keycode = (char)SDL_GetKeyFromScancode((SDL_Scancode)sdl_key); + char keycode = static_cast(SDL_GetKeyFromScancode(static_cast(sdl_key))); // Until we reshuffle the text files to use the new positions // this will suffice to move the majority to the correct positions. diff --git a/src/openrct2-ui/input/KeyboardShortcuts.cpp b/src/openrct2-ui/input/KeyboardShortcuts.cpp index 8455d240e8..df3af380d9 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.cpp +++ b/src/openrct2-ui/input/KeyboardShortcuts.cpp @@ -230,14 +230,14 @@ ScreenCoordsXY KeyboardShortcuts::GetKeyboardMapScroll(const uint8_t* keysState) // Check if SHIFT is either set in the shortcut key and currently pressed, // or not set in the shortcut key and not currently pressed (in other words: check if they match). - if ((bool)(shortcutKey & SHIFT) != (keysState[SDL_SCANCODE_LSHIFT] || keysState[SDL_SCANCODE_RSHIFT])) + if (static_cast(shortcutKey & SHIFT) != (keysState[SDL_SCANCODE_LSHIFT] || keysState[SDL_SCANCODE_RSHIFT])) continue; - if ((bool)(shortcutKey & CTRL) != (keysState[SDL_SCANCODE_LCTRL] || keysState[SDL_SCANCODE_RCTRL])) + if (static_cast(shortcutKey & CTRL) != (keysState[SDL_SCANCODE_LCTRL] || keysState[SDL_SCANCODE_RCTRL])) continue; - if ((bool)(shortcutKey & ALT) != (keysState[SDL_SCANCODE_LALT] || keysState[SDL_SCANCODE_RALT])) + if (static_cast(shortcutKey & ALT) != (keysState[SDL_SCANCODE_LALT] || keysState[SDL_SCANCODE_RALT])) continue; #ifdef __MACOSX__ - if ((bool)(shortcutKey & CMD) != (keysState[SDL_SCANCODE_LGUI] || keysState[SDL_SCANCODE_RGUI])) + if (static_cast(shortcutKey & CMD) != (keysState[SDL_SCANCODE_LGUI] || keysState[SDL_SCANCODE_RGUI])) continue; #endif switch (shortcutId) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index ac4f10c18c..7acda1f4c8 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -483,7 +483,7 @@ static void input_window_resize_begin(rct_window* w, rct_widgetindex widgetIndex static void input_window_resize_continue(rct_window* w, const ScreenCoordsXY& screenCoords) { - if (screenCoords.y < (int32_t)context_get_height() - 2) + if (screenCoords.y < static_cast(context_get_height()) - 2) { auto differentialCoords = screenCoords - gInputDragLast; int32_t targetWidth = _originalWindowWidth + differentialCoords.x - w->width; @@ -1482,7 +1482,7 @@ static void input_update_tooltip(rct_window* w, rct_widgetindex widgetIndex, con */ int32_t get_next_key() { - uint8_t* keysPressed = (uint8_t*)context_get_keys_pressed(); + uint8_t* keysPressed = const_cast(context_get_keys_pressed()); for (int32_t i = 0; i < 221; i++) { if (keysPressed[i])