diff options
author | 2018-05-07 14:02:17 -0400 | |
---|---|---|
committer | 2018-05-07 14:02:17 -0400 | |
commit | 8fa53df670e72f36bb80ef03a62acb10dbf97397 (patch) | |
tree | 9503f4924f53d3eca0661a3c5c7e53c18a56f622 /swaybg/main.c | |
parent | Merge pull request #1934 from emersion/update-layer-shell (diff) | |
parent | swaybg: remove assertions with side-effects (diff) | |
download | sway-8fa53df670e72f36bb80ef03a62acb10dbf97397.tar.gz sway-8fa53df670e72f36bb80ef03a62acb10dbf97397.tar.zst sway-8fa53df670e72f36bb80ef03a62acb10dbf97397.zip |
Merge pull request #1933 from emersion/swaybg-asser-side-effects
swaybg: remove assertions with side-effects
Diffstat (limited to 'swaybg/main.c')
-rw-r--r-- | swaybg/main.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/swaybg/main.c b/swaybg/main.c index 679b8c20..5b6c378c 100644 --- a/swaybg/main.c +++ b/swaybg/main.c | |||
@@ -113,7 +113,7 @@ static void layer_surface_closed(void *data, | |||
113 | state->run_display = false; | 113 | state->run_display = false; |
114 | } | 114 | } |
115 | 115 | ||
116 | struct zwlr_layer_surface_v1_listener layer_surface_listener = { | 116 | static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { |
117 | .configure = layer_surface_configure, | 117 | .configure = layer_surface_configure, |
118 | .closed = layer_surface_closed, | 118 | .closed = layer_surface_closed, |
119 | }; | 119 | }; |
@@ -141,7 +141,7 @@ static void output_scale(void *data, struct wl_output *output, int32_t factor) { | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | struct wl_output_listener output_listener = { | 144 | static const struct wl_output_listener output_listener = { |
145 | .geometry = output_geometry, | 145 | .geometry = output_geometry, |
146 | .mode = output_mode, | 146 | .mode = output_mode, |
147 | .done = output_done, | 147 | .done = output_done, |
@@ -203,7 +203,8 @@ int main(int argc, const char **argv) { | |||
203 | return 1; | 203 | return 1; |
204 | } | 204 | } |
205 | 205 | ||
206 | assert(state.display = wl_display_connect(NULL)); | 206 | state.display = wl_display_connect(NULL); |
207 | assert(state.display); | ||
207 | 208 | ||
208 | struct wl_registry *registry = wl_display_get_registry(state.display); | 209 | struct wl_registry *registry = wl_display_get_registry(state.display); |
209 | wl_registry_add_listener(registry, ®istry_listener, &state); | 210 | wl_registry_add_listener(registry, ®istry_listener, &state); |
@@ -213,9 +214,11 @@ int main(int argc, const char **argv) { | |||
213 | // Second roundtrip to get output properties | 214 | // Second roundtrip to get output properties |
214 | wl_display_roundtrip(state.display); | 215 | wl_display_roundtrip(state.display); |
215 | 216 | ||
216 | assert(state.surface = wl_compositor_create_surface(state.compositor)); | 217 | state.surface = wl_compositor_create_surface(state.compositor); |
218 | assert(state.surface); | ||
217 | 219 | ||
218 | assert(state.input_region = wl_compositor_create_region(state.compositor)); | 220 | state.input_region = wl_compositor_create_region(state.compositor); |
221 | assert(state.input_region); | ||
219 | wl_surface_set_input_region(state.surface, state.input_region); | 222 | wl_surface_set_input_region(state.surface, state.input_region); |
220 | 223 | ||
221 | state.layer_surface = zwlr_layer_shell_v1_get_layer_surface( | 224 | state.layer_surface = zwlr_layer_shell_v1_get_layer_surface( |