]> git.mdlowis.com Git - proto/labwc.git/commitdiff
output: assert instead of quiet return
authorJohan Malm <jgm323@gmail.com>
Wed, 30 Jun 2021 19:12:58 +0000 (20:12 +0100)
committerJohan Malm <jgm323@gmail.com>
Wed, 30 Jun 2021 19:12:58 +0000 (20:12 +0100)
src/output.c

index 9207f8149bba4b0ec660e15a65105b8bd7df8938..d2427125525f91293bbbae5a0db3884054acf18f 100644 (file)
@@ -7,6 +7,7 @@
 
 #define _POSIX_C_SOURCE 200809L
 #include "config.h"
+#include <assert.h>
 #include <wlr/types/wlr_xdg_output_v1.h>
 #include <wlr/types/wlr_output_damage.h>
 #include <wlr/util/region.h>
@@ -48,7 +49,7 @@ output_for_each_surface_iterator(struct wlr_surface *surface, int sx, int sy,
 {
        struct surface_iterator_data *data = user_data;
        struct output *output = data->output;
-       if (!surface || !wlr_surface_has_buffer(surface)) {
+       if (!wlr_surface_has_buffer(surface)) {
                return;
        }
        struct wlr_box surface_box = {
@@ -78,9 +79,7 @@ output_surface_for_each_surface(struct output *output,
                .ox = ox,
                .oy = oy,
        };
-       if (!surface) {
-               return;
-       }
+       assert(surface);
        wlr_surface_for_each_surface(surface,
                output_for_each_surface_iterator, &data);
 }