aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Evgeniy Khramtsov <evgeniy@khramtsov.org>2021-10-01 16:11:39 +0300
committerLibravatar Simon Ser <contact@emersion.fr>2021-10-01 15:45:09 +0200
commitff468584abddcb3f703d407aecf78137fb656472 (patch)
tree9b17312b755ebf0fc0c06fba440c126e0e9b40d7
parentChase wlr_xdg_surface breaking changes (diff)
downloadsway-ff468584abddcb3f703d407aecf78137fb656472.tar.gz
sway-ff468584abddcb3f703d407aecf78137fb656472.tar.zst
sway-ff468584abddcb3f703d407aecf78137fb656472.zip
commands: Remove unused code after 1d3681f52135
Clang 13 reports: ../sway/commands.c:470:23: error: variable 'context' set but not used [-Werror,-Wunused-but-set-variable] enum command_context context = 0; ^ Last use of was removed in commit 1d3681f52135. Downstream PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258813
-rw-r--r--include/sway/config.h8
-rw-r--r--sway/commands.c28
2 files changed, 0 insertions, 36 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 52867fa6..46dd4ffe 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -418,14 +418,6 @@ enum sway_popup_during_fullscreen {
418 POPUP_LEAVE, 418 POPUP_LEAVE,
419}; 419};
420 420
421enum command_context {
422 CONTEXT_CONFIG = 1 << 0,
423 CONTEXT_BINDING = 1 << 1,
424 CONTEXT_IPC = 1 << 2,
425 CONTEXT_CRITERIA = 1 << 3,
426 CONTEXT_ALL = 0xFFFFFFFF,
427};
428
429enum focus_follows_mouse_mode { 421enum focus_follows_mouse_mode {
430 FOLLOWS_NO, 422 FOLLOWS_NO,
431 FOLLOWS_YES, 423 FOLLOWS_YES,
diff --git a/sway/commands.c b/sway/commands.c
index b09a04c7..205406ad 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -465,34 +465,6 @@ struct cmd_results *config_commands_command(char *exec) {
465 goto cleanup; 465 goto cleanup;
466 } 466 }
467 467
468 enum command_context context = 0;
469
470 struct {
471 char *name;
472 enum command_context context;
473 } context_names[] = {
474 { "config", CONTEXT_CONFIG },
475 { "binding", CONTEXT_BINDING },
476 { "ipc", CONTEXT_IPC },
477 { "criteria", CONTEXT_CRITERIA },
478 { "all", CONTEXT_ALL },
479 };
480
481 for (int i = 1; i < argc; ++i) {
482 size_t j;
483 for (j = 0; j < sizeof(context_names) / sizeof(context_names[0]); ++j) {
484 if (strcmp(context_names[j].name, argv[i]) == 0) {
485 break;
486 }
487 }
488 if (j == sizeof(context_names) / sizeof(context_names[0])) {
489 results = cmd_results_new(CMD_INVALID,
490 "Invalid command context %s", argv[i]);
491 goto cleanup;
492 }
493 context |= context_names[j].context;
494 }
495
496 results = cmd_results_new(CMD_SUCCESS, NULL); 468 results = cmd_results_new(CMD_SUCCESS, NULL);
497 469
498cleanup: 470cleanup: