diff --git a/client/SDL/SDL3/dialogs/sdl_buttons.cpp b/client/SDL/SDL3/dialogs/sdl_buttons.cpp index d1d5ec3e9..6427bb88f 100644 --- a/client/SDL/SDL3/dialogs/sdl_buttons.cpp +++ b/client/SDL/SDL3/dialogs/sdl_buttons.cpp @@ -31,13 +31,13 @@ bool SdlButtonList::populate(SDL_Renderer* renderer, const std::vector(height); widget_cfg_t logo{ textcolor, backgroundcolor, diff --git a/client/SDL/SDL3/dialogs/sdl_input_widgets.cpp b/client/SDL/SDL3/dialogs/sdl_input_widgets.cpp index 812042fac..3433b132c 100644 --- a/client/SDL/SDL3/dialogs/sdl_input_widgets.cpp +++ b/client/SDL/SDL3/dialogs/sdl_input_widgets.cpp @@ -109,8 +109,8 @@ bool SdlInputWidgetList::update(SDL_Renderer* renderer) ssize_t SdlInputWidgetList::get_index(const SDL_MouseButtonEvent& button) { - const Sint32 x = button.x; - const Sint32 y = button.y; + const auto x = button.x; + const auto y = button.y; for (size_t i = 0; i < _list.size(); i++) { auto& cur = _list[i]; diff --git a/client/SDL/SDL3/dialogs/sdl_selectlist.cpp b/client/SDL/SDL3/dialogs/sdl_selectlist.cpp index 1fb0291b2..3b209834a 100644 --- a/client/SDL/SDL3/dialogs/sdl_selectlist.cpp +++ b/client/SDL/SDL3/dialogs/sdl_selectlist.cpp @@ -157,8 +157,8 @@ int SdlSelectList::run() ssize_t SdlSelectList::get_index(const SDL_MouseButtonEvent& button) { - const Sint32 x = button.x; - const Sint32 y = button.y; + const auto x = button.x; + const auto y = button.y; for (size_t i = 0; i < _list.size(); i++) { auto& cur = _list[i]; diff --git a/client/SDL/SDL3/dialogs/sdl_widget.cpp b/client/SDL/SDL3/dialogs/sdl_widget.cpp index 4c84225f6..6684055a9 100644 --- a/client/SDL/SDL3/dialogs/sdl_widget.cpp +++ b/client/SDL/SDL3/dialogs/sdl_widget.cpp @@ -120,8 +120,8 @@ SDL_Texture* SdlWidget::render_text(SDL_Renderer* renderer, const std::string& t return nullptr; } - src.w = w; - src.h = h; + src.w = static_cast(w); + src.h = static_cast(h); /* Do some magic: * - Add padding before and after text * - if text is too long only show the last elements diff --git a/client/SDL/SDL3/sdl_freerdp.cpp b/client/SDL/SDL3/sdl_freerdp.cpp index aec44811a..ad7fb327f 100644 --- a/client/SDL/SDL3/sdl_freerdp.cpp +++ b/client/SDL/SDL3/sdl_freerdp.cpp @@ -1007,7 +1007,8 @@ static int sdl_run(SdlContext* sdl) INT32 sx = x; INT32 sy = y; if (sdl_scale_coordinates(sdl, id, &sx, &sy, FALSE, FALSE)) - SDL_WarpMouseInWindow(window, sx, sy); + SDL_WarpMouseInWindow(window, static_cast(sx), + static_cast(sy)); } } break; diff --git a/client/SDL/SDL3/sdl_touch.cpp b/client/SDL/SDL3/sdl_touch.cpp index 47f98eb5a..4a60cb1da 100644 --- a/client/SDL/SDL3/sdl_touch.cpp +++ b/client/SDL/SDL3/sdl_touch.cpp @@ -201,8 +201,8 @@ BOOL sdl_handle_mouse_motion(SdlContext* sdl, const SDL_MouseMotionEvent* ev) sdl->input.mouse_focus(ev->windowID); const BOOL relative = freerdp_client_use_relative_mouse_events(sdl->common()); - INT32 x = relative ? ev->xrel : ev->x; - INT32 y = relative ? ev->yrel : ev->y; + auto x = static_cast(relative ? ev->xrel : ev->x); + auto y = static_cast(relative ? ev->yrel : ev->y); sdl_scale_coordinates(sdl, ev->windowID, &x, &y, TRUE, TRUE); return freerdp_client_send_button_event(sdl->common(), relative, PTR_FLAGS_MOVE, x, y); } @@ -213,8 +213,8 @@ BOOL sdl_handle_mouse_wheel(SdlContext* sdl, const SDL_MouseWheelEvent* ev) WINPR_ASSERT(ev); const BOOL flipped = (ev->direction == SDL_MOUSEWHEEL_FLIPPED); - const INT32 x = ev->x * (flipped ? -1 : 1) * 0x78; - const INT32 y = ev->y * (flipped ? -1 : 1) * 0x78; + const auto x = static_cast(ev->x * (flipped ? -1 : 1) * 0x78); + const auto y = static_cast(ev->y * (flipped ? -1 : 1) * 0x78); UINT16 flags = 0; if (y != 0) @@ -267,8 +267,8 @@ BOOL sdl_handle_mouse_button(SdlContext* sdl, const SDL_MouseButtonEvent* ev) } const BOOL relative = freerdp_client_use_relative_mouse_events(sdl->common()); - INT32 x = relative ? 0 : ev->x; - INT32 y = relative ? 0 : ev->y; + auto x = static_cast(relative ? 0 : ev->x); + auto y = static_cast(relative ? 0 : ev->y); sdl_scale_coordinates(sdl, ev->windowID, &x, &y, TRUE, TRUE); if ((flags & (~PTR_FLAGS_DOWN)) != 0) return freerdp_client_send_button_event(sdl->common(), relative, flags, x, y);