dix: write out X-AllocColorCells 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
df44f063a0
commit
3a233ac98a
|
@ -2757,16 +2757,22 @@ ProcAllocColorCells(ClientPtr client)
|
||||||
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
{
|
{
|
||||||
xAllocColorCellsReply accr = {
|
xAllocColorCellsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(length),
|
.length = bytes_to_int32(length),
|
||||||
.nPixels = npixels,
|
.nPixels = npixels,
|
||||||
.nMasks = nmasks
|
.nMasks = nmasks
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xAllocColorCellsReply), &accr);
|
if (client->swapped) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
swaps(&rep.sequenceNumber);
|
||||||
WriteSwappedDataToClient(client, length, ppixels);
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nPixels);
|
||||||
|
swaps(&rep.nMasks);
|
||||||
|
SwapLongs(ppixels, length / 4);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, length, ppixels);
|
||||||
}
|
}
|
||||||
free(ppixels);
|
free(ppixels);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -310,16 +310,6 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
|
||||||
WriteToClient(pClient, size, pRep);
|
WriteToClient(pClient, size, pRep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nPixels);
|
|
||||||
swaps(&pRep->nMasks);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
void _X_COLD
|
||||||
SAllocColorPlanesReply(ClientPtr pClient, int size,
|
SAllocColorPlanesReply(ClientPtr pClient, int size,
|
||||||
xAllocColorPlanesReply * pRep)
|
xAllocColorPlanesReply * pRep)
|
||||||
|
|
|
@ -801,7 +801,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 85 */
|
ReplyNotSwappd, /* 85 */
|
||||||
(ReplySwapPtr) SAllocColorCellsReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SAllocColorPlanesReply,
|
(ReplySwapPtr) SAllocColorPlanesReply,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
|
|
|
@ -68,11 +68,6 @@ extern void SGetFontPathReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xGetFontPathReply * /* pRep */ );
|
xGetFontPathReply * /* pRep */ );
|
||||||
|
|
||||||
extern void SAllocColorCellsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xAllocColorCellsReply * /* pRep */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void SAllocColorPlanesReply(ClientPtr /* pClient */ ,
|
extern void SAllocColorPlanesReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xAllocColorPlanesReply * /* pRep */
|
xAllocColorPlanesReply * /* pRep */
|
||||||
|
|
Loading…
Reference in New Issue