summaryrefslogtreecommitdiff
path: root/compat.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 /compat.c
parent299c9762b1dbe53f3297c54e5526aeae767d1a10 (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 'compat.c')
-rw-r--r--compat.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/compat.c b/compat.c
index e23fd76..26f4249 100644
--- a/compat.c
+++ b/compat.c
@@ -81,7 +81,7 @@ typedef struct _CompatInfo
/***====================================================================***/
static char *
-siText(SymInterpInfo * si, CompatInfo * info)
+siText(const SymInterpInfo *si, const CompatInfo *info)
{
static char buf[128];
@@ -170,7 +170,7 @@ NextInterp(CompatInfo * info)
}
static SymInterpInfo *
-FindMatchingInterp(CompatInfo * info, SymInterpInfo * new)
+FindMatchingInterp(CompatInfo *info, const SymInterpInfo *new)
{
SymInterpInfo *old;
@@ -255,7 +255,7 @@ AddInterp(CompatInfo * info, SymInterpInfo * new)
}
static Bool
-AddGroupCompat(CompatInfo * info, unsigned group, GroupCompatInfo * newGC)
+AddGroupCompat(CompatInfo *info, unsigned group, const GroupCompatInfo *newGC)
{
GroupCompatInfo *gc;
unsigned merge;
@@ -281,9 +281,9 @@ AddGroupCompat(CompatInfo * info, unsigned group, GroupCompatInfo * newGC)
/***====================================================================***/
static Bool
-ResolveStateAndPredicate(ExprDef * expr,
- unsigned *pred_rtrn,
- unsigned *mods_rtrn, CompatInfo * info)
+ResolveStateAndPredicate(const ExprDef *expr,
+ unsigned *pred_rtrn, unsigned *mods_rtrn,
+ const CompatInfo *info)
{
ExprResult result;
@@ -386,14 +386,14 @@ MergeIncludedCompatMaps(CompatInfo * into, CompatInfo * from, unsigned merge)
return;
}
-typedef void (*FileHandler) (XkbFile * /* rtrn */ ,
+typedef void (*FileHandler) (const XkbFile * /* rtrn */ ,
XkbDescPtr /* xkb */ ,
unsigned /* merge */ ,
CompatInfo * /* info */
);
static Bool
-HandleIncludeCompatMap(IncludeStmt * stmt,
+HandleIncludeCompatMap(IncludeStmt *stmt,
XkbDescPtr xkb, CompatInfo * info, FileHandler hndlr)
{
unsigned newMerge;
@@ -485,10 +485,9 @@ static LookupEntry useModMapValues[] = {
};
static int
-SetInterpField(SymInterpInfo * si,
- XkbDescPtr xkb,
- const char *field,
- ExprDef * arrayNdx, ExprDef * value, CompatInfo * info)
+SetInterpField(SymInterpInfo *si, XkbDescPtr xkb, const char *field,
+ const ExprDef *arrayNdx, const ExprDef *value,
+ const CompatInfo *info)
{
int ok = 1;
ExprResult tmp;
@@ -597,7 +596,7 @@ LookupEntry groupNames[] = {
};
static int
-HandleInterpVar(VarDef * stmt, XkbDescPtr xkb, CompatInfo * info)
+HandleInterpVar(const VarDef *stmt, XkbDescPtr xkb, CompatInfo *info)
{
ExprResult elem, field;
ExprDef *ndx;
@@ -617,8 +616,8 @@ HandleInterpVar(VarDef * stmt, XkbDescPtr xkb, CompatInfo * info)
}
static int
-HandleInterpBody(VarDef * def, XkbDescPtr xkb, SymInterpInfo * si,
- CompatInfo * info)
+HandleInterpBody(const VarDef *def, XkbDescPtr xkb, SymInterpInfo *si,
+ CompatInfo *info)
{
int ok = 1;
ExprResult tmp, field;
@@ -640,8 +639,8 @@ HandleInterpBody(VarDef * def, XkbDescPtr xkb, SymInterpInfo * si,
}
static int
-HandleInterpDef(InterpDef * def, XkbDescPtr xkb, unsigned merge,
- CompatInfo * info)
+HandleInterpDef(const InterpDef *def, XkbDescPtr xkb, unsigned merge,
+ CompatInfo *info)
{
unsigned pred, mods;
SymInterpInfo si;
@@ -682,8 +681,8 @@ HandleInterpDef(InterpDef * def, XkbDescPtr xkb, unsigned merge,
}
static int
-HandleGroupCompatDef(GroupCompatDef * def,
- XkbDescPtr xkb, unsigned merge, CompatInfo * info)
+HandleGroupCompatDef(const GroupCompatDef *def,
+ XkbDescPtr xkb, unsigned merge, CompatInfo *info)
{
ExprResult val;
GroupCompatInfo tmp;
@@ -714,8 +713,8 @@ HandleGroupCompatDef(GroupCompatDef * def,
}
static void
-HandleCompatMapFile(XkbFile * file,
- XkbDescPtr xkb, unsigned merge, CompatInfo * info)
+HandleCompatMapFile(const XkbFile *file,
+ XkbDescPtr xkb, unsigned merge, CompatInfo *info)
{
ParseCommon *stmt;
@@ -784,7 +783,7 @@ HandleCompatMapFile(XkbFile * file,
}
static void
-CopyInterps(CompatInfo * info,
+CopyInterps(const CompatInfo *info,
XkbCompatMapPtr compat, Bool needSymbol, unsigned pred)
{
for (SymInterpInfo *si = info->interps; si;
@@ -806,8 +805,8 @@ CopyInterps(CompatInfo * info,
}
Bool
-CompileCompatMap(XkbFile * file,
- XkbFileInfo * result, unsigned merge, LEDInfo ** unboundLEDs)
+CompileCompatMap(const XkbFile *file,
+ XkbFileInfo *result, unsigned merge, LEDInfo **unboundLEDs)
{
CompatInfo info;
XkbDescPtr xkb;