diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2025-03-08 10:04:52 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2025-03-08 10:04:52 -0800 |
commit | 3ba601efc462d0c39598aab8216580cdcf025c6a (patch) | |
tree | 85900204eacbafa41377cfb307cf272cc9aae3ae | |
parent | 54212cb9f169056d6c5aebe8aeca1f588188e409 (diff) |
Gets rid of 20 -Wdiscarded-qualifiers warnings from gcc 14.2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/merge_requests/25>
-rw-r--r-- | src/xkbtext.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/xkbtext.c b/src/xkbtext.c index 73b2c81..beb0a83 100644 --- a/src/xkbtext.c +++ b/src/xkbtext.c @@ -822,7 +822,7 @@ XkbDoodadTypeText(unsigned type, unsigned format) return buf; } -static char *actionTypeNames[XkbSA_NumActions] = { +static const char *actionTypeNames[XkbSA_NumActions] = { "NoAction", "SetMods", "LatchMods", "LockMods", "SetGroup", "LatchGroup", "LockGroup", @@ -841,17 +841,17 @@ char * XkbActionTypeText(unsigned type, unsigned format) { static char buf[32]; - char *rtrn; if (type <= XkbSA_LastAction) { - rtrn = actionTypeNames[type]; - if (format == XkbCFile) { + const char *rtrn = actionTypeNames[type]; + + if (format == XkbCFile) snprintf(buf, sizeof(buf), "XkbSA_%s", rtrn); - return buf; - } - return rtrn; + else + snprintf(buf, sizeof(buf), "%s", rtrn); } - snprintf(buf, sizeof(buf), "Private"); + else + snprintf(buf, sizeof(buf), "Private"); return buf; } |