mirror of
https://github.com/swaywm/sway.git
synced 2026-04-20 06:47:03 -04:00
Declare all struct cmd_handler arrays const
And make the functions handling these arrays use const types.
This commit is contained in:
parent
89b4bc4bc7
commit
cb3c727632
8 changed files with 29 additions and 29 deletions
|
|
@ -8,7 +8,7 @@
|
|||
#include "log.h"
|
||||
|
||||
// Must be in alphabetical order for bsearch
|
||||
static struct cmd_handler bar_handlers[] = {
|
||||
static const struct cmd_handler bar_handlers[] = {
|
||||
{ "bindcode", bar_cmd_bindcode },
|
||||
{ "binding_mode_indicator", bar_cmd_binding_mode_indicator },
|
||||
{ "bindsym", bar_cmd_bindsym },
|
||||
|
|
@ -41,7 +41,7 @@ static struct cmd_handler bar_handlers[] = {
|
|||
};
|
||||
|
||||
// Must be in alphabetical order for bsearch
|
||||
static struct cmd_handler bar_config_handlers[] = {
|
||||
static const struct cmd_handler bar_config_handlers[] = {
|
||||
{ "id", bar_cmd_id },
|
||||
{ "swaybar_command", bar_cmd_swaybar_command },
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "util.h"
|
||||
|
||||
// Must be in alphabetical order for bsearch
|
||||
static struct cmd_handler bar_colors_handlers[] = {
|
||||
static const struct cmd_handler bar_colors_handlers[] = {
|
||||
{ "active_workspace", bar_colors_cmd_active_workspace },
|
||||
{ "background", bar_colors_cmd_background },
|
||||
{ "binding_mode", bar_colors_cmd_binding_mode },
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "stringop.h"
|
||||
|
||||
// must be in order for the bsearch
|
||||
static struct cmd_handler input_handlers[] = {
|
||||
static const struct cmd_handler input_handlers[] = {
|
||||
{ "accel_profile", input_cmd_accel_profile },
|
||||
{ "calibration_matrix", input_cmd_calibration_matrix },
|
||||
{ "click_method", input_cmd_click_method },
|
||||
|
|
@ -40,7 +40,7 @@ static struct cmd_handler input_handlers[] = {
|
|||
};
|
||||
|
||||
// must be in order for the bsearch
|
||||
static struct cmd_handler input_config_handlers[] = {
|
||||
static const struct cmd_handler input_config_handlers[] = {
|
||||
{ "xkb_capslock", input_cmd_xkb_capslock },
|
||||
{ "xkb_numlock", input_cmd_xkb_numlock },
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "stringop.h"
|
||||
|
||||
// Must be in order for the bsearch
|
||||
static struct cmd_handler mode_handlers[] = {
|
||||
static const struct cmd_handler mode_handlers[] = {
|
||||
{ "bindcode", cmd_bindcode },
|
||||
{ "bindswitch", cmd_bindswitch },
|
||||
{ "bindsym", cmd_bindsym },
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "log.h"
|
||||
|
||||
// must be in order for the bsearch
|
||||
static struct cmd_handler output_handlers[] = {
|
||||
static const struct cmd_handler output_handlers[] = {
|
||||
{ "adaptive_sync", output_cmd_adaptive_sync },
|
||||
{ "background", output_cmd_background },
|
||||
{ "bg", output_cmd_background },
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
// must be in order for the bsearch
|
||||
// these handlers perform actions on the seat
|
||||
static struct cmd_handler seat_action_handlers[] = {
|
||||
static const struct cmd_handler seat_action_handlers[] = {
|
||||
{ "cursor", seat_cmd_cursor },
|
||||
};
|
||||
|
||||
// must be in order for the bsearch
|
||||
// these handlers alter the seat config
|
||||
static struct cmd_handler seat_handlers[] = {
|
||||
static const struct cmd_handler seat_handlers[] = {
|
||||
{ "attach", seat_cmd_attach },
|
||||
{ "fallback", seat_cmd_fallback },
|
||||
{ "hide_cursor", seat_cmd_hide_cursor },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue