From 0fd1c0dc4cc2a0f819f29fa406f65cc38e7a7b7d Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 18 Jul 2024 19:01:52 +0200 Subject: [PATCH] dri: use REPLY_*() macros for preparing / sending replies Use the new macros for preparing and sending replies to clients. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/dri/xf86dri.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index c1e9dd795..64574af73 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -81,11 +81,10 @@ ProcXF86DRIQueryVersion(register ClientPtr client) .patchVersion = SERVER_XF86DRI_PATCH_VERSION }; - if (client->swapped) { - swaps(&reply.majorVersion); - swaps(&reply.minorVersion); - swapl(&reply.patchVersion); - } + REPLY_FIELD_CARD16(majorVersion); + REPLY_FIELD_CARD16(minorVersion); + REPLY_FIELD_CARD32(patchVersion); + return X_SEND_REPLY_SIMPLE(client, reply); } @@ -112,7 +111,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) if (!client->local || client->swapped) isCapable = 0; - xXF86DRIQueryDirectRenderingCapableReply reply = { + xXF86DRIQueryDirectRenderingCapableReply rep = { .isCapable = isCapable }; @@ -411,7 +410,7 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client) X_REQUEST_HEAD_STRUCT(xXF86DRIGetDeviceInfoReq); drm_handle_t hFrameBuffer; - void *pDevPrivate; + void *pDevPrivate = NULL; ScreenPtr pScreen = dixGetScreenPtr(stuff->screen); if (!pScreen) {