From 8633a437e0312dfb02b8db3ca8c4f9bf4d8a2a9f Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 15 Apr 2024 10:18:00 +0200 Subject: [PATCH] [coverity] 1543094 Use of auto that causes a copy --- client/SDL/dialogs/sdl_connection_dialog.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/SDL/dialogs/sdl_connection_dialog.cpp b/client/SDL/dialogs/sdl_connection_dialog.cpp index 973fbbace..56c385342 100644 --- a/client/SDL/dialogs/sdl_connection_dialog.cpp +++ b/client/SDL/dialogs/sdl_connection_dialog.cpp @@ -218,7 +218,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event) case SDL_KEYUP: if (visible()) { - auto ev = reinterpret_cast(event); + auto& ev = reinterpret_cast(event); update(_renderer); switch (event.key.keysym.sym) { @@ -245,7 +245,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event) case SDL_MOUSEMOTION: if (visible()) { - auto ev = reinterpret_cast(event); + auto& ev = reinterpret_cast(event); _buttons.set_mouseover(event.button.x, event.button.y); update(_renderer); @@ -256,7 +256,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event) case SDL_MOUSEBUTTONUP: if (visible()) { - auto ev = reinterpret_cast(event); + auto& ev = reinterpret_cast(event); update(_renderer); auto button = _buttons.get_selected(event.button); @@ -275,7 +275,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event) case SDL_MOUSEWHEEL: if (visible()) { - auto ev = reinterpret_cast(event); + auto& ev = reinterpret_cast(event); update(_renderer); return windowID == ev.windowID; } @@ -284,7 +284,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event) case SDL_FINGERDOWN: if (visible()) { - auto ev = reinterpret_cast(event); + auto& ev = reinterpret_cast(event); update(_renderer); #if SDL_VERSION_ATLEAST(2, 0, 18) return windowID == ev.windowID; @@ -295,7 +295,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event) return false; case SDL_WINDOWEVENT: { - auto ev = reinterpret_cast(event); + auto& ev = reinterpret_cast(event); switch (ev.event) { case SDL_WINDOWEVENT_CLOSE: