diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-11 15:18:26 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-03 11:02:11 -0800 |
commit | 6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c (patch) | |
tree | 45171678d6b1fbfe936bb2586933d3e03c93500a /symbols.c | |
parent | 299c9762b1dbe53f3297c54e5526aeae767d1a10 (diff) |
Mark more pointers as const
Some suggested by cppcheck, others by manual code inspection
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'symbols.c')
-rw-r--r-- | symbols.c | 37 |
1 files changed, 17 insertions, 20 deletions
@@ -855,8 +855,8 @@ static LookupEntry groupNames[] = { #define ACTIONS 2 static Bool -GetGroupIndex(KeyInfo * key, - ExprDef * arrayNdx, unsigned what, unsigned *ndx_rtrn) +GetGroupIndex(KeyInfo *key, const ExprDef *arrayNdx, + unsigned what, unsigned *ndx_rtrn) { const char *name; ExprResult tmp; @@ -907,10 +907,9 @@ GetGroupIndex(KeyInfo * key, } static Bool -AddSymbolsToKey(KeyInfo * key, - XkbDescPtr xkb, - const char *field, - ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info) +AddSymbolsToKey(KeyInfo *key, XkbDescPtr xkb, const char *field, + const ExprDef *arrayNdx, const ExprDef *value, + SymbolsInfo *info) { unsigned ndx, nSyms; @@ -964,10 +963,9 @@ AddSymbolsToKey(KeyInfo * key, } static Bool -AddActionsToKey(KeyInfo * key, - XkbDescPtr xkb, - const char *field, - ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info) +AddActionsToKey(KeyInfo *key, XkbDescPtr xkb, const char *field, + const ExprDef *arrayNdx, const ExprDef *value, + SymbolsInfo *info) { unsigned ndx, nActs; ExprDef *act; @@ -1029,7 +1027,7 @@ AddActionsToKey(KeyInfo * key, } static int -SetAllowNone(KeyInfo * key, ExprDef * arrayNdx, ExprDef * value) +SetAllowNone(KeyInfo *key, const ExprDef *arrayNdx, const ExprDef *value) { ExprResult tmp; unsigned radio_groups = 0; @@ -1099,10 +1097,9 @@ static LookupEntry rgEntries[] = { }; static Bool -SetSymbolsField(KeyInfo * key, - XkbDescPtr xkb, - const char *field, - ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info) +SetSymbolsField(KeyInfo *key, XkbDescPtr xkb, const char *field, + const ExprDef *arrayNdx, const ExprDef *value, + SymbolsInfo *info) { Bool ok = True; ExprResult tmp; @@ -1348,7 +1345,7 @@ SetSymbolsField(KeyInfo * key, } static int -SetGroupName(SymbolsInfo * info, ExprDef * arrayNdx, ExprDef * value) +SetGroupName(SymbolsInfo *info, const ExprDef *arrayNdx,const ExprDef *value) { ExprResult tmp, name; @@ -1716,7 +1713,7 @@ FindKeyForSymbol(XkbDescPtr xkb, KeySym sym, unsigned int *kc_rtrn) * @return True if found, False otherwise. */ static Bool -FindNamedType(XkbDescPtr xkb, Atom name, unsigned *type_rtrn) +FindNamedType(const XkbDescPtr xkb, Atom name, unsigned *type_rtrn) { if (xkb && xkb->map && xkb->map->types) { @@ -1764,15 +1761,15 @@ KSIsUpper(KeySym ks) * - TWO_LEVEL for other 2 shift level keys. * and the same for four level keys. * - * @param width Number of sysms in syms. + * @param width Number of syms in syms. * @param syms The keysyms for the given key (must be size width). * @param typeNameRtrn Set to the Atom of the type name. * * @returns True if a type could be found, False otherwise. */ static Bool -FindAutomaticType(int width, KeySym * syms, Atom * typeNameRtrn, - Bool * autoType) +FindAutomaticType(int width, const KeySym *syms, + Atom *typeNameRtrn, Bool *autoType) { *autoType = False; if ((width == 1) || (width == 0)) |