From 9c5ae33f0d553b8571fc122d6f6ad88a61a6fcac Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 16 Jul 2024 10:22:52 +0200 Subject: [PATCH] xkb: XkbSendIndicatorMap() pass in reply struct as value instead of pointer It's not passing back any data via that pointer and actually the last consumer of it. Changing it to value instead of pointer clears the road for further simplifications by subsequent patches. Signed-off-by: Enrico Weigelt, metux IT consult --- xkb/xkb.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 61256a759..22e69765a 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -3172,24 +3172,24 @@ XkbComputeGetIndicatorMapReplySize(XkbIndicatorPtr indicators, static int XkbSendIndicatorMap(ClientPtr client, - XkbIndicatorPtr indicators, xkbGetIndicatorMapReply * rep) + XkbIndicatorPtr indicators, xkbGetIndicatorMapReply rep) { int length; CARD8 *map; register int i; register unsigned bit; - if (rep->length > 0) { + if (rep.length > 0) { CARD8 *to; - to = map = xallocarray(rep->length, 4); + to = map = xallocarray(rep.length, 4); if (map) { xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *) to; - length = rep->length * 4; + length = rep.length * 4; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { - if (rep->which & bit) { + if (rep.which & bit) { wire->flags = indicators->maps[i].flags; wire->whichGroups = indicators->maps[i].which_groups; wire->groups = indicators->maps[i].groups; @@ -3218,12 +3218,12 @@ XkbSendIndicatorMap(ClientPtr client, else map = NULL; if (client->swapped) { - swaps(&rep->sequenceNumber); - swapl(&rep->length); - swapl(&rep->which); - swapl(&rep->realIndicators); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.which); + swapl(&rep.realIndicators); } - WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), rep); + WriteToClient(client, sizeof(xkbGetIndicatorMapReply), &rep); if (map) { WriteToClient(client, length, map); free((char *) map); @@ -3256,7 +3256,7 @@ ProcXkbGetIndicatorMap(ClientPtr client) .which = stuff->which }; XkbComputeGetIndicatorMapReplySize(leds, &rep); - return XkbSendIndicatorMap(client, leds, &rep); + return XkbSendIndicatorMap(client, leds, rep); } /** @@ -6110,7 +6110,7 @@ ProcXkbGetKbdByName(ClientPtr client) if (reported & XkbGBN_CompatMapMask) XkbSendCompatMap(client, new->compat, crep); if (reported & XkbGBN_IndicatorMapMask) - XkbSendIndicatorMap(client, new->indicators, &irep); + XkbSendIndicatorMap(client, new->indicators, irep); if (reported & (XkbGBN_KeyNamesMask | XkbGBN_OtherNamesMask)) XkbSendNames(client, new, &nrep); if (reported & XkbGBN_GeometryMask)