From 4e1955815fba41dcc9ad93e924defe7fe1d3ba0e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 3 Mar 2025 13:59:37 +0100 Subject: [PATCH] kdrive: use designated struct initializers Easier to read and no need to care about field order anymore. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/kdrive/ephyr/ephyr.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 40c7fc8fa..7958cf7fc 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -1305,13 +1305,13 @@ MouseFini(KdPointerInfo * pi) ephyrMouse = NULL; } +/* *must not* be const/readonly, because some fields are written later */ KdPointerDriver EphyrMouseDriver = { - "ephyr", - MouseInit, - MouseEnable, - MouseDisable, - MouseFini, - NULL, + .name = "ephyr", + .Init = MouseInit, + .Enable = MouseEnable, + .Disable = MouseDisable, + .Fini = MouseFini, }; /* Keyboard */ @@ -1378,13 +1378,13 @@ EphyrKeyboardBell(KdKeyboardInfo * ki, int volume, int frequency, int duration) { } +/* *must not* be const/readonly, because some fields are written later */ KdKeyboardDriver EphyrKeyboardDriver = { - "ephyr", - EphyrKeyboardInit, - EphyrKeyboardEnable, - EphyrKeyboardLeds, - EphyrKeyboardBell, - EphyrKeyboardDisable, - EphyrKeyboardFini, - NULL, + .name = "ephyr", + .Init = EphyrKeyboardInit, + .Enable = EphyrKeyboardEnable, + .Leds = EphyrKeyboardLeds, + .Bell = EphyrKeyboardBell, + .Disable = EphyrKeyboardDisable, + .Fini = EphyrKeyboardFini, };