Remove FileHandler callback argument It's unneeded; the same function is always passed. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index f8b32a7..a2a4143 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -386,12 +386,13 @@ MergeIncludedCompatMaps(CompatInfo * into, CompatInfo * from, unsigned merge)
}
}
-typedef void (*FileHandler) (XkbFile *rtrn, struct xkb_keymap *keymap,
- unsigned merge, CompatInfo *info);
+static void
+HandleCompatMapFile(XkbFile *file, struct xkb_keymap *keymap, unsigned merge,
+ CompatInfo *info);
static bool
HandleIncludeCompatMap(IncludeStmt *stmt, struct xkb_keymap *keymap,
- CompatInfo *info, FileHandler hndlr)
+ CompatInfo *info)
{
unsigned newMerge;
XkbFile *rtrn;
@@ -416,7 +417,7 @@ HandleIncludeCompatMap(IncludeStmt *stmt, struct xkb_keymap *keymap,
included.ledDflt.defs.fileID = rtrn->id;
included.ledDflt.defs.merge = newMerge;
included.act = info->act;
- (*hndlr) (rtrn, keymap, MergeOverride, &included);
+ HandleCompatMapFile(rtrn, keymap, MergeOverride, &included);
if (stmt->stmt != NULL)
{
free(included.name);
@@ -457,7 +458,7 @@ HandleIncludeCompatMap(IncludeStmt *stmt, struct xkb_keymap *keymap,
next_incl.ledDflt.defs.fileID = rtrn->id;
next_incl.ledDflt.defs.merge = op;
next_incl.act = info->act;
- (*hndlr) (rtrn, keymap, MergeOverride, &next_incl);
+ HandleCompatMapFile(rtrn, keymap, MergeOverride, &next_incl);
MergeIncludedCompatMaps(&included, &next_incl, op);
if (info->act != NULL)
next_incl.act = NULL;
@@ -710,8 +711,7 @@ HandleCompatMapFile(XkbFile *file, struct xkb_keymap *keymap, unsigned merge,
switch (stmt->stmtType)
{
case StmtInclude:
- if (!HandleIncludeCompatMap((IncludeStmt *) stmt, keymap, info,
- HandleCompatMapFile))
+ if (!HandleIncludeCompatMap((IncludeStmt *) stmt, keymap, info))
info->errorCount++;
break;
case StmtInterpDef:
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index 4e4ac04..b8b019b 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -352,12 +352,13 @@ MergeIncludedKeyTypes(KeyTypesInfo *into, KeyTypesInfo *from,
into->stdPresent |= from->stdPresent;
}
-typedef void (*FileHandler) (XkbFile *file, struct xkb_keymap *keymap,
- unsigned merge, KeyTypesInfo *included);
+static void
+HandleKeyTypesFile(XkbFile *file, struct xkb_keymap *keymap,
+ unsigned merge, KeyTypesInfo *info);
static bool
HandleIncludeKeyTypes(IncludeStmt *stmt, struct xkb_keymap *keymap,
- KeyTypesInfo *info, FileHandler hndlr)
+ KeyTypesInfo *info)
{
unsigned newMerge;
XkbFile *rtrn;
@@ -378,7 +379,7 @@ HandleIncludeKeyTypes(IncludeStmt *stmt, struct xkb_keymap *keymap,
included.fileID = included.dflt.defs.fileID = rtrn->id;
included.dflt.defs.merge = newMerge;
- (*hndlr) (rtrn, keymap, newMerge, &included);
+ HandleKeyTypesFile(rtrn, keymap, newMerge, &included);
if (stmt->stmt != NULL)
{
free(included.name);
@@ -412,7 +413,7 @@ HandleIncludeKeyTypes(IncludeStmt *stmt, struct xkb_keymap *keymap,
InitKeyTypesInfo(&next_incl, keymap, &included);
next_incl.fileID = next_incl.dflt.defs.fileID = rtrn->id;
next_incl.dflt.defs.merge = op;
- (*hndlr) (rtrn, keymap, op, &next_incl);
+ HandleKeyTypesFile(rtrn, keymap, op, &next_incl);
MergeIncludedKeyTypes(&included, &next_incl, op, keymap);
FreeKeyTypesInfo(&next_incl);
FreeXKBFile(rtrn);
@@ -1017,8 +1018,7 @@ HandleKeyTypesFile(XkbFile *file, struct xkb_keymap *keymap,
switch (stmt->stmtType)
{
case StmtInclude:
- if (!HandleIncludeKeyTypes((IncludeStmt *) stmt, keymap, info,
- HandleKeyTypesFile))
+ if (!HandleIncludeKeyTypes((IncludeStmt *) stmt, keymap, info))
info->errorCount++;
break;
case StmtKeyTypeDef: /* e.g. type "ONE_LEVEL" */
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index b54343c..9c26e23 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -869,12 +869,13 @@ MergeIncludedSymbols(SymbolsInfo *into, SymbolsInfo *from,
into->errorCount++;
}
-typedef void (*FileHandler) (XkbFile *rtrn, struct xkb_keymap *keymap,
- unsigned merge, SymbolsInfo *included);
+static void
+HandleSymbolsFile(XkbFile *file, struct xkb_keymap *keymap,
+ unsigned merge, SymbolsInfo *info);
static bool
HandleIncludeSymbols(IncludeStmt *stmt, struct xkb_keymap *keymap,
- SymbolsInfo *info, FileHandler hndlr)
+ SymbolsInfo *info)
{
unsigned newMerge;
XkbFile *rtrn;
@@ -902,7 +903,7 @@ HandleIncludeSymbols(IncludeStmt *stmt, struct xkb_keymap *keymap,
{
included.explicit_group = info->explicit_group;
}
- (*hndlr) (rtrn, keymap, MergeOverride, &included);
+ HandleSymbolsFile(rtrn, keymap, MergeOverride, &included);
if (stmt->stmt != NULL)
{
free(included.name);
@@ -944,7 +945,7 @@ HandleIncludeSymbols(IncludeStmt *stmt, struct xkb_keymap *keymap,
{
next_incl.explicit_group = info->explicit_group;
}
- (*hndlr) (rtrn, keymap, MergeOverride, &next_incl);
+ HandleSymbolsFile(rtrn, keymap, MergeOverride, &next_incl);
MergeIncludedSymbols(&included, &next_incl, op, keymap);
FreeSymbolsInfo(&next_incl);
FreeXKBFile(rtrn);
@@ -1612,8 +1613,7 @@ HandleSymbolsFile(XkbFile *file, struct xkb_keymap *keymap,
switch (stmt->stmtType)
{
case StmtInclude:
- if (!HandleIncludeSymbols((IncludeStmt *) stmt, keymap, info,
- HandleSymbolsFile))
+ if (!HandleIncludeSymbols((IncludeStmt *) stmt, keymap, info))
info->errorCount++;
break;
case StmtSymbolsDef: