@samitouri / QOSamiQemu / commits / fbea9d550a

ui: minor code simplification

Drop memset() usage. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Marc-André Lureau committed Mar 3, 2026 at 22:00 UTC fbea9d550aa426017b5dbe03cb54aaff8981f764
2 files changed +6 -8
ui/sdl2.c
+4 -4
@@ -600,10 +600,10 @@ static void handle_windowevent(SDL_Event *ev)
600 switch (ev->window.event) {
601 case SDL_WINDOWEVENT_RESIZED:
602 {
603 - QemuUIInfo info;
604 - memset(&info, 0, sizeof(info));
605 - info.width = ev->window.data1;
606 - info.height = ev->window.data2;
603 + QemuUIInfo info = {
604 + .width = ev->window.data1,
605 + .height = ev->window.data2,
606 + };
607 dpy_set_ui_info(scon->dcl.con, &info, true);
608 }
609 sdl2_redraw(scon);
ui/vnc.c
+2 -4
@@ -43,6 +43,7 @@
43 #include "qapi/qapi-events-ui.h"
44 #include "qapi/error.h"
45 #include "qapi/qapi-commands-ui.h"
46 +#include "ui/console.h"
47 #include "ui/input.h"
48 #include "crypto/hash.h"
49 #include "crypto/tlscreds.h"
@@ -2639,10 +2640,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
2640
2641 trace_vnc_msg_client_set_desktop_size(vs, vs->ioc, w, h, screens);
2642 if (dpy_ui_info_supported(vs->vd->dcl.con)) {
2642 - QemuUIInfo info;
2643 - memset(&info, 0, sizeof(info));
2644 - info.width = w;
2645 - info.height = h;
2643 + QemuUIInfo info = { .width = w, .height = h };
2644 dpy_set_ui_info(vs->vd->dcl.con, &info, false);
2645 vnc_desktop_resize_ext(vs, 4 /* Request forwarded */);
2646 } else {