(!1794) 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>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-07-29 19:48:54 +02:00
parent 3eaf92fa42
commit cff95e344d

View File

@@ -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);
if (extra) free(extra);
return Success;
}