dix: write out X_GetScreenSaver 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:
Enrico Weigelt, metux IT consult 2025-04-04 16:18:56 +02:00
parent d459390a2d
commit 5fd2c1c70a
4 changed files with 9 additions and 17 deletions

View File

@ -3299,7 +3299,6 @@ ProcSetScreenSaver(ClientPtr client)
int
ProcGetScreenSaver(ClientPtr client)
{
xGetScreenSaverReply rep;
int rc, i;
REQUEST_SIZE_MATCH(xReq);
@ -3311,7 +3310,7 @@ ProcGetScreenSaver(ClientPtr client)
return rc;
}
rep = (xGetScreenSaverReply) {
xGetScreenSaverReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -3320,7 +3319,13 @@ ProcGetScreenSaver(ClientPtr client)
.preferBlanking = ScreenSaverBlanking,
.allowExposures = ScreenSaverAllowExposures
};
WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.timeout);
swaps(&rep.interval);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}

View File

@ -318,15 +318,6 @@ SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->timeout);
swaps(&pRep->interval);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SLHostsExtend(ClientPtr pClient, int size, char *buf)
{

View File

@ -823,7 +823,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd, /* 105 */
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetScreenSaverReply,
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SListHostsReply, /* 110 */
ReplyNotSwappd,

View File

@ -72,10 +72,6 @@ extern void SListExtensionsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListExtensionsReply * /* pRep */ );
extern void SGetScreenSaverReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetScreenSaverReply * /* pRep */ );
extern void SLHostsExtend(ClientPtr /* pClient */ ,
int /* size */ ,
char * /* buf */ );