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 /keytypes.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 'keytypes.c')
-rw-r--r-- | keytypes.c | 33 |
1 files changed, 16 insertions, 17 deletions
@@ -105,7 +105,7 @@ Atom tok_KEYPAD; /***====================================================================***/ static void -InitKeyTypesInfo(KeyTypesInfo * info, XkbDescPtr xkb, KeyTypesInfo * from) +InitKeyTypesInfo(KeyTypesInfo *info, XkbDescPtr xkb, const KeyTypesInfo *from) { tok_ONE_LEVEL = XkbInternAtom(NULL, "ONE_LEVEL", False); tok_TWO_LEVEL = XkbInternAtom(NULL, "TWO_LEVEL", False); @@ -232,7 +232,7 @@ NextKeyType(KeyTypesInfo * info) } static KeyTypeInfo * -FindMatchingKeyType(KeyTypesInfo * info, KeyTypeInfo * new) +FindMatchingKeyType(KeyTypesInfo *info, const KeyTypeInfo *new) { for (KeyTypeInfo *old = info->types; old; old = (KeyTypeInfo *) old->defs.next) @@ -445,7 +445,7 @@ HandleIncludeKeyTypes(IncludeStmt * stmt, /***====================================================================***/ static XkbKTMapEntryPtr -FindMatchingMapEntry(KeyTypeInfo * type, unsigned mask, unsigned vmask) +FindMatchingMapEntry(const KeyTypeInfo *type, unsigned mask, unsigned vmask) { int i; XkbKTMapEntryPtr entry; @@ -648,8 +648,8 @@ static LookupEntry lnames[] = { }; static Bool -SetMapEntry(KeyTypeInfo * type, - XkbDescPtr xkb, ExprDef * arrayNdx, ExprDef * value) +SetMapEntry(KeyTypeInfo *type, XkbDescPtr xkb, + const ExprDef *arrayNdx, const ExprDef *value) { ExprResult rtrn; XkbKTMapEntryRec entry; @@ -695,8 +695,8 @@ SetMapEntry(KeyTypeInfo * type, } static Bool -SetPreserve(KeyTypeInfo * type, - XkbDescPtr xkb, ExprDef * arrayNdx, ExprDef * value) +SetPreserve(KeyTypeInfo *type, XkbDescPtr xkb, + const ExprDef *arrayNdx, const ExprDef *value) { ExprResult rtrn; PreserveInfo new; @@ -805,7 +805,7 @@ AddLevelName(KeyTypeInfo * type, } static Bool -SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value) +SetLevelName(KeyTypeInfo *type, const ExprDef *arrayNdx, const ExprDef *value) { ExprResult rtrn; unsigned level; @@ -844,10 +844,9 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value) * @param field The field to parse (e.g. modifiers, map, level_name) */ static Bool -SetKeyTypeField(KeyTypeInfo * type, - XkbDescPtr xkb, - const char *field, - ExprDef * arrayNdx, ExprDef * value, KeyTypesInfo * info) +SetKeyTypeField(KeyTypeInfo * type, XkbDescPtr xkb, const char *field, + const ExprDef *arrayNdx, const ExprDef *value, + KeyTypesInfo *info) { if (uStrCaseCmp(field, "modifiers") == 0) { @@ -904,7 +903,7 @@ SetKeyTypeField(KeyTypeInfo * type, } static Bool -HandleKeyTypeVar(VarDef * stmt, XkbDescPtr xkb, KeyTypesInfo * info) +HandleKeyTypeVar(const VarDef *stmt, XkbDescPtr xkb, KeyTypesInfo *info) { ExprResult elem, field; ExprDef *arrayNdx; @@ -929,8 +928,8 @@ HandleKeyTypeVar(VarDef * stmt, XkbDescPtr xkb, KeyTypesInfo * info) } static int -HandleKeyTypeBody(VarDef * def, - XkbDescPtr xkb, KeyTypeInfo * type, KeyTypesInfo * info) +HandleKeyTypeBody(const VarDef *def, XkbDescPtr xkb, + KeyTypeInfo *type, KeyTypesInfo *info) { int ok = 1; ExprResult tmp, field; @@ -956,8 +955,8 @@ HandleKeyTypeBody(VarDef * def, * */ static int -HandleKeyTypeDef(KeyTypeDef * def, - XkbDescPtr xkb, unsigned merge, KeyTypesInfo * info) +HandleKeyTypeDef(const KeyTypeDef *def, + XkbDescPtr xkb, unsigned merge, KeyTypesInfo *info) { KeyTypeInfo type = { .defs.defined = 0, |