mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
xkb: XkbAssembleMap(): use x_rpcbuf_t for writing the virtual mods
As we now have x_rpcbuf, we can use it here, instead of meddling with pre-allocated buffer space directly via raw pointer. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
316e5e431a
commit
15a13ef93e
15
xkb/xkb.c
15
xkb/xkb.c
@@ -1372,18 +1372,19 @@ static void XkbAssembleMap(ClientPtr client, XkbDescPtr xkb,
|
||||
if (rep.totalKeyBehaviors > 0)
|
||||
XkbWriteKeyBehaviors(xkb, rep.firstKeyBehavior, rep.nKeyBehaviors, rpcbuf);
|
||||
|
||||
char *desc = rpcbuf->buffer + rpcbuf->wpos;
|
||||
|
||||
if (rep.virtualMods) {
|
||||
register int sz;
|
||||
|
||||
for (int i = sz = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) {
|
||||
CARD8 vmods[XkbPaddedSize(XkbNumVirtualMods)] = { 0 };
|
||||
size_t sz = 0;
|
||||
for (size_t i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) {
|
||||
if (rep.virtualMods & bit) {
|
||||
desc[sz++] = xkb->server->vmods[i];
|
||||
vmods[sz++] = xkb->server->vmods[i];
|
||||
}
|
||||
}
|
||||
desc += XkbPaddedSize(sz);
|
||||
x_rpcbuf_write_CARD8s(rpcbuf, vmods, XkbPaddedSize(sz));
|
||||
}
|
||||
|
||||
char *desc = rpcbuf->buffer + rpcbuf->wpos;
|
||||
|
||||
if (rep.totalKeyExplicit > 0)
|
||||
desc = XkbWriteExplicit(xkb, rep.firstKeyExplicit, rep.nKeyExplicit, desc);
|
||||
if (rep.totalModMapKeys > 0)
|
||||
|
||||
Reference in New Issue
Block a user