From abf1db322b1f1c1030c64de1f7ddeabd9f763aea Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 16 Jul 2024 10:22:52 +0200 Subject: [PATCH] (!1632) 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 3b2df581e..dfd027872 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -3173,24 +3173,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; @@ -3219,12 +3219,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); @@ -3257,7 +3257,7 @@ ProcXkbGetIndicatorMap(ClientPtr client) .which = stuff->which }; XkbComputeGetIndicatorMapReplySize(leds, &rep); - return XkbSendIndicatorMap(client, leds, &rep); + return XkbSendIndicatorMap(client, leds, rep); } /** @@ -6111,7 +6111,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)