diff options
author | Manuel Stoeckl <code@mstoeckl.com> | 2021-02-03 21:45:51 -0500 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-02-04 09:49:06 +0100 |
commit | 8f2cd3236f0f7e0ae8fcd9d1447cc583d17de5c5 (patch) | |
tree | 518f1d6660fdb6527c0e4524589315b00febbe73 /swaynag | |
parent | Declare all struct cmd_handler arrays const (diff) | |
download | sway-8f2cd3236f0f7e0ae8fcd9d1447cc583d17de5c5.tar.gz sway-8f2cd3236f0f7e0ae8fcd9d1447cc583d17de5c5.tar.zst sway-8f2cd3236f0f7e0ae8fcd9d1447cc583d17de5c5.zip |
Make Wayland request listeners static const when possible
Diffstat (limited to 'swaynag')
-rw-r--r-- | swaynag/swaynag.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c index d9bec368..46b90e03 100644 --- a/swaynag/swaynag.c +++ b/swaynag/swaynag.c | |||
@@ -103,7 +103,7 @@ static void layer_surface_closed(void *data, | |||
103 | swaynag_destroy(swaynag); | 103 | swaynag_destroy(swaynag); |
104 | } | 104 | } |
105 | 105 | ||
106 | static struct zwlr_layer_surface_v1_listener layer_surface_listener = { | 106 | static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { |
107 | .configure = layer_surface_configure, | 107 | .configure = layer_surface_configure, |
108 | .closed = layer_surface_closed, | 108 | .closed = layer_surface_closed, |
109 | }; | 109 | }; |
@@ -124,7 +124,7 @@ static void surface_enter(void *data, struct wl_surface *surface, | |||
124 | }; | 124 | }; |
125 | } | 125 | } |
126 | 126 | ||
127 | static struct wl_surface_listener surface_listener = { | 127 | static const struct wl_surface_listener surface_listener = { |
128 | .enter = surface_enter, | 128 | .enter = surface_enter, |
129 | .leave = nop, | 129 | .leave = nop, |
130 | }; | 130 | }; |
@@ -263,7 +263,7 @@ static void wl_pointer_axis(void *data, struct wl_pointer *wl_pointer, | |||
263 | render_frame(swaynag); | 263 | render_frame(swaynag); |
264 | } | 264 | } |
265 | 265 | ||
266 | static struct wl_pointer_listener pointer_listener = { | 266 | static const struct wl_pointer_listener pointer_listener = { |
267 | .enter = wl_pointer_enter, | 267 | .enter = wl_pointer_enter, |
268 | .leave = nop, | 268 | .leave = nop, |
269 | .motion = wl_pointer_motion, | 269 | .motion = wl_pointer_motion, |
@@ -289,7 +289,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, | |||
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | const struct wl_seat_listener seat_listener = { | 292 | static const struct wl_seat_listener seat_listener = { |
293 | .capabilities = seat_handle_capabilities, | 293 | .capabilities = seat_handle_capabilities, |
294 | .name = nop, | 294 | .name = nop, |
295 | }; | 295 | }; |
@@ -305,7 +305,7 @@ static void output_scale(void *data, struct wl_output *output, | |||
305 | } | 305 | } |
306 | } | 306 | } |
307 | 307 | ||
308 | static struct wl_output_listener output_listener = { | 308 | static const struct wl_output_listener output_listener = { |
309 | .geometry = nop, | 309 | .geometry = nop, |
310 | .mode = nop, | 310 | .mode = nop, |
311 | .done = nop, | 311 | .done = nop, |
@@ -327,7 +327,7 @@ static void xdg_output_handle_name(void *data, | |||
327 | swaynag_output->swaynag->querying_outputs--; | 327 | swaynag_output->swaynag->querying_outputs--; |
328 | } | 328 | } |
329 | 329 | ||
330 | static struct zxdg_output_v1_listener xdg_output_listener = { | 330 | static const struct zxdg_output_v1_listener xdg_output_listener = { |
331 | .logical_position = nop, | 331 | .logical_position = nop, |
332 | .logical_size = nop, | 332 | .logical_size = nop, |
333 | .done = nop, | 333 | .done = nop, |