More useful errors for invalid keysyms Instead of generating a fairly droll internal error, generate a warning also telling us exactly where the bad definition was. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 044c715..f9e0199 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -648,8 +648,8 @@ HandleInterpDef(InterpDef * def, struct xkb_desc * xkb, unsigned merge,
si.defs.merge = merge;
if (!LookupKeysym(def->sym, &si.interp.sym))
{
- WARN("Could not resolve keysym %s\n", def->sym);
- info->errorCount++;
+ ERROR("Could not resolve keysym %s\n", def->sym);
+ ACTION("Symbol interpretation ignored\n");
return False;
}
si.interp.match = pred & XkbSI_OpMask;
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 1065e16..7391251 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -898,31 +898,32 @@ AddSymbolsToKey(KeyInfo * key,
}
if (value->op != ExprKeysymList)
{
- ERROR("Expected a list of symbols, found %s\n",
- exprOpText(value->op));
+ ERROR("Expected a list of symbols, found %s\n", exprOpText(value->op));
ACTION("Ignoring symbols for group %d of %s\n", ndx,
longText(key->name));
return False;
}
if (key->syms[ndx] != NULL)
{
- WSGO("Symbols for key %s, group %d already defined\n",
- longText(key->name), ndx);
+ ERROR("Symbols for key %s, group %d already defined\n",
+ longText(key->name), ndx);
+ ACTION("Ignoring duplicate definition\n");
return False;
}
nSyms = value->value.list.nSyms;
if (((key->numLevels[ndx] < nSyms) || (key->syms[ndx] == NULL)) &&
(!ResizeKeyGroup(key, ndx, nSyms, False)))
{
- WSGO("Could not resize group %d of key %s\n", ndx,
- longText(key->name));
+ WSGO("Could not resize group %d of key %s to contain %d levels\n", ndx,
+ longText(key->name), nSyms);
ACTION("Symbols lost\n");
return False;
}
key->symsDefined |= (1 << ndx);
for (i = 0; i < nSyms; i++) {
if (!LookupKeysym(value->value.list.syms[i], &key->syms[ndx][i])) {
- WSGO("Could not resolve keysym %s\n", value->value.list.syms[i]);
+ WARN("Could not resolve keysym %s for key %s, group %d, level %d\n",
+ value->value.list.syms[i], longText(key->name), ndx, nSyms);
key->syms[ndx][i] = NoSymbol;
}
}