dix: write out X_ListProperties 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
67c09e3bc6
commit
b6cd982477
|
@ -574,7 +574,6 @@ int
|
|||
ProcListProperties(ClientPtr client)
|
||||
{
|
||||
Atom *pAtoms = NULL, *temppAtoms;
|
||||
xListPropertiesReply xlpr;
|
||||
int rc, numProps = 0;
|
||||
WindowPtr pWin;
|
||||
PropertyPtr pProp, realProp;
|
||||
|
@ -606,18 +605,24 @@ ProcListProperties(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
xlpr = (xListPropertiesReply) {
|
||||
xListPropertiesReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(numProps * sizeof(Atom)),
|
||||
.nProperties = numProps
|
||||
};
|
||||
WriteReplyToClient(client, sizeof(xGenericReply), &xlpr);
|
||||
if (numProps) {
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
|
||||
free(pAtoms);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.nProperties);
|
||||
SwapLongs(pAtoms, numProps);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
WriteToClient(client, numProps * sizeof(Atom), pAtoms);
|
||||
free(pAtoms);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -181,15 +181,6 @@ SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep)
|
|||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep)
|
||||
{
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nProperties);
|
||||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
static void _X_COLD
|
||||
SwapTimecoord(xTimecoord * pCoord)
|
||||
{
|
||||
|
|
|
@ -736,7 +736,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 20 */
|
||||
(ReplySwapPtr) SListPropertiesReply,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
|
|
|
@ -44,9 +44,6 @@ extern void SGenericReply(ClientPtr /* pClient */ ,
|
|||
int /* size */ ,
|
||||
xGenericReply * /* pRep */ );
|
||||
|
||||
extern void SListPropertiesReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xListPropertiesReply * /* pRep */ );
|
||||
extern void SwapTimeCoordWrite(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xTimecoord * /* pRep */ );
|
||||
|
|
Loading…
Reference in New Issue