(!1893) dix: write out X_LookupColor 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
5375a46321
commit
bfb1b56691
|
@ -3009,7 +3009,7 @@ ProcLookupColor(ClientPtr client)
|
||||||
&exactRed,
|
&exactRed,
|
||||||
&exactGreen,
|
&exactGreen,
|
||||||
&exactBlue)) {
|
&exactBlue)) {
|
||||||
xLookupColorReply lcr = {
|
xLookupColorReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -3020,10 +3020,19 @@ ProcLookupColor(ClientPtr client)
|
||||||
.screenGreen = exactGreen,
|
.screenGreen = exactGreen,
|
||||||
.screenBlue = exactBlue
|
.screenBlue = exactBlue
|
||||||
};
|
};
|
||||||
(*pcmp->pScreen->ResolveColor) (&lcr.screenRed,
|
(*pcmp->pScreen->ResolveColor) (&rep.screenRed,
|
||||||
&lcr.screenGreen,
|
&rep.screenGreen,
|
||||||
&lcr.screenBlue, pcmp->pVisual);
|
&rep.screenBlue, pcmp->pVisual);
|
||||||
WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swaps(&rep.exactRed);
|
||||||
|
swaps(&rep.exactGreen);
|
||||||
|
swaps(&rep.exactBlue);
|
||||||
|
swaps(&rep.screenRed);
|
||||||
|
swaps(&rep.screenGreen);
|
||||||
|
swaps(&rep.screenBlue);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
return BadName;
|
return BadName;
|
||||||
|
|
|
@ -310,19 +310,6 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
|
||||||
WriteToClient(pClient, size, pRep);
|
WriteToClient(pClient, size, pRep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swaps(&pRep->exactRed);
|
|
||||||
swaps(&pRep->exactGreen);
|
|
||||||
swaps(&pRep->exactBlue);
|
|
||||||
swaps(&pRep->screenRed);
|
|
||||||
swaps(&pRep->screenGreen);
|
|
||||||
swaps(&pRep->screenBlue);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
void _X_COLD
|
||||||
SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep)
|
SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep)
|
||||||
{
|
{
|
||||||
|
|
|
@ -807,7 +807,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 90 */
|
ReplyNotSwappd, /* 90 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SLookupColorReply,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 95 */
|
ReplyNotSwappd, /* 95 */
|
||||||
|
|
|
@ -68,10 +68,6 @@ extern void SGetFontPathReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xGetFontPathReply * /* pRep */ );
|
xGetFontPathReply * /* pRep */ );
|
||||||
|
|
||||||
extern void SLookupColorReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xLookupColorReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryBestSizeReply(ClientPtr /* pClient */ ,
|
extern void SQueryBestSizeReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xQueryBestSizeReply * /* pRep */ );
|
xQueryBestSizeReply * /* pRep */ );
|
||||||
|
|
Loading…
Reference in New Issue