mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
dix: ProcListInstalledColormaps(): use x_rpcbuf_t
Use x_rpcbuf_t for payload assembly and X_SEND_REPLY_WITH_RPCBUF() for sending it all out. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
e2d9dc4054
commit
a41114cbe7
@@ -2555,24 +2555,19 @@ ProcListInstalledColormaps(ClientPtr client)
|
||||
const ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
const int nummaps = pScreen->ListInstalledColormaps(pScreen, cm);
|
||||
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
x_rpcbuf_write_CARD32s(&rpcbuf, cm, nummaps); /* Colormap is an XID, thus CARD32 */
|
||||
free(cm);
|
||||
|
||||
xListInstalledColormapsReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.nColormaps = nummaps,
|
||||
.length = nummaps,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.nColormaps);
|
||||
SwapLongs(cm, nummaps * sizeof(Colormap) / 4);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
WriteToClient(client, nummaps * sizeof(Colormap), cm);
|
||||
free(cm);
|
||||
return Success;
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user