From 6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 11 Dec 2022 15:18:26 -0800 Subject: Mark more pointers as const Some suggested by cppcheck, others by manual code inspection Signed-off-by: Alan Coopersmith --- keycodes.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'keycodes.c') diff --git a/keycodes.c b/keycodes.c index 8e431c6..a9dc2b4 100644 --- a/keycodes.c +++ b/keycodes.c @@ -89,7 +89,7 @@ static void HandleKeycodesFile(XkbFile * file, KeyNamesInfo * info); static void -InitIndicatorNameInfo(IndicatorNameInfo * ii, KeyNamesInfo * info) +InitIndicatorNameInfo(IndicatorNameInfo *ii, const KeyNamesInfo *info) { ii->defs.defined = 0; ii->defs.merge = info->merge; @@ -298,7 +298,7 @@ InitKeyNamesInfo(KeyNamesInfo * info) } static int -FindKeyByLong(KeyNamesInfo * info, unsigned long name) +FindKeyByLong(const KeyNamesInfo *info, unsigned long name) { for (int i = info->effectiveMin; i <= info->effectiveMax; i++) { @@ -314,9 +314,8 @@ FindKeyByLong(KeyNamesInfo * info, unsigned long name) * Note that the key's name is stored as a long, the keycode is the index. */ static Bool -AddKeyName(KeyNamesInfo * info, - int kc, - char *name, unsigned merge, unsigned fileID, Bool reportCollisions) +AddKeyName(KeyNamesInfo *info, int kc, const char *name, + unsigned merge, unsigned fileID, Bool reportCollisions) { int old; unsigned long lval; @@ -569,7 +568,7 @@ HandleIncludeKeycodes(IncludeStmt * stmt, XkbDescPtr xkb, KeyNamesInfo * info) * e.g. = 9 */ static int -HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info) +HandleKeycodeDef(const KeycodeDef *stmt, unsigned merge, KeyNamesInfo *info) { int code; ExprResult result; @@ -610,7 +609,7 @@ HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info) * @return 1 on success, 0 otherwise. */ static int -HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info) +HandleKeyNameVar(const VarDef *stmt, KeyNamesInfo *info) { ExprResult tmp, field; ExprDef *arrayNdx; @@ -708,7 +707,7 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info) } static int -HandleIndicatorNameDef(IndicatorNameDef * def, +HandleIndicatorNameDef(const IndicatorNameDef *def, unsigned merge, KeyNamesInfo * info) { IndicatorNameInfo ii; -- cgit v1.2.3