xv: inline SWriteQueryEncodingsReply()

Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryEncodings().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-07-15 04:13:48 +02:00
committed by Enrico Weigelt
parent ef8cf84e6d
commit 3bd75a2fd6

View File

@@ -54,18 +54,6 @@ SOFTWARE.
unsigned long XvXRTPort;
#endif /* XINERAMA */
static int
SWriteQueryEncodingsReply(ClientPtr client, xvQueryEncodingsReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->num_encodings);
WriteToClient(client, sz_xvQueryEncodingsReply, rep);
return Success;
}
static int
SWriteAdaptorInfo(ClientPtr client, xvAdaptorInfo * pAdaptor)
{
@@ -215,10 +203,6 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
return Success;
}
#define _WriteQueryEncodingsReply(_c,_d) \
if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryEncodingsReply, _d)
#define _WriteAdaptorInfo(_c,_d) \
if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \
else WriteToClient(_c, sz_xvAdaptorInfo, _d)
@@ -409,7 +393,13 @@ ProcXvQueryEncodings(ClientPtr client)
.length = bytes_to_int32(totalSize),
};
_WriteQueryEncodingsReply(client, &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.num_encodings);
}
WriteToClient(client, sizeof(rep), &rep);
ne = pPort->pAdaptor->nEncodings;
pe = pPort->pAdaptor->pEncodings;