From 3e9c40015ff8311c1fa123e49b330e0680b6c6e9 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 24 Sep 2025 17:11:09 +0200 Subject: [PATCH] xkb: inline SProcXkbSetNamedIndicator() No need to have whole extra functions for just a few LoC. Signed-off-by: Enrico Weigelt, metux IT consult --- xkb/xkb.c | 15 ++++++++++++--- xkb/xkbSwap.c | 16 +--------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 91c5f02c97..12b1527f3f 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -3499,14 +3499,23 @@ _XkbSetNamedIndicator(ClientPtr client, DeviceIntPtr dev, int ProcXkbSetNamedIndicator(ClientPtr client) { + REQUEST(xkbSetNamedIndicatorReq); + REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); + + if (client->swapped) { + swaps(&stuff->deviceSpec); + swaps(&stuff->ledClass); + swaps(&stuff->ledID); + swapl(&stuff->indicator); + swaps(&stuff->virtualMods); + swapl(&stuff->ctrls); + } + int rc; DeviceIntPtr dev; int led = 0; XkbIndicatorMapPtr map; - REQUEST(xkbSetNamedIndicatorReq); - REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); - if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c index cea0cf8c6b..dc502fd558 100644 --- a/xkb/xkbSwap.c +++ b/xkb/xkbSwap.c @@ -203,20 +203,6 @@ SProcXkbSetIndicatorMap(ClientPtr client) return ProcXkbSetIndicatorMap(client); } -static int _X_COLD -SProcXkbSetNamedIndicator(ClientPtr client) -{ - REQUEST(xkbSetNamedIndicatorReq); - REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); - swaps(&stuff->deviceSpec); - swaps(&stuff->ledClass); - swaps(&stuff->ledID); - swapl(&stuff->indicator); - swaps(&stuff->virtualMods); - swapl(&stuff->ctrls); - return ProcXkbSetNamedIndicator(client); -} - static int _X_COLD SProcXkbGetGeometry(ClientPtr client) { @@ -312,7 +298,7 @@ SProcXkbDispatch(ClientPtr client) case X_kbGetNamedIndicator: return ProcXkbGetNamedIndicator(client); case X_kbSetNamedIndicator: - return SProcXkbSetNamedIndicator(client); + return ProcXkbSetNamedIndicator(client); case X_kbGetNames: return ProcXkbGetNames(client); case X_kbSetNames: