Remove FileHandler callback argument
authorRan Benita <ran234@gmail.com>
Sun, 13 May 2012 14:21:02 +0000 (17:21 +0300)
committername <email>
Fri, 18 May 2012 17:54:33 +0000 (20:54 +0300)
It's unneeded; the same function is always passed.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/compat.c
src/xkbcomp/keytypes.c
src/xkbcomp/symbols.c

index f8b32a7c23a99145a24167909d637c93c0525b66..a2a414392cdcd0dbd5c38b2fb16b1fbaa3681205 100644 (file)
@@ -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:
index 4e4ac043414bdad90b1a5e9ad51df0b9bb0651f6..b8b019b93cdc22fa0bc867f3835b71d51d468e3c 100644 (file)
@@ -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" */
index b54343c7ff85db7dff65440cd19f68434b02500b..9c26e232ef90ec4505b232b0a1046f0c31554820 100644 (file)
@@ -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: