summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-08-19 14:35:39 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-08-21 17:28:26 +0930
commit391ea45b2cadc7faeb6acb5d9ec7b405d67d46fd (patch)
tree16f8125b2aa867735e2a1482ac554549300ac4dc
parentf05f20fd203afdadbcd571023ed31638ccda1f88 (diff)
Don't pass useless handlers around in HandleIncludeKeycodes.
What use is a handler if we only ever use one function anyway?
-rw-r--r--keycodes.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/keycodes.c b/keycodes.c
index d848a0c..2c28932 100644
--- a/keycodes.c
+++ b/keycodes.c
@@ -81,6 +81,11 @@ typedef struct _KeyNamesInfo
AliasInfo *aliases;
} KeyNamesInfo;
+static void HandleKeycodesFile(XkbFile * file,
+ XkbDescPtr xkb,
+ unsigned merge,
+ KeyNamesInfo * info);
+
static void
InitIndicatorNameInfo(IndicatorNameInfo * ii, KeyNamesInfo * info)
{
@@ -483,12 +488,6 @@ MergeIncludedKeycodes(KeyNamesInfo * into, KeyNamesInfo * from,
return;
}
-typedef void (*FileHandler) (XkbFile * /* rtrn */ ,
- XkbDescPtr /* xkb */ ,
- unsigned /* merge */ ,
- KeyNamesInfo * /* included */
- );
-
/**
* Handle the given include statement (e.g. "include "evdev+aliases(qwerty)").
*
@@ -497,8 +496,7 @@ typedef void (*FileHandler) (XkbFile * /* rtrn */ ,
* @param info Struct to store the key info in.
*/
static Bool
-HandleIncludeKeycodes(IncludeStmt * stmt,
- XkbDescPtr xkb, KeyNamesInfo * info, FileHandler hndlr)
+HandleIncludeKeycodes(IncludeStmt * stmt, XkbDescPtr xkb, KeyNamesInfo * info)
{
unsigned newMerge;
XkbFile *rtrn;
@@ -522,7 +520,7 @@ HandleIncludeKeycodes(IncludeStmt * stmt,
else if (ProcessIncludeFile(stmt, XkmKeyNamesIndex, &rtrn, &newMerge))
{
InitKeyNamesInfo(&included);
- (*hndlr) (rtrn, xkb, MergeOverride, &included);
+ HandleKeycodesFile(rtrn, xkb, MergeOverride, &included);
if (stmt->stmt != NULL)
{
if (included.name != NULL)
@@ -554,7 +552,7 @@ HandleIncludeKeycodes(IncludeStmt * stmt,
else if (ProcessIncludeFile(next, XkmKeyNamesIndex, &rtrn, &op))
{
InitKeyNamesInfo(&next_incl);
- (*hndlr) (rtrn, xkb, MergeOverride, &next_incl);
+ HandleKeycodesFile(rtrn, xkb, MergeOverride, &next_incl);
MergeIncludedKeycodes(&included, &next_incl, op);
ClearKeyNamesInfo(&next_incl);
}
@@ -763,8 +761,7 @@ HandleKeycodesFile(XkbFile * file,
switch (stmt->stmtType)
{
case StmtInclude: /* e.g. include "evdev+aliases(qwerty)" */
- if (!HandleIncludeKeycodes((IncludeStmt *) stmt, xkb, info,
- HandleKeycodesFile))
+ if (!HandleIncludeKeycodes((IncludeStmt *) stmt, xkb, info))
info->errorCount++;
break;
case StmtKeycodeDef: /* e.g. <ESC> = 9; */