From 6f7aa46c515d6fa01bc07e7cb90f9a868d89b87e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 3 Jul 2024 20:02:59 +0200 Subject: [PATCH] Xext: geext: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros Use the new macros to make request struct parsing / field swapping much easier. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/geext.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Xext/geext.c b/Xext/geext.c index 7c4eaece6..2cb31d86e 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -67,16 +67,12 @@ static void SGEGenericEvent(xEvent *from, xEvent *to); static int ProcGEQueryVersion(ClientPtr client) { + X_REQUEST_HEAD_STRUCT(xGEQueryVersionReq); + X_REQUEST_FIELD_CARD16(majorVersion); + X_REQUEST_FIELD_CARD16(minorVersion); + GEClientInfoPtr pGEClient = GEGetClient(client); - REQUEST(xGEQueryVersionReq); - REQUEST_SIZE_MATCH(xGEQueryVersionReq); - - if (client->swapped) { - swaps(&stuff->majorVersion); - swaps(&stuff->minorVersion); - } - xGEQueryVersionReply reply = { .RepType = X_GEQueryVersion, /* return the supported version by the server */