diff --git a/Xext/geext.c b/Xext/geext.c index 2ddff31ba..feb077e5b 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -28,6 +28,7 @@ #include #include +#include "dix/request_priv.h" #include "Xext/geext_priv.h" #include "windowstr.h" @@ -67,13 +68,13 @@ static void SGEGenericEvent(xEvent *from, xEvent *to); static int ProcGEQueryVersion(ClientPtr client) { + REQUEST_HEAD_STRUCT(xGEQueryVersionReq); + REQUEST_FIELD_CARD16(majorVersion); + REQUEST_FIELD_CARD16(minorVersion); + GEClientInfoPtr pGEClient = GEGetClient(client); xGEQueryVersionReply rep; - REQUEST(xGEQueryVersionReq); - - REQUEST_SIZE_MATCH(xGEQueryVersionReq); - rep = (xGEQueryVersionReply) { .repType = X_Reply, .RepType = X_GEQueryVersion, @@ -100,19 +101,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 */ /************************************************************/ @@ -131,21 +119,6 @@ ProcGEDispatch(ClientPtr client) } } -/* dispatch swapped requests */ -static int _X_COLD -SProcGEDispatch(ClientPtr client) -{ - REQUEST(xReq); - swaps(&stuff->length); - - switch (stuff->data) { - case X_GEQueryVersion: - return SProcGEQueryVersion(client); - default: - return BadRequest; - } -} - /* Reset extension. Called on server shutdown. */ static void GEResetProc(ExtensionEntry * extEntry) @@ -186,7 +159,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");