summaryrefslogtreecommitdiff
path: root/sway/commands/mode.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/mode.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/mode.c')
-rw-r--r--sway/commands/mode.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sway/commands/mode.c b/sway/commands/mode.c
index 189e3c1a..828d77e1 100644
--- a/sway/commands/mode.c
+++ b/sway/commands/mode.c
@@ -22,16 +22,14 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
}
if (argc > 1 && !config->reading) {
- return cmd_results_new(CMD_FAILURE,
- "mode", "Can only be used in config file.");
+ return cmd_results_new(CMD_FAILURE, "Can only be used in config file");
}
bool pango = strcmp(*argv, "--pango_markup") == 0;
if (pango) {
argc--; argv++;
if (argc == 0) {
- return cmd_results_new(CMD_FAILURE, "mode",
- "Mode name is missing");
+ return cmd_results_new(CMD_FAILURE, "Mode name is missing");
}
}
@@ -50,8 +48,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
if (!mode && argc > 1) {
mode = calloc(1, sizeof(struct sway_mode));
if (!mode) {
- return cmd_results_new(CMD_FAILURE,
- "mode", "Unable to allocate mode");
+ return cmd_results_new(CMD_FAILURE, "Unable to allocate mode");
}
mode->name = strdup(mode_name);
mode->keysym_bindings = create_list();
@@ -61,8 +58,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
list_add(config->modes, mode);
}
if (!mode) {
- error = cmd_results_new(CMD_INVALID,
- "mode", "Unknown mode `%s'", mode_name);
+ error = cmd_results_new(CMD_INVALID, "Unknown mode `%s'", mode_name);
return error;
}
if ((config->reading && argc > 1) || (!config->reading && argc == 1)) {
@@ -75,7 +71,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
// trigger IPC mode event
ipc_event_mode(config->current_mode->name,
config->current_mode->pango);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
// Create binding