From 9510dedad875099c32993246188050ea73ab1a9f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 21 Jan 2021 13:08:25 +1000 Subject: 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 --- action.c | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'action.c') diff --git a/action.c b/action.c index 2698e09..a984bc7 100644 --- a/action.c +++ b/action.c @@ -299,8 +299,8 @@ fieldText(unsigned field) static Bool ReportMismatch(unsigned action, unsigned field, const char *type) { - ERROR2("Value of %s field must be of type %s\n", fieldText(field), type); - ACTION1("Action %s definition ignored\n", + ERROR("Value of %s field must be of type %s\n", fieldText(field), type); + ACTION("Action %s definition ignored\n", XkbActionTypeText(action, XkbMessage)); return False; } @@ -308,7 +308,7 @@ ReportMismatch(unsigned action, unsigned field, const char *type) static Bool ReportIllegal(unsigned action, unsigned field) { - ERROR2("Field %s is not defined for an action of type %s\n", + ERROR("Field %s is not defined for an action of type %s\n", fieldText(field), XkbActionTypeText(action, XkbMessage)); ACTION("Action definition ignored\n"); return False; @@ -317,7 +317,7 @@ ReportIllegal(unsigned action, unsigned field) static Bool ReportActionNotArray(unsigned action, unsigned field) { - ERROR2("The %s field in the %s action is not an array\n", + ERROR("The %s field in the %s action is not an array\n", fieldText(field), XkbActionTypeText(action, XkbMessage)); ACTION("Action definition ignored\n"); return False; @@ -326,8 +326,8 @@ ReportActionNotArray(unsigned action, unsigned field) static Bool ReportNotFound(unsigned action, unsigned field, const char *what, char *bad) { - ERROR2("%s named %s not found\n", what, bad); - ACTION2("Ignoring the %s field of an %s action\n", fieldText(field), + ERROR("%s named %s not found\n", what, bad); + ACTION("Ignoring the %s field of an %s action\n", fieldText(field), XkbActionTypeText(action, XkbMessage)); return False; } @@ -513,9 +513,9 @@ CheckGroupField(unsigned action, return ReportMismatch(action, F_Group, "integer (range 1..8)"); if ((rtrn.ival < 1) || (rtrn.ival > XkbNumKbdGroups)) { - ERROR2("Illegal group %d (must be in the range 1..%d)\n", rtrn.ival, + ERROR("Illegal group %d (must be in the range 1..%d)\n", rtrn.ival, XkbNumKbdGroups); - ACTION1("Action %s definition ignored\n", + ACTION("Action %s definition ignored\n", XkbActionTypeText(action, XkbMessage)); return False; } @@ -677,7 +677,7 @@ HandlePtrBtn(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 5)) { ERROR("Button must specify default or be in the range 1..5\n"); - ACTION1("Illegal button value %d ignored\n", rtrn.ival); + ACTION("Illegal button value %d ignored\n", rtrn.ival); return False; } act->button = rtrn.ival; @@ -703,7 +703,7 @@ HandlePtrBtn(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("The count field must have a value in the range 0..255\n"); - ACTION1("Illegal count %d ignored\n", rtrn.ival); + ACTION("Illegal count %d ignored\n", rtrn.ival); return False; } act->count = rtrn.ival; @@ -760,7 +760,7 @@ HandleSetPtrDflt(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 5)) { ERROR("New default button value must be in the range 1..5\n"); - ACTION1("Illegal default button value %d ignored\n", rtrn.ival); + ACTION("Illegal default button value %d ignored\n", rtrn.ival); return False; } if (rtrn.ival == 0) @@ -876,7 +876,7 @@ HandleSwitchScreen(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("Screen index must be in the range 1..255\n"); - ACTION1("Illegal screen value %d ignored\n", rtrn.ival); + ACTION("Illegal screen value %d ignored\n", rtrn.ival); return False; } if (value->op == OpNegate) @@ -1020,7 +1020,7 @@ HandleActionMessage(XkbDescPtr xkb, if ((len < 1) || (len > 6)) { WARN("An action message can hold only 6 bytes\n"); - ACTION1("Extra %d bytes ignored\n", len - 6); + ACTION("Extra %d bytes ignored\n", len - 6); } strncpy((char *) act->message, rtrn.str, 6); } @@ -1039,7 +1039,7 @@ HandleActionMessage(XkbDescPtr xkb, if (ndx > 5) { ERROR("An action message is at most 6 bytes long\n"); - ACTION1("Attempt to use data[%d] ignored\n", ndx); + ACTION("Attempt to use data[%d] ignored\n", ndx); return False; } if (!ExprResolveInteger(value, &rtrn, NULL, NULL)) @@ -1047,7 +1047,7 @@ HandleActionMessage(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("Message data must be in the range 0..255\n"); - ACTION1("Illegal datum %d ignored\n", rtrn.ival); + ACTION("Illegal datum %d ignored\n", rtrn.ival); return False; } act->message[ndx] = rtrn.uval; @@ -1132,7 +1132,7 @@ HandleDeviceBtn(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("Button must specify default or be in the range 1..255\n"); - ACTION1("Illegal button value %d ignored\n", rtrn.ival); + ACTION("Illegal button value %d ignored\n", rtrn.ival); return False; } act->button = rtrn.ival; @@ -1158,7 +1158,7 @@ HandleDeviceBtn(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("The count field must have a value in the range 0..255\n"); - ACTION1("Illegal count %d ignored\n", rtrn.ival); + ACTION("Illegal count %d ignored\n", rtrn.ival); return False; } act->count = rtrn.ival; @@ -1174,7 +1174,7 @@ HandleDeviceBtn(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("Device must specify default or be in the range 1..255\n"); - ACTION1("Illegal device value %d ignored\n", rtrn.ival); + ACTION("Illegal device value %d ignored\n", rtrn.ival); return False; } act->device = rtrn.ival; @@ -1213,7 +1213,7 @@ HandlePrivate(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("Private action type must be in the range 0..255\n"); - ACTION1("Illegal type %d ignored\n", rtrn.ival); + ACTION("Illegal type %d ignored\n", rtrn.ival); return False; } action->type = rtrn.uval; @@ -1229,7 +1229,7 @@ HandlePrivate(XkbDescPtr xkb, if ((len < 1) || (len > 7)) { WARN("A private action has 7 data bytes\n"); - ACTION1("Extra %d bytes ignored\n", len - 6); + ACTION("Extra %d bytes ignored\n", len - 6); return False; } strncpy((char *) action->data, rtrn.str, 7); @@ -1249,7 +1249,7 @@ HandlePrivate(XkbDescPtr xkb, if (ndx > 6) { ERROR("The data for a private action is 7 bytes long\n"); - ACTION1("Attempt to use data[%d] ignored\n", ndx); + ACTION("Attempt to use data[%d] ignored\n", ndx); return False; } if (!ExprResolveInteger(value, &rtrn, NULL, NULL)) @@ -1257,7 +1257,7 @@ HandlePrivate(XkbDescPtr xkb, if ((rtrn.ival < 0) || (rtrn.ival > 255)) { ERROR("All data for a private action must be 0..255\n"); - ACTION1("Illegal datum %d ignored\n", rtrn.ival); + ACTION("Illegal datum %d ignored\n", rtrn.ival); return False; } action->data[ndx] = rtrn.uval; @@ -1332,7 +1332,7 @@ HandleActionDef(ExprDef * def, if (def->op != ExprActionDecl) { - ERROR1("Expected an action definition, found %s\n", + ERROR("Expected an action definition, found %s\n", exprOpText(def->op)); return False; } @@ -1344,7 +1344,7 @@ HandleActionDef(ExprDef * def, } if (!stringToAction(str, &tmp)) { - ERROR1("Unknown action %s\n", str); + ERROR("Unknown action %s\n", str); return False; } action->type = hndlrType = tmp; @@ -1398,13 +1398,13 @@ HandleActionDef(ExprDef * def, if (elemRtrn.str != NULL) { ERROR("Cannot change defaults in an action definition\n"); - ACTION2("Ignoring attempt to change %s.%s\n", elemRtrn.str, + ACTION("Ignoring attempt to change %s.%s\n", elemRtrn.str, fieldRtrn.str); return False; } if (!stringToField(fieldRtrn.str, &fieldNdx)) { - ERROR1("Unknown field name %s\n", uStringText(fieldRtrn.str)); + ERROR("Unknown field name %s\n", uStringText(fieldRtrn.str)); return False; } if (!(*handleAction[hndlrType]) @@ -1443,14 +1443,14 @@ SetActionField(XkbDescPtr xkb, return False; if (new->action == XkbSA_NoAction) { - ERROR1("\"%s\" is not a valid field in a NoAction action\n", + ERROR("\"%s\" is not a valid field in a NoAction action\n", field); return False; } } if (!stringToField(field, &new->field)) { - ERROR1("\"%s\" is not a legal field name\n", field); + ERROR("\"%s\" is not a legal field name\n", field); return False; } new->array_ndx = array_ndx; -- cgit v1.2.3