aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/layout.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-10 18:27:21 -0500
committerLibravatar M Stoeckl <code@mstoeckl.com>2019-01-14 08:05:29 -0500
commit2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0 (patch)
tree56332b9c150459beb5aef94605372ef179ec8854 /sway/commands/layout.c
parentRemove 'input' field of IPC command return json (diff)
downloadsway-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/layout.c')
-rw-r--r--sway/commands/layout.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c
index 8fde1776..2aca31dc 100644
--- a/sway/commands/layout.c
+++ b/sway/commands/layout.c
@@ -20,7 +20,7 @@ static enum sway_container_layout parse_layout_string(char *s) {
20 return L_NONE; 20 return L_NONE;
21} 21}
22 22
23static const char* expected_syntax = 23static const char expected_syntax[] =
24 "Expected 'layout default|tabbed|stacking|splitv|splith' or " 24 "Expected 'layout default|tabbed|stacking|splitv|splith' or "
25 "'layout toggle [split|all]' or " 25 "'layout toggle [split|all]' or "
26 "'layout toggle [split|tabbed|stacking|splitv|splith] [split|tabbed|stacking|splitv|splith]...'"; 26 "'layout toggle [split|tabbed|stacking|splitv|splith] [split|tabbed|stacking|splitv|splith]...'";
@@ -100,14 +100,14 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
100 return error; 100 return error;
101 } 101 }
102 if (!root->outputs->length) { 102 if (!root->outputs->length) {
103 return cmd_results_new(CMD_INVALID, "layout", 103 return cmd_results_new(CMD_INVALID,
104 "Can't run this command while there's no outputs connected."); 104 "Can't run this command while there's no outputs connected.");
105 } 105 }
106 struct sway_container *container = config->handler_context.container; 106 struct sway_container *container = config->handler_context.container;
107 struct sway_workspace *workspace = config->handler_context.workspace; 107 struct sway_workspace *workspace = config->handler_context.workspace;
108 108
109 if (container && container_is_floating(container)) { 109 if (container && container_is_floating(container)) {
110 return cmd_results_new(CMD_FAILURE, "layout", 110 return cmd_results_new(CMD_FAILURE,
111 "Unable to change layout of floating windows"); 111 "Unable to change layout of floating windows");
112 } 112 }
113 113
@@ -133,7 +133,7 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
133 workspace->layout, workspace->prev_split_layout); 133 workspace->layout, workspace->prev_split_layout);
134 } 134 }
135 if (new_layout == L_NONE) { 135 if (new_layout == L_NONE) {
136 return cmd_results_new(CMD_INVALID, "layout", expected_syntax); 136 return cmd_results_new(CMD_INVALID, expected_syntax);
137 } 137 }
138 if (new_layout != old_layout) { 138 if (new_layout != old_layout) {
139 if (container) { 139 if (container) {
@@ -152,5 +152,5 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
152 arrange_workspace(workspace); 152 arrange_workspace(workspace);
153 } 153 }
154 154
155 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 155 return cmd_results_new(CMD_SUCCESS, NULL);
156} 156}