From 2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0 Mon Sep 17 00:00:00 2001 From: M Stoeckl Date: Thu, 10 Jan 2019 18:27:21 -0500 Subject: Remove now-unused "input" argument of cmd_results_new Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))` applied to `cmd_results_new`. String usage constants have been converted from pointers to arrays when encountered. General handler format strings were sometimes modified to include the old input string, especially for unknown command errors. --- sway/commands/bar/colors.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sway/commands/bar/colors.c') diff --git a/sway/commands/bar/colors.c b/sway/commands/bar/colors.c index ebf1e3e1..7921db0d 100644 --- a/sway/commands/bar/colors.c +++ b/sway/commands/bar/colors.c @@ -25,11 +25,11 @@ static struct cmd_results *parse_single_color(char **color, if (!*color && !(*color = malloc(10))) { return NULL; } - error = add_color(cmd_name, *color, argv[0]); + error = add_color(*color, argv[0]); if (error) { return error; } - return cmd_results_new(CMD_SUCCESS, NULL, NULL); + return cmd_results_new(CMD_SUCCESS, NULL); } static struct cmd_results *parse_three_colors(char ***colors, @@ -37,18 +37,18 @@ static struct cmd_results *parse_three_colors(char ***colors, struct cmd_results *error = NULL; if (argc != 3) { return cmd_results_new(CMD_INVALID, - cmd_name, "Requires exactly three color values"); + "Command '%s' requires exactly three color values", cmd_name); } for (size_t i = 0; i < 3; i++) { if (!*colors[i] && !(*(colors[i]) = malloc(10))) { return NULL; } - error = add_color(cmd_name, *(colors[i]), argv[i]); + error = add_color(*(colors[i]), argv[i]); if (error) { return error; } } - return cmd_results_new(CMD_SUCCESS, NULL, NULL); + return cmd_results_new(CMD_SUCCESS, NULL); } struct cmd_results *bar_cmd_colors(int argc, char **argv) { -- cgit v1.2.3