summaryrefslogtreecommitdiff
path: root/keycodes.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 15:18:26 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-03 11:02:11 -0800
commit6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c (patch)
tree45171678d6b1fbfe936bb2586933d3e03c93500a /keycodes.c
parent299c9762b1dbe53f3297c54e5526aeae767d1a10 (diff)
downloadxorg-app-xkbcomp-6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c.tar.gz
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 'keycodes.c')
-rw-r--r--keycodes.c15
1 files changed, 7 insertions, 8 deletions
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. <ESC> = 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;