xv: inline SWriteQueryPortAttributesReply()

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

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:22:29 +02:00
committed by Enrico Weigelt
parent 199e049b95
commit 9f5b2597e0

View File

@@ -54,20 +54,6 @@ SOFTWARE.
unsigned long XvXRTPort;
#endif /* XINERAMA */
static int
SWriteQueryPortAttributesReply(ClientPtr client,
xvQueryPortAttributesReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->num_attributes);
swapl(&rep->text_size);
WriteToClient(client, sz_xvQueryPortAttributesReply, rep);
return Success;
}
static int
SWriteQueryImageAttributesReply(ClientPtr client,
xvQueryImageAttributesReply * rep)
@@ -96,10 +82,6 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
return Success;
}
#define _WriteQueryPortAttributesReply(_c,_d) \
if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryPortAttributesReply, _d)
#define _WriteQueryImageAttributesReply(_c,_d) \
if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryImageAttributesReply, _d)
@@ -688,7 +670,14 @@ ProcXvQueryPortAttributes(ClientPtr client)
+ rep.text_size;
rep.length >>= 2;
_WriteQueryPortAttributesReply(client, &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.num_attributes);
swapl(&rep.text_size);
}
WriteToClient(client, sz_xvQueryPortAttributesReply, &rep);
for (i = 0, pAtt = pPort->pAdaptor->pAttributes;
i < pPort->pAdaptor->nAttributes; i++, pAtt++) {