summaryrefslogtreecommitdiff
path: root/keycodes.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-01-21 13:08:25 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-01-21 14:11:37 +1000
commit9510dedad875099c32993246188050ea73ab1a9f (patch)
tree2471fbf77a8fef9e3e57ac4cb757472d6cb96016 /keycodes.c
parentff6a19ed8898ee8c79b2b2a2f87806353d89f5d4 (diff)
Replace WARN[1-9], ERROR[1-9], etc. with their unnumbered version
Those macros date back to when varargs weren't a thing but they've been #defined to the same value for 17 years now. Patch generated with: for action in WARN INFO ERROR ACTION FATAL WSGO; do sed -i "s/${action}[1-9]/${action}/g" `git ls-files` done Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'keycodes.c')
-rw-r--r--keycodes.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/keycodes.c b/keycodes.c
index 8dcc366..a125044 100644
--- a/keycodes.c
+++ b/keycodes.c
@@ -169,7 +169,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
|| (warningLevel > 9))
{
- WARN1("Multiple indicators named %s\n",
+ WARN("Multiple indicators named %s\n",
XkbAtomText(NULL, new->name, XkbMessage));
if (old->ndx == new->ndx)
{
@@ -177,7 +177,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
{
if (replace)
old->virtual = new->virtual;
- ACTION2("Using %s instead of %s\n",
+ ACTION("Using %s instead of %s\n",
(old->virtual ? "virtual" : "real"),
(old->virtual ? "real" : "virtual"));
}
@@ -190,9 +190,9 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
else
{
if (replace)
- ACTION2("Ignoring %d, using %d\n", old->ndx, new->ndx);
+ ACTION("Ignoring %d, using %d\n", old->ndx, new->ndx);
else
- ACTION2("Using %d, ignoring %d\n", old->ndx, new->ndx);
+ ACTION("Using %d, ignoring %d\n", old->ndx, new->ndx);
}
if (replace)
{
@@ -222,7 +222,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
|| (warningLevel > 9))
{
- WARN1("Multiple names for indicator %d\n", new->ndx);
+ WARN("Multiple names for indicator %d\n", new->ndx);
if ((old->name == new->name) && (old->virtual == new->virtual))
ACTION("Identical definitions ignored\n");
else
@@ -247,7 +247,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
using = old->name;
ignoring = new->name;
}
- ACTION4("Using %s %s, ignoring %s %s\n",
+ ACTION("Using %s %s, ignoring %s %s\n",
oldType, XkbAtomText(NULL, using, XkbMessage),
newType, XkbAtomText(NULL, ignoring, XkbMessage));
}
@@ -263,7 +263,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
new = NextIndicatorName(info);
if (!new)
{
- WSGO1("Couldn't allocate name for indicator %d\n", old->ndx);
+ WSGO("Couldn't allocate name for indicator %d\n", old->ndx);
ACTION("Ignored\n");
return False;
}
@@ -334,10 +334,10 @@ AddKeyName(KeyNamesInfo * info,
{
if (!high_keycode_warned && warningLevel > 1)
{
- WARN2("Unsupported high keycode %d for name <%s> ignored\n",
+ WARN("Unsupported high keycode %d for name <%s> ignored\n",
kc, name);
- ACTION2("X11 cannot support keycodes above 255.\n");
- ACTION2("This warning only shows for the first high keycode.\n");
+ ACTION("X11 cannot support keycodes above 255.\n");
+ ACTION("This warning only shows for the first high keycode.\n");
high_keycode_warned = True;
}
return True;
@@ -370,7 +370,7 @@ AddKeyName(KeyNamesInfo * info,
else if (reportCollisions)
{
WARN("Multiple identical key name definitions\n");
- ACTION2("Later occurrences of \"<%s> = %d\" ignored\n",
+ ACTION("Later occurrences of \"<%s> = %d\" ignored\n",
buf, kc);
}
return True;
@@ -379,8 +379,8 @@ AddKeyName(KeyNamesInfo * info,
{
if (reportCollisions)
{
- WARN1("Multiple names for keycode %d\n", kc);
- ACTION2("Using <%s>, ignoring <%s>\n", buf, name);
+ WARN("Multiple names for keycode %d\n", kc);
+ ACTION("Using <%s>, ignoring <%s>\n", buf, name);
}
return True;
}
@@ -388,8 +388,8 @@ AddKeyName(KeyNamesInfo * info,
{
if (reportCollisions)
{
- WARN1("Multiple names for keycode %d\n", kc);
- ACTION2("Using <%s>, ignoring <%s>\n", name, buf);
+ WARN("Multiple names for keycode %d\n", kc);
+ ACTION("Using <%s>, ignoring <%s>\n", name, buf);
}
info->names[kc] = 0;
info->files[kc] = 0;
@@ -405,16 +405,16 @@ AddKeyName(KeyNamesInfo * info,
info->has_alt_forms[old] = True;
if (reportCollisions)
{
- WARN1("Key name <%s> assigned to multiple keys\n", name);
- ACTION2("Using %d, ignoring %d\n", kc, old);
+ WARN("Key name <%s> assigned to multiple keys\n", name);
+ ACTION("Using %d, ignoring %d\n", kc, old);
}
}
else if (merge != MergeAltForm)
{
if ((reportCollisions) && (warningLevel > 3))
{
- WARN1("Key name <%s> assigned to multiple keys\n", name);
- ACTION2("Using %d, ignoring %d\n", old, kc);
+ WARN("Key name <%s> assigned to multiple keys\n", name);
+ ACTION("Using %d, ignoring %d\n", old, kc);
ACTION
("Use 'alternate' keyword to assign the same name to multiple keys\n");
}
@@ -590,7 +590,7 @@ HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info)
if (!ExprResolveInteger(stmt->value, &result, NULL, NULL))
{
- ACTION1("No value keycode assigned to name <%s>\n", stmt->name);
+ ACTION("No value keycode assigned to name <%s>\n", stmt->name);
return 0;
}
code = result.ival;
@@ -598,10 +598,10 @@ HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info)
{
if (!high_keycode_warned && warningLevel > 1)
{
- WARN2("Unsupported high keycode %d for name <%s> ignored\n",
+ WARN("Unsupported high keycode %d for name <%s> ignored\n",
code, stmt->name);
- ACTION2("X11 cannot support keycodes above 255.\n");
- ACTION2("This warning only shows for the first high keycode.\n");
+ ACTION("X11 cannot support keycodes above 255.\n");
+ ACTION("This warning only shows for the first high keycode.\n");
high_keycode_warned = True;
}
return 1;
@@ -637,8 +637,8 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info)
if (tmp.str != NULL)
{
- ERROR1("Unknown element %s encountered\n", tmp.str);
- ACTION1("Default for field %s ignored\n", field.str);
+ ERROR("Unknown element %s encountered\n", tmp.str);
+ ACTION("Default for field %s ignored\n", field.str);
return 0;
}
if (uStrCaseCmp(field.str, "minimum") == 0)
@@ -648,33 +648,33 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info)
else
{
ERROR("Unknown field encountered\n");
- ACTION1("Assignment to field %s ignored\n", field.str);
+ ACTION("Assignment to field %s ignored\n", field.str);
return 0;
}
if (arrayNdx != NULL)
{
- ERROR1("The %s setting is not an array\n", field.str);
+ ERROR("The %s setting is not an array\n", field.str);
ACTION("Illegal array reference ignored\n");
return 0;
}
if (ExprResolveInteger(stmt->value, &tmp, NULL, NULL) == 0)
{
- ACTION1("Assignment to field %s ignored\n", field.str);
+ ACTION("Assignment to field %s ignored\n", field.str);
return 0;
}
if ((tmp.ival < XkbMinLegalKeyCode))
{
- ERROR3
+ ERROR
("Illegal keycode %d (must be in the range %d-%d inclusive)\n",
tmp.ival, XkbMinLegalKeyCode, XkbMaxLegalKeyCode);
- ACTION1("Value of \"%s\" not changed\n", field.str);
+ ACTION("Value of \"%s\" not changed\n", field.str);
return 0;
}
if ((tmp.ival > XkbMaxLegalKeyCode))
{
- WARN2("Unsupported maximum keycode %d, clipping.\n", tmp.ival);
- ACTION2("X11 cannot support keycodes above 255.\n");
+ WARN("Unsupported maximum keycode %d, clipping.\n", tmp.ival);
+ ACTION("X11 cannot support keycodes above 255.\n");
info->explicitMax = XkbMaxLegalKeyCode;
info->effectiveMax = XkbMaxLegalKeyCode;
return 1;
@@ -683,7 +683,7 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info)
{
if ((info->explicitMax > 0) && (info->explicitMax < tmp.ival))
{
- ERROR2
+ ERROR
("Minimum key code (%d) must be <= maximum key code (%d)\n",
tmp.ival, info->explicitMax);
ACTION("Minimum key code value not changed\n");
@@ -691,7 +691,7 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info)
}
if ((info->computedMax > 0) && (info->computedMin < tmp.ival))
{
- ERROR2
+ ERROR
("Minimum key code (%d) must be <= lowest defined key (%d)\n",
tmp.ival, info->computedMin);
ACTION("Minimum key code value not changed\n");
@@ -704,14 +704,14 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info)
{
if ((info->explicitMin > 0) && (info->explicitMin > tmp.ival))
{
- ERROR2("Maximum code (%d) must be >= minimum key code (%d)\n",
+ ERROR("Maximum code (%d) must be >= minimum key code (%d)\n",
tmp.ival, info->explicitMin);
ACTION("Maximum code value not changed\n");
return 0;
}
if ((info->computedMax > 0) && (info->computedMax > tmp.ival))
{
- ERROR2
+ ERROR
("Maximum code (%d) must be >= highest defined key (%d)\n",
tmp.ival, info->computedMax);
ACTION("Maximum code value not changed\n");
@@ -733,7 +733,7 @@ HandleIndicatorNameDef(IndicatorNameDef * def,
if ((def->ndx < 1) || (def->ndx > XkbNumIndicators))
{
info->errorCount++;
- ERROR1("Name specified for illegal indicator index %d\n", def->ndx);
+ ERROR("Name specified for illegal indicator index %d\n", def->ndx);
ACTION("Ignored\n");
return False;
}
@@ -805,14 +805,14 @@ HandleKeycodesFile(XkbFile * file,
case StmtInterpDef:
case StmtVModDef:
ERROR("Keycode files may define key and indicator names only\n");
- ACTION1("Ignoring definition of %s\n",
+ ACTION("Ignoring definition of %s\n",
((stmt->stmtType ==
StmtInterpDef) ? "a symbol interpretation" :
"virtual modifiers"));
info->errorCount++;
break;
default:
- WSGO1("Unexpected statement type %d in HandleKeycodesFile\n",
+ WSGO("Unexpected statement type %d in HandleKeycodesFile\n",
stmt->stmtType);
break;
}
@@ -822,7 +822,7 @@ HandleKeycodesFile(XkbFile * file,
#ifdef NOISY
ERROR("Too many errors\n");
#endif
- ACTION1("Abandoning keycodes file \"%s\"\n", file->topName);
+ ACTION("Abandoning keycodes file \"%s\"\n", file->topName);
break;
}
}