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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-09-05 17:21:34 +02:00
committed by Enrico Weigelt
parent 470cca48d3
commit 7f4bef0174

View File

@@ -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");