(1623) xkb: XkbWriteExplicit(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it. Therefore only pass in what's really needed, so it gets easier to understand. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
8060c04864
commit
d5c20e53fd
12
xkb/xkb.c
12
xkb/xkb.c
|
@ -1283,18 +1283,18 @@ XkbSizeExplicit(XkbDescPtr xkb, xkbGetMapReply * rep)
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
XkbWriteExplicit(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf,
|
XkbWriteExplicit(XkbDescPtr xkb, KeyCode firstKeyExplicit, CARD8 nKeyExplicit,
|
||||||
ClientPtr client)
|
char *buf)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char *start;
|
char *start;
|
||||||
unsigned char *pExp;
|
unsigned char *pExp;
|
||||||
|
|
||||||
start = buf;
|
start = buf;
|
||||||
pExp = &xkb->server->explicit[rep->firstKeyExplicit];
|
pExp = &xkb->server->explicit[firstKeyExplicit];
|
||||||
for (i = 0; i < rep->nKeyExplicit; i++, pExp++) {
|
for (i = 0; i < nKeyExplicit; i++, pExp++) {
|
||||||
if (*pExp != 0) {
|
if (*pExp != 0) {
|
||||||
*buf++ = i + rep->firstKeyExplicit;
|
*buf++ = i + firstKeyExplicit;
|
||||||
*buf++ = *pExp;
|
*buf++ = *pExp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1432,7 +1432,7 @@ XkbSendMap(ClientPtr client, XkbDescPtr xkb, xkbGetMapReply * rep)
|
||||||
desc += XkbPaddedSize(sz);
|
desc += XkbPaddedSize(sz);
|
||||||
}
|
}
|
||||||
if (rep->totalKeyExplicit > 0)
|
if (rep->totalKeyExplicit > 0)
|
||||||
desc = XkbWriteExplicit(xkb, rep, desc, client);
|
desc = XkbWriteExplicit(xkb, rep->firstKeyExplicit, rep->nKeyExplicit, desc);
|
||||||
if (rep->totalModMapKeys > 0)
|
if (rep->totalModMapKeys > 0)
|
||||||
desc = XkbWriteModifierMap(xkb, rep, desc, client);
|
desc = XkbWriteModifierMap(xkb, rep, desc, client);
|
||||||
if (rep->totalVModMapKeys > 0)
|
if (rep->totalVModMapKeys > 0)
|
||||||
|
|
Loading…
Reference in New Issue