Remove the extra "info" variable and its initialization.

Signed-off-by: Marc-André Lureau <[email protected]>
---
 ui/sdl2.c | 10 +++++-----
 ui/vnc.c  |  7 ++-----
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index aaaede56e0e..3ffb8acaff8 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -600,11 +600,11 @@ static void handle_windowevent(SDL_Event *ev)
     switch (ev->window.event) {
     case SDL_WINDOWEVENT_RESIZED:
         {
-            QemuUIInfo info;
-            memset(&info, 0, sizeof(info));
-            info.width = ev->window.data1;
-            info.height = ev->window.data2;
-            dpy_set_ui_info(scon->dcl.con, &info, true);
+            dpy_set_ui_info(scon->dcl.con,
+                &(QemuUIInfo) {
+                    .width = ev->window.data1,
+                    .height = ev->window.data2,
+                }, true);
         }
         sdl2_redraw(scon);
         break;
diff --git a/ui/vnc.c b/ui/vnc.c
index 4aa446a48d7..87ec3e6d799 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2638,11 +2638,8 @@ static int protocol_client_msg(VncState *vs, uint8_t 
*data, size_t len)
 
         trace_vnc_msg_client_set_desktop_size(vs, vs->ioc, w, h, screens);
         if (dpy_ui_info_supported(vs->vd->dcl.con)) {
-            QemuUIInfo info;
-            memset(&info, 0, sizeof(info));
-            info.width = w;
-            info.height = h;
-            dpy_set_ui_info(vs->vd->dcl.con, &info, false);
+            dpy_set_ui_info(vs->vd->dcl.con,
+                &(QemuUIInfo){ .width = w, .height = h }, false);
             vnc_desktop_resize_ext(vs, 4 /* Request forwarded */);
         } else {
             vnc_desktop_resize_ext(vs, 3 /* Invalid screen layout */);

-- 
2.53.0


Reply via email to