Commit a4c667adf285d8cfcfdea29cbf845abd4b180467

Ran Benita 2014-10-17T00:13:48

symbols: don't warn about conflicting syms if they are the same Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 1e70b84..bff7fb3 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -218,6 +218,19 @@ KeyInfoText(SymbolsInfo *info, KeyInfo *keyi)
 }
 
 static bool
+LevelsSameSyms(const struct xkb_level *a, const struct xkb_level *b)
+{
+    if (a->num_syms != b->num_syms)
+        return false;
+    if (a->num_syms <= 1)
+        return a->u.sym == b->u.sym;
+    else
+        return memcmp(a->u.syms, b->u.syms,
+                      sizeof(*a->u.syms) * a->num_syms) == 0;
+
+}
+
+static bool
 MergeGroups(SymbolsInfo *info, GroupInfo *into, GroupInfo *from, bool clobber,
             bool report, xkb_layout_index_t group, xkb_atom_t key_name)
 {
@@ -299,7 +312,7 @@ MergeGroups(SymbolsInfo *info, GroupInfo *into, GroupInfo *from, bool clobber,
                 intoLevel->u.sym = fromLevel->u.sym;
             fromLevel->num_syms = 0;
         }
-        else {
+        else if (!LevelsSameSyms(fromLevel, intoLevel)) {
             if (report)
                 log_warn(info->ctx,
                          "Multiple symbols for level %d/group %u on key %s; "