xkb: ProcXkbGetCompatMap(): use X_SEND_REPLY_WITH_RPCBUF()

Now that we're entirely operating on x_rpcbuf_t, we can use generic
macro for the whole final write out, including setting standard
reply header fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-19 11:33:47 +02:00
committed by Enrico Weigelt
parent eda4dcabf7
commit 743838456d

View File

@@ -2810,8 +2810,6 @@ ProcXkbGetCompatMap(ClientPtr client)
compat = xkb->compat;
xkbGetCompatMapReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.deviceID = dev->id,
.firstSI = stuff->firstSI,
.nSI = stuff->nSI,
@@ -2827,7 +2825,6 @@ ProcXkbGetCompatMap(ClientPtr client)
client->errorValue = _XkbErrCode2(0x05, compat->num_si);
return BadValue;
}
XkbComputeGetCompatMapReplySize(compat, &rep);
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
XkbAssembleCompatMap(client, compat, rep, &rpcbuf);
@@ -2836,15 +2833,12 @@ ProcXkbGetCompatMap(ClientPtr client)
return BadAlloc;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.firstSI);
swaps(&rep.nSI);
swaps(&rep.nTotalSI);
}
WriteToClient(client, sizeof(xkbGetCompatMapReply), &rep);
WriteRpcbufToClient(client, &rpcbuf);
X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return Success;
}