aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/output/transform.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/output/transform.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/output/transform.c')
-rw-r--r--sway/commands/output/transform.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sway/commands/output/transform.c b/sway/commands/output/transform.c
index ca6f73a4..8613a8e7 100644
--- a/sway/commands/output/transform.c
+++ b/sway/commands/output/transform.c
@@ -6,11 +6,10 @@
6 6
7struct cmd_results *output_cmd_transform(int argc, char **argv) { 7struct cmd_results *output_cmd_transform(int argc, char **argv) {
8 if (!config->handler_context.output_config) { 8 if (!config->handler_context.output_config) {
9 return cmd_results_new(CMD_FAILURE, "output", "Missing output config"); 9 return cmd_results_new(CMD_FAILURE, "Missing output config");
10 } 10 }
11 if (!argc) { 11 if (!argc) {
12 return cmd_results_new(CMD_INVALID, "output", 12 return cmd_results_new(CMD_INVALID, "Missing transform argument.");
13 "Missing transform argument.");
14 } 13 }
15 enum wl_output_transform transform; 14 enum wl_output_transform transform;
16 if (strcmp(*argv, "normal") == 0) { 15 if (strcmp(*argv, "normal") == 0) {
@@ -30,8 +29,7 @@ struct cmd_results *output_cmd_transform(int argc, char **argv) {
30 } else if (strcmp(*argv, "flipped-270") == 0) { 29 } else if (strcmp(*argv, "flipped-270") == 0) {
31 transform = WL_OUTPUT_TRANSFORM_FLIPPED_270; 30 transform = WL_OUTPUT_TRANSFORM_FLIPPED_270;
32 } else { 31 } else {
33 return cmd_results_new(CMD_INVALID, "output", 32 return cmd_results_new(CMD_INVALID, "Invalid output transform.");
34 "Invalid output transform.");
35 } 33 }
36 struct output_config *output = config->handler_context.output_config; 34 struct output_config *output = config->handler_context.output_config;
37 config->handler_context.leftovers.argc = argc - 1; 35 config->handler_context.leftovers.argc = argc - 1;
@@ -42,12 +40,12 @@ struct cmd_results *output_cmd_transform(int argc, char **argv) {
42 return NULL; 40 return NULL;
43 } 41 }
44 if (strcmp(output->name, "*") == 0) { 42 if (strcmp(output->name, "*") == 0) {
45 return cmd_results_new(CMD_INVALID, "output", 43 return cmd_results_new(CMD_INVALID,
46 "Cannot apply relative transform to all outputs."); 44 "Cannot apply relative transform to all outputs.");
47 } 45 }
48 struct sway_output *s_output = output_by_name_or_id(output->name); 46 struct sway_output *s_output = output_by_name_or_id(output->name);
49 if (s_output == NULL) { 47 if (s_output == NULL) {
50 return cmd_results_new(CMD_INVALID, "output", 48 return cmd_results_new(CMD_INVALID,
51 "Cannot apply relative transform to unknown output %s", output->name); 49 "Cannot apply relative transform to unknown output %s", output->name);
52 } 50 }
53 if (strcmp(argv[1], "anticlockwise") == 0) { 51 if (strcmp(argv[1], "anticlockwise") == 0) {