From 9f5b2597e02baf78c2d6f11868a012c3fbabe6df Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 15 Jul 2025 05:22:29 +0200 Subject: [PATCH] xv: inline SWriteQueryPortAttributesReply() Instead of complex macro machinery, just move the conditional swapping directly into ProcXvQueryPortAttributes(). Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/xvdisp.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index 069af95ea..888e96f23 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -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++) {