From 3d787e4c480e333619fdda8cfa7202fe164f8f50 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 24 Sep 2025 14:35:04 +0200 Subject: [PATCH] xkb: inline SProcXkbGetNamedIndicator() No need to have whole extra functions for just a few LoC. Signed-off-by: Enrico Weigelt, metux IT consult --- xkb/xkb.c | 13 ++++++++++--- xkb/xkbSwap.c | 14 +------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 093379e12a..2593f1b760 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -3262,14 +3262,21 @@ ProcXkbSetIndicatorMap(ClientPtr client) int ProcXkbGetNamedIndicator(ClientPtr client) { + REQUEST(xkbGetNamedIndicatorReq); + REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); + + if (client->swapped) { + swaps(&stuff->deviceSpec); + swaps(&stuff->ledClass); + swaps(&stuff->ledID); + swapl(&stuff->indicator); + } + DeviceIntPtr dev; register int i = 0; XkbSrvLedInfoPtr sli; XkbIndicatorMapPtr map = NULL; - REQUEST(xkbGetNamedIndicatorReq); - REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); - if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c index 7a6c8a8c20..578ef9abe1 100644 --- a/xkb/xkbSwap.c +++ b/xkb/xkbSwap.c @@ -268,18 +268,6 @@ SProcXkbSetIndicatorMap(ClientPtr client) return ProcXkbSetIndicatorMap(client); } -static int _X_COLD -SProcXkbGetNamedIndicator(ClientPtr client) -{ - REQUEST(xkbGetNamedIndicatorReq); - REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); - swaps(&stuff->deviceSpec); - swaps(&stuff->ledClass); - swaps(&stuff->ledID); - swapl(&stuff->indicator); - return ProcXkbGetNamedIndicator(client); -} - static int _X_COLD SProcXkbSetNamedIndicator(ClientPtr client) { @@ -387,7 +375,7 @@ SProcXkbDispatch(ClientPtr client) case X_kbSetIndicatorMap: return SProcXkbSetIndicatorMap(client); case X_kbGetNamedIndicator: - return SProcXkbGetNamedIndicator(client); + return ProcXkbGetNamedIndicator(client); case X_kbSetNamedIndicator: return SProcXkbSetNamedIndicator(client); case X_kbGetNames: