mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
xv: inline SWriteQueryAdaptorsReply()
Instead of complex macro machinery, just move the conditional swapping directly into ProcXvQueryExtension(). Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
875c29c253
commit
ef8cf84e6d
@@ -54,18 +54,6 @@ SOFTWARE.
|
||||
unsigned long XvXRTPort;
|
||||
#endif /* XINERAMA */
|
||||
|
||||
static int
|
||||
SWriteQueryAdaptorsReply(ClientPtr client, xvQueryAdaptorsReply * rep)
|
||||
{
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_adaptors);
|
||||
|
||||
WriteToClient(client, sz_xvQueryAdaptorsReply, rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
SWriteQueryEncodingsReply(ClientPtr client, xvQueryEncodingsReply * rep)
|
||||
{
|
||||
@@ -227,10 +215,6 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
|
||||
return Success;
|
||||
}
|
||||
|
||||
#define _WriteQueryAdaptorsReply(_c,_d) \
|
||||
if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \
|
||||
else WriteToClient(_c, sz_xvQueryAdaptorsReply, _d)
|
||||
|
||||
#define _WriteQueryEncodingsReply(_c,_d) \
|
||||
if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \
|
||||
else WriteToClient(_c, sz_xvQueryEncodingsReply, _d)
|
||||
@@ -282,6 +266,9 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
|
||||
static int
|
||||
ProcXvQueryExtension(ClientPtr client)
|
||||
{
|
||||
/* REQUEST(xvQueryExtensionReq); */
|
||||
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
||||
|
||||
xvQueryExtensionReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
@@ -290,9 +277,6 @@ ProcXvQueryExtension(ClientPtr client)
|
||||
.revision = XvRevision
|
||||
};
|
||||
|
||||
/* REQUEST(xvQueryExtensionReq); */
|
||||
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
@@ -333,7 +317,8 @@ ProcXvQueryAdaptors(ClientPtr client)
|
||||
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
|
||||
XvGetScreenKey());
|
||||
if (!pxvs) {
|
||||
_WriteQueryAdaptorsReply(client, &rep);
|
||||
if (client->swapped) swaps(&rep.sequenceNumber);
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -355,7 +340,12 @@ ProcXvQueryAdaptors(ClientPtr client)
|
||||
|
||||
rep.length = bytes_to_int32(totalSize);
|
||||
|
||||
_WriteQueryAdaptorsReply(client, &rep);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.num_adaptors);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
|
||||
na = pxvs->nAdaptors;
|
||||
pa = pxvs->pAdaptors;
|
||||
|
||||
Reference in New Issue
Block a user