From 76eed4986b8c94008853c2215408a100b7e95ecb Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 11 Jul 2022 09:16:55 +0200 Subject: suppress four more warnings when 'warningLevel' is zero This addresses issue #20 some more. Reported-by: Vincent Lefevre Signed-off-by: Benno Schulenberg --- compat.c | 2 +- indicators.c | 2 +- symbols.c | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compat.c b/compat.c index 8a883c9..757ef42 100644 --- a/compat.c +++ b/compat.c @@ -246,7 +246,7 @@ AddInterp(CompatInfo * info, SymInterpInfo * new) old->interp.match |= (new->interp.match & XkbSI_LevelOneOnly); old->defs.defined |= _SI_LevelOneOnly; } - if (collide) + if (collide && (warningLevel > 0)) { WARN("Multiple interpretations of \"%s\"\n", siText(new, info)); ACTION("Using %s definition for duplicate fields\n", diff --git a/indicators.c b/indicators.c index 0beb2d6..b3e7d18 100644 --- a/indicators.c +++ b/indicators.c @@ -133,7 +133,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new) old->flags |= (new->flags & XkbIM_LEDDrivesKB); old->defs.defined |= _LED_DrivesKbd; } - if (collide) + if (collide && (warningLevel > 0)) { WARN("Map for indicator %s redefined\n", XkbAtomText(NULL, old->name, XkbMessage)); diff --git a/symbols.c b/symbols.c index 803de7e..06e5095 100644 --- a/symbols.c +++ b/symbols.c @@ -588,7 +588,7 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from) into->groupInfo = from->groupInfo; into->defs.defined |= _Key_GroupInfo; } - if (collide) + if (collide && (warningLevel > 0)) { WARN("Symbol map for key %s redefined\n", longText(into->name, XkbMessage)); @@ -1537,10 +1537,13 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key) if ((key->typesDefined | key->symsDefined | key->actsDefined) & ~1) { int i; - WARN("For the map %s an explicit group specified\n", info->name); - WARN("but key %s has more than one group defined\n", - longText(key->name, XkbMessage)); - ACTION("All groups except first one will be ignored\n"); + if (warningLevel > 0) + { + WARN("For map %s an explicit group is specified\n", info->name); + WARN("but key %s has more than one group defined\n", + longText(key->name, XkbMessage)); + ACTION("All groups except first one will be ignored\n"); + } for (i = 1; i < XkbNumKbdGroups; i++) { key->numLevels[i] = 0; -- cgit v1.2.3