From: Daniel Stone Date: Fri, 16 Mar 2012 14:22:04 +0000 (+0000) Subject: More useful errors for invalid keysyms X-Git-Tag: xkbcommon-0.2.0~725 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7dbd3040212be363bcc239826bb1a247448ff28d;p=platform%2Fupstream%2Flibxkbcommon.git 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 --- 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; } }