aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor E <38229097+c-edw@users.noreply.github.com>2019-01-14 16:05:24 +0000
committerConnor E <38229097+c-edw@users.noreply.github.com>2019-01-14 16:05:24 +0000
commitb1cdd2b4b3d5bb0eac47bd040df47717a66ee7d9 (patch)
treeeeb11c8f0bfeee8659f91d44d008e20408d37923
parente7fff4f5607878a016c1514a3c75ec1e2d7c41ce (diff)
Use assertions instead of guard.
-rw-r--r--types/xdg_shell/wlr_xdg_surface.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c
index 5e353ba7..0e98155a 100644
--- a/types/xdg_shell/wlr_xdg_surface.c
+++ b/types/xdg_shell/wlr_xdg_surface.c
@@ -518,17 +518,15 @@ void wlr_xdg_surface_ping(struct wlr_xdg_surface *surface) {
}
void wlr_xdg_toplevel_send_close(struct wlr_xdg_surface *surface) {
- if (surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL
- && surface->toplevel) {
- xdg_toplevel_send_close(surface->toplevel->resource);
- }
+ assert(surface->toplevel);
+ assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL);
+ xdg_toplevel_send_close(surface->toplevel->resource);
}
void wlr_xdg_popup_destroy(struct wlr_xdg_surface *surface) {
- if (surface->role == WLR_XDG_SURFACE_ROLE_POPUP
- && surface->popup) {
- xdg_popup_send_popup_done(surface->popup->resource);
- }
+ assert(surface->popup);
+ assert(surface->role == WLR_XDG_SURFACE_ROLE_POPUP);
+ xdg_popup_send_popup_done(surface->popup->resource);
}
static void xdg_popup_get_position(struct wlr_xdg_popup *popup,