xv: inline SWriteListImageFormatsReply()

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-07-15 05:33:38 +02:00
committed by Enrico Weigelt
parent a3de7f5c57
commit c8c52387c5

View File

@@ -54,22 +54,6 @@ SOFTWARE.
unsigned long XvXRTPort;
#endif /* XINERAMA */
static int
SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->num_formats);
WriteToClient(client, sz_xvListImageFormatsReply, rep);
return Success;
}
#define _WriteListImageFormatsReply(_c,_d) \
if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \
else WriteToClient(_c, sz_xvListImageFormatsReply, _d)
static int
ProcXvQueryExtension(ClientPtr client)
{
@@ -946,7 +930,13 @@ ProcXvListImageFormats(ClientPtr client)
bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo)
};
_WriteListImageFormatsReply(client, &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.num_formats);
}
WriteToClient(client, sz_xvListImageFormatsReply, &rep);
pImage = pPort->pAdaptor->pImages;