mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 08:10:03 +01:00
randr: ProcRRGetCrtcGamma(): 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
62b8497999
commit
d9863f7cb0
1 changed files with 7 additions and 4 deletions
|
|
@ -1676,13 +1676,16 @@ ProcRRGetCrtcGamma(ClientPtr client)
|
|||
swapl(&reply.length);
|
||||
swaps(&reply.size);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetCrtcGammaReply), &reply);
|
||||
if (crtc->gammaSize) {
|
||||
memcpy(extra, crtc->gammaRed, len);
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
|
||||
WriteSwappedDataToClient(client, len, extra);
|
||||
free(extra);
|
||||
if (client->swapped)
|
||||
SwapShorts((short*)extra, len/sizeof(CARD16));
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xRRGetCrtcGammaReply), &reply);
|
||||
WriteToClient(client, len, extra);
|
||||
free(extra);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue