diff options
author | M Stoeckl <code@mstoeckl.com> | 2019-01-10 18:27:21 -0500 |
---|---|---|
committer | M Stoeckl <code@mstoeckl.com> | 2019-01-14 08:05:29 -0500 |
commit | 2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0 (patch) | |
tree | 56332b9c150459beb5aef94605372ef179ec8854 /sway/commands/bar/colors.c | |
parent | Remove 'input' field of IPC command return json (diff) | |
download | sway-2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0.tar.gz sway-2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0.tar.zst sway-2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0.zip |
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.
Diffstat (limited to 'sway/commands/bar/colors.c')
-rw-r--r-- | sway/commands/bar/colors.c | 10 |
1 files changed, 5 insertions, 5 deletions
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, | |||
25 | if (!*color && !(*color = malloc(10))) { | 25 | if (!*color && !(*color = malloc(10))) { |
26 | return NULL; | 26 | return NULL; |
27 | } | 27 | } |
28 | error = add_color(cmd_name, *color, argv[0]); | 28 | error = add_color(*color, argv[0]); |
29 | if (error) { | 29 | if (error) { |
30 | return error; | 30 | return error; |
31 | } | 31 | } |
32 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 32 | return cmd_results_new(CMD_SUCCESS, NULL); |
33 | } | 33 | } |
34 | 34 | ||
35 | static struct cmd_results *parse_three_colors(char ***colors, | 35 | static struct cmd_results *parse_three_colors(char ***colors, |
@@ -37,18 +37,18 @@ static struct cmd_results *parse_three_colors(char ***colors, | |||
37 | struct cmd_results *error = NULL; | 37 | struct cmd_results *error = NULL; |
38 | if (argc != 3) { | 38 | if (argc != 3) { |
39 | return cmd_results_new(CMD_INVALID, | 39 | return cmd_results_new(CMD_INVALID, |
40 | cmd_name, "Requires exactly three color values"); | 40 | "Command '%s' requires exactly three color values", cmd_name); |
41 | } | 41 | } |
42 | for (size_t i = 0; i < 3; i++) { | 42 | for (size_t i = 0; i < 3; i++) { |
43 | if (!*colors[i] && !(*(colors[i]) = malloc(10))) { | 43 | if (!*colors[i] && !(*(colors[i]) = malloc(10))) { |
44 | return NULL; | 44 | return NULL; |
45 | } | 45 | } |
46 | error = add_color(cmd_name, *(colors[i]), argv[i]); | 46 | error = add_color(*(colors[i]), argv[i]); |
47 | if (error) { | 47 | if (error) { |
48 | return error; | 48 | return error; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 51 | return cmd_results_new(CMD_SUCCESS, NULL); |
52 | } | 52 | } |
53 | 53 | ||
54 | struct cmd_results *bar_cmd_colors(int argc, char **argv) { | 54 | struct cmd_results *bar_cmd_colors(int argc, char **argv) { |