Commit 376e45eb6d2d93599980e52248531a8f2e83470f

Ran Benita 2012-09-12T21:32:25

symbols: remove mention of keycodes in CopySymbolsDef Since now we only use the keycode in this function for logging, it's better not to mention the keycode at all because the XkbKeyGetKeycode macro is implemented using a dirty hack 0_0 The key name is sufficient to determine uniquely where to look. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index a9879ec..ff089e7 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1494,7 +1494,6 @@ static bool
 CopySymbolsDef(SymbolsInfo *info, KeyInfo *keyi)
 {
     struct xkb_keymap *keymap = info->keymap;
-    xkb_keycode_t kc;
     struct xkb_key *key;
     unsigned int sizeSyms = 0;
     xkb_group_index_t i, nGroups;
@@ -1511,7 +1510,6 @@ CopySymbolsDef(SymbolsInfo *info, KeyInfo *keyi)
                 LongKeyNameText(keyi->name));
         return false;
     }
-    kc = XkbKeyGetKeycode(keymap, key);
 
     haveActions = false;
     width = 0;
@@ -1543,10 +1541,10 @@ CopySymbolsDef(SymbolsInfo *info, KeyInfo *keyi)
             else
                 log_vrb(info->keymap->ctx, 5,
                         "No automatic type for %d levels; "
-                        "Using %s for the %s key (keycode %d)\n",
+                        "Using %s for the %s key\n",
                         darray_size(groupi->levels),
                         xkb_atom_text(keymap->ctx, groupi->type),
-                        LongKeyNameText(keyi->name), kc);
+                        LongKeyNameText(keyi->name));
         }
 
         if (FindNamedType(keymap, groupi->type, &types[i])) {
@@ -1556,9 +1554,9 @@ CopySymbolsDef(SymbolsInfo *info, KeyInfo *keyi)
         else {
             log_vrb(info->keymap->ctx, 3,
                     "Type \"%s\" is not defined; "
-                    "Using default type for the %s key (keycode %d)\n",
+                    "Using default type for the %s key\n",
                     xkb_atom_text(keymap->ctx, groupi->type),
-                    LongKeyNameText(keyi->name), kc);
+                    LongKeyNameText(keyi->name));
             /*
              * Index 0 is guaranteed to contain something, usually
              * ONE_LEVEL or at least some default one-level type.
@@ -1740,9 +1738,8 @@ CompileSymbols(XkbFile *file, struct xkb_keymap *keymap,
 
             if (key->num_groups < 1)
                 log_info(info.keymap->ctx,
-                         "No symbols defined for %s (keycode %d)\n",
-                         KeyNameText(key->name),
-                         XkbKeyGetKeycode(keymap, key));
+                         "No symbols defined for %s\n",
+                         KeyNameText(key->name));
         }
     }