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 int
ProcGetScreenSaver(ClientPtr client) ProcGetScreenSaver(ClientPtr client)
{ {
xGetScreenSaverReply rep;
int rc, i; int rc, i;
REQUEST_SIZE_MATCH(xReq); REQUEST_SIZE_MATCH(xReq);
@ -3311,7 +3310,7 @@ ProcGetScreenSaver(ClientPtr client)
return rc; return rc;
} }
rep = (xGetScreenSaverReply) { xGetScreenSaverReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0, .length = 0,
@ -3320,7 +3319,13 @@ ProcGetScreenSaver(ClientPtr client)
.preferBlanking = ScreenSaverBlanking, .preferBlanking = ScreenSaverBlanking,
.allowExposures = ScreenSaverAllowExposures .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; return Success;
} }

View File

@ -318,15 +318,6 @@ SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
WriteToClient(pClient, size, 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 void _X_COLD
SLHostsExtend(ClientPtr pClient, int size, char *buf) SLHostsExtend(ClientPtr pClient, int size, char *buf)
{ {

View File

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

View File

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