From a1afb76c44c0687b9dac986a01aacc4caf1bdd88 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 14 Aug 2018 10:51:01 +0100 Subject: [PATCH] Warn about fallthrough And fix some fallthroughs --- Makefile | 2 +- src/compton.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7da6675b..f956ca1d 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,7 @@ endif LIBS += $(shell pkg-config --libs $(PACKAGES)) INCS += $(shell pkg-config --cflags $(PACKAGES)) -CFLAGS += -Wall +CFLAGS += -Wall -Wimplicit-fallthrough BINS = compton bin/compton-trans MANPAGES = man/compton.1 man/compton-trans.1 diff --git a/src/compton.c b/src/compton.c index 7a169518..f1b363a3 100644 --- a/src/compton.c +++ b/src/compton.c @@ -2017,7 +2017,7 @@ paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t glx_render(ps, ps->tgt_buffer.ptex, 0, 0, 0, 0, ps->root_width, ps->root_height, 0, 1.0, false, false, region_real, NULL, NULL); - // No break here! + // falls through case BKEND_GLX: if (ps->o.glx_use_copysubbuffermesa) glx_swap_copysubbuffermesa(ps, region_real); @@ -6594,10 +6594,7 @@ init_filters(session_t *ps) { } #ifdef CONFIG_VSYNC_OPENGL case BKEND_GLX: - { - if (!glx_init_blur(ps)) - return false; - } + return glx_init_blur(ps); #endif default: assert(false);