summaryrefslogtreecommitdiff
path: root/sway/commands/output/background.c
diff options
context:
space:
mode:
authorM Stoeckl <[email protected]>2019-01-10 18:27:21 -0500
committerM Stoeckl <[email protected]>2019-01-14 08:05:29 -0500
commit2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0 (patch)
tree56332b9c150459beb5aef94605372ef179ec8854 /sway/commands/output/background.c
parent6d392150a72ecc3b69fcfb48865f625e2c7b79d6 (diff)
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/output/background.c')
-rw-r--r--sway/commands/output/background.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index 2cd1b76a..ae2f0640 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -20,14 +20,14 @@ static const char *bg_options[] = {
struct cmd_results *output_cmd_background(int argc, char **argv) {
if (!config->handler_context.output_config) {
- return cmd_results_new(CMD_FAILURE, "output", "Missing output config");
+ return cmd_results_new(CMD_FAILURE, "Missing output config");
}
if (!argc) {
- return cmd_results_new(CMD_INVALID, "output",
+ return cmd_results_new(CMD_INVALID,
"Missing background file or color specification.");
}
if (argc < 2) {
- return cmd_results_new(CMD_INVALID, "output",
+ return cmd_results_new(CMD_INVALID,
"Missing background scaling mode or `solid_color`.");
}
@@ -57,7 +57,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
}
}
if (!valid) {
- return cmd_results_new(CMD_INVALID, "output",
+ return cmd_results_new(CMD_INVALID,
"Missing background scaling mode.");
}
@@ -70,7 +70,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
*ptr = '\\';
}
if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) {
- struct cmd_results *cmd_res = cmd_results_new(CMD_INVALID, "output",
+ struct cmd_results *cmd_res = cmd_results_new(CMD_INVALID,
"Invalid syntax (%s)", src);
free(src);
wordfree(&p);
@@ -81,8 +81,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
wordfree(&p);
if (!src) {
wlr_log(WLR_ERROR, "Failed to duplicate string");
- return cmd_results_new(CMD_FAILURE, "output",
- "Unable to allocate resource");
+ return cmd_results_new(CMD_FAILURE, "Unable to allocate resource");
}
if (config->reading && *src != '/') {
@@ -92,7 +91,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
if (!conf) {
wlr_log(WLR_ERROR, "Failed to duplicate string");
free(src);
- return cmd_results_new(CMD_FAILURE, "output",
+ return cmd_results_new(CMD_FAILURE,
"Unable to allocate resources");
}
@@ -103,7 +102,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
free(rel_path);
free(conf);
wlr_log(WLR_ERROR, "Unable to allocate memory");
- return cmd_results_new(CMD_FAILURE, "output",
+ return cmd_results_new(CMD_FAILURE,
"Unable to allocate resources");
}