From 7f4bef0174860d74bd7defa09a94e836d02b2397 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 5 Sep 2025 17:21:34 +0200 Subject: [PATCH] Xext: GE: inline request swapping It's so trivial that those few lines can easily be inlined into the actual request handler. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/geext.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/Xext/geext.c b/Xext/geext.c index 9ae2bc9106..9bc4ad0a2f 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -73,6 +73,11 @@ ProcGEQueryVersion(ClientPtr 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 */ @@ -93,19 +98,6 @@ ProcGEQueryVersion(ClientPtr client) return Success; } -/************************************************************/ -/* swapped request handlers */ -/************************************************************/ -static int _X_COLD -SProcGEQueryVersion(ClientPtr client) -{ - REQUEST(xGEQueryVersionReq); - REQUEST_SIZE_MATCH(xGEQueryVersionReq); - swaps(&stuff->majorVersion); - swaps(&stuff->minorVersion); - return ProcGEQueryVersion(client); -} - /************************************************************/ /* callbacks */ /************************************************************/ @@ -124,20 +116,6 @@ ProcGEDispatch(ClientPtr client) } } -/* dispatch swapped requests */ -static int _X_COLD -SProcGEDispatch(ClientPtr client) -{ - REQUEST(xReq); - - switch (stuff->data) { - case X_GEQueryVersion: - return SProcGEQueryVersion(client); - default: - return BadRequest; - } -} - /* Reset extension. Called on server shutdown. */ static void GEResetProc(ExtensionEntry * extEntry) @@ -178,7 +156,7 @@ GEExtensionInit(void) (&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec))) FatalError("GEExtensionInit: GE private request failed.\n"); - if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch, + if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, ProcGEDispatch, GEResetProc, StandardMinorOpcode)) FatalError("GEInit: AddExtensions failed.\n");