From d5c20e53fdc7e9b60ffbd5bd7c57ef9b6332c097 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 15 Jul 2024 19:35:47 +0200 Subject: [PATCH] (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 --- xkb/xkb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 096be99a9..317539933 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -1283,18 +1283,18 @@ XkbSizeExplicit(XkbDescPtr xkb, xkbGetMapReply * rep) } static char * -XkbWriteExplicit(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, - ClientPtr client) +XkbWriteExplicit(XkbDescPtr xkb, KeyCode firstKeyExplicit, CARD8 nKeyExplicit, + char *buf) { unsigned i; char *start; unsigned char *pExp; start = buf; - pExp = &xkb->server->explicit[rep->firstKeyExplicit]; - for (i = 0; i < rep->nKeyExplicit; i++, pExp++) { + pExp = &xkb->server->explicit[firstKeyExplicit]; + for (i = 0; i < nKeyExplicit; i++, pExp++) { if (*pExp != 0) { - *buf++ = i + rep->firstKeyExplicit; + *buf++ = i + firstKeyExplicit; *buf++ = *pExp; } } @@ -1432,7 +1432,7 @@ XkbSendMap(ClientPtr client, XkbDescPtr xkb, xkbGetMapReply * rep) desc += XkbPaddedSize(sz); } if (rep->totalKeyExplicit > 0) - desc = XkbWriteExplicit(xkb, rep, desc, client); + desc = XkbWriteExplicit(xkb, rep->firstKeyExplicit, rep->nKeyExplicit, desc); if (rep->totalModMapKeys > 0) desc = XkbWriteModifierMap(xkb, rep, desc, client); if (rep->totalVModMapKeys > 0)