dix: write out X_QueryKeymap reply directly
No need for using a complex callback machinery, if we just move the little pieces of byte-swapping directly into the request handler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
13bec61739
commit
71139c015e
|
@ -2544,13 +2544,13 @@ ProcGetMotionEvents(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcQueryKeymap(ClientPtr client)
|
ProcQueryKeymap(ClientPtr client)
|
||||||
{
|
{
|
||||||
xQueryKeymapReply rep;
|
|
||||||
int rc, i;
|
int rc, i;
|
||||||
DeviceIntPtr keybd = PickKeyboard(client);
|
DeviceIntPtr keybd = PickKeyboard(client);
|
||||||
CARD8 *down = keybd->key->down;
|
CARD8 *down = keybd->key->down;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xReq);
|
REQUEST_SIZE_MATCH(xReq);
|
||||||
rep = (xQueryKeymapReply) {
|
|
||||||
|
xQueryKeymapReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 2
|
.length = 2
|
||||||
|
@ -2567,7 +2567,11 @@ ProcQueryKeymap(ClientPtr client)
|
||||||
else if (rc != BadAccess)
|
else if (rc != BadAccess)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -295,15 +295,6 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep)
|
||||||
WriteToClient(pClient, size, pRep);
|
WriteToClient(pClient, size, pRep);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* extra long reply */
|
|
||||||
void _X_COLD
|
|
||||||
SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _X_COLD
|
static void _X_COLD
|
||||||
SwapCharInfo(xCharInfo * pInfo)
|
SwapCharInfo(xCharInfo * pInfo)
|
||||||
{
|
{
|
||||||
|
|
|
@ -759,7 +759,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetInputFocusReply,
|
(ReplySwapPtr) SGetInputFocusReply,
|
||||||
(ReplySwapPtr) SQueryKeymapReply,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 45 */
|
ReplyNotSwappd, /* 45 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SQueryFontReply,
|
(ReplySwapPtr) SQueryFontReply,
|
||||||
|
|
|
@ -79,10 +79,6 @@ extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xGetInputFocusReply * /* pRep */ );
|
xGetInputFocusReply * /* pRep */ );
|
||||||
|
|
||||||
extern void SQueryKeymapReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryKeymapReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryFontReply(ClientPtr /* pClient */ ,
|
extern void SQueryFontReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xQueryFontReply * /* pRep */ );
|
xQueryFontReply * /* pRep */ );
|
||||||
|
|
Loading…
Reference in New Issue