From 3bd75a2fd69db04b06c43caf6678f739801df55b Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 15 Jul 2025 04:13:48 +0200 Subject: [PATCH] xv: inline SWriteQueryEncodingsReply() Instead of complex macro machinery, just move the conditional swapping directly into ProcXvQueryEncodings(). Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/xvdisp.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index a22832c247..9c4fcf4263 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -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;