diff options
author | emersion <contact@emersion.fr> | 2018-05-07 17:26:21 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-05-07 17:26:21 +0100 |
commit | a3ecfcfc2c709f1a3ebb548f30f9e7cc14cf26fa (patch) | |
tree | e32abb673569037d26db1fdc1612dd002aa397b4 | |
parent | Merge pull request #1920 from yorickvP/master (diff) | |
download | sway-a3ecfcfc2c709f1a3ebb548f30f9e7cc14cf26fa.tar.gz sway-a3ecfcfc2c709f1a3ebb548f30f9e7cc14cf26fa.tar.zst sway-a3ecfcfc2c709f1a3ebb548f30f9e7cc14cf26fa.zip |
swaybg: remove assertions with side-effects
-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( |