From 27fc4a2af49b0abfad000b3bb103e35f68472560 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 17 May 2018 12:50:22 +0100 Subject: [PATCH] Clear compiler warnings Thanks to chjj/compton#445 --- src/common.h | 2 +- src/compton.c | 29 ++++------------------------- src/compton.h | 5 ++--- src/dbus.h | 2 +- src/opengl.c | 8 ++++++-- 5 files changed, 14 insertions(+), 32 deletions(-) diff --git a/src/common.h b/src/common.h index 2b75ff7a..52c3ac7e 100644 --- a/src/common.h +++ b/src/common.h @@ -2402,7 +2402,7 @@ xr_sync_(session_t *ps, Drawable d if (!*pfence) *pfence = XSyncCreateFence(ps->dpy, d, False); if (*pfence) { - Bool triggered = False; + Bool __attribute__((unused)) triggered = False; /* if (XSyncQueryFence(ps->dpy, *pfence, &triggered) && triggered) XSyncResetFence(ps->dpy, *pfence); */ // The fence may fail to be created (e.g. because of died drawable) diff --git a/src/compton.c b/src/compton.c index 6af3403d..7a169518 100644 --- a/src/compton.c +++ b/src/compton.c @@ -1722,6 +1722,8 @@ win_paint_win(session_t *ps, win *w, XserverRegion reg_paint, reg_paint, pcache_reg); break; #endif + default: + assert(false); } } @@ -2666,29 +2668,6 @@ win_on_factor_change(session_t *ps, win *w) { ps->o.unredir_if_possible_blacklist, &w->cache_uipblst); } -/** - * Process needed window updates. - */ -static void -win_upd_run(session_t *ps, win *w, win_upd_t *pupd) { - if (pupd->shadow) { - win_determine_shadow(ps, w); - pupd->shadow = false; - } - if (pupd->fade) { - win_determine_fade(ps, w); - pupd->fade = false; - } - if (pupd->invert_color) { - win_determine_invert_color(ps, w); - pupd->invert_color = false; - } - if (pupd->focus) { - win_update_focused(ps, w); - pupd->focus = false; - } -} - /** * Update cache data in struct _win that depends on window size. */ @@ -3444,8 +3423,6 @@ wid_get_prop_window(session_t *ps, Window wid, Atom aprop) { */ static void win_update_focused(session_t *ps, win *w) { - bool focused_old = w->focused; - if (UNSET != w->focused_force) { w->focused = w->focused_force; } @@ -6622,6 +6599,8 @@ init_filters(session_t *ps) { return false; } #endif + default: + assert(false); } } diff --git a/src/compton.h b/src/compton.h index 24ef2d5a..5acb9bce 100644 --- a/src/compton.h +++ b/src/compton.h @@ -733,6 +733,8 @@ set_tgt_clip(session_t *ps, XserverRegion reg, const reg_data_t *pcache_reg) { glx_set_clip(ps, reg, pcache_reg); break; #endif + default: + assert(false); } } @@ -885,9 +887,6 @@ win_on_wtype_change(session_t *ps, win *w); static void win_on_factor_change(session_t *ps, win *w); -static void -win_upd_run(session_t *ps, win *w, win_upd_t *pupd); - static void calc_win_size(session_t *ps, win *w); diff --git a/src/dbus.h b/src/dbus.h index a806c2de..b924a5e9 100644 --- a/src/dbus.h +++ b/src/dbus.h @@ -25,7 +25,7 @@ #define CDBUS_ERROR_BADARG CDBUS_ERROR_PREFIX ".bad_argument" #define CDBUS_ERROR_BADARG_S "Failed to parse argument %d: %s" #define CDBUS_ERROR_BADWIN CDBUS_ERROR_PREFIX ".bad_window" -#define CDBUS_ERROR_BADWIN_S "Requested window %#010lx not found." +#define CDBUS_ERROR_BADWIN_S "Requested window %#010x not found." #define CDBUS_ERROR_BADTGT CDBUS_ERROR_PREFIX ".bad_target" #define CDBUS_ERROR_BADTGT_S "Target \"%s\" not found." #define CDBUS_ERROR_FORBIDDEN CDBUS_ERROR_PREFIX ".forbidden" diff --git a/src/opengl.c b/src/opengl.c index 3a84c98b..3707b141 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -1660,8 +1660,10 @@ glx_render_(session_t *ps, const glx_texture_t *ptex, /** * Render a region with color. + * + * Unused but can be useful for debugging */ -static void +static void __attribute__((unused)) glx_render_color(session_t *ps, int dx, int dy, int width, int height, int z, XserverRegion reg_tgt, const reg_data_t *pcache_reg) { static int color = 0; @@ -1696,8 +1698,10 @@ glx_render_color(session_t *ps, int dx, int dy, int width, int height, int z, /** * Render a region with dots. + * + * Unused but can be useful for debugging */ -static void +static void __attribute__((unused)) glx_render_dots(session_t *ps, int dx, int dy, int width, int height, int z, XserverRegion reg_tgt, const reg_data_t *pcache_reg) { glColor4f(0.0f, 0.0f, 0.0f, 1.0f);