randr: ProcRRQueryOutputProperty(): use SwapShort()/SwapLong()
Simplify reply payload preparation and sendout by using SwapShort() and SwapLong() instead of WriteToClientSwapped() and callbacks. This also allows even further simplifications by using generic macros for the request send path. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
This commit is contained in:
parent
e3001b71b3
commit
73467faeb2
|
@ -495,14 +495,16 @@ ProcRRQueryOutputProperty(ClientPtr client)
|
|||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), &rep);
|
||||
if (prop->num_valid) {
|
||||
memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32));
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32),
|
||||
extra);
|
||||
free(extra);
|
||||
if (client->swapped)
|
||||
SwapLongs((CARD32*)extra, prop->num_valid);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), &rep);
|
||||
WriteToClient(client, prop->num_valid * sizeof(INT32), extra);
|
||||
free(extra);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue