aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-08 12:49:48 -0400
committerDrew DeVault <sir@cmpwn.com>2018-04-08 12:49:48 -0400
commit7bb8512afb14e7642ab44850d313df850881ea86 (patch)
tree42f161e55f078f5c55134cafc2a1704be37d8ee5 /examples
parentcedd151e1781955878c30d6b515ff574f2531d52 (diff)
Fix assertions with side-effects
Fixes #1725
Diffstat (limited to 'examples')
-rw-r--r--examples/layer-shell.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/layer-shell.c b/examples/layer-shell.c
index 0aac0839..d24399e4 100644
--- a/examples/layer-shell.c
+++ b/examples/layer-shell.c
@@ -431,11 +431,14 @@ int main(int argc, char **argv) {
return 1;
}
- assert(cursor_theme = wl_cursor_theme_load(NULL, 16, shm));
+ cursor_theme = wl_cursor_theme_load(NULL, 16, shm);
+ assert(cursor_theme);
struct wl_cursor *cursor;
- assert(cursor = wl_cursor_theme_get_cursor(cursor_theme, "crosshair"));
+ cursor = wl_cursor_theme_get_cursor(cursor_theme, "crosshair");
+ assert(cursor);
cursor_image = cursor->images[0];
- assert(cursor_surface = wl_compositor_create_surface(compositor));
+ cursor_surface = wl_compositor_create_surface(compositor)
+ assert(cursor_surface);
EGLint attribs[] = { EGL_ALPHA_SIZE, 8, EGL_NONE };
wlr_egl_init(&egl, EGL_PLATFORM_WAYLAND_EXT, display,