Clear compiler warnings

Thanks to chjj/compton#445
This commit is contained in:
Yuxuan Shui 2018-05-17 12:50:22 +01:00
parent af8a08e655
commit 27fc4a2af4
5 changed files with 14 additions and 32 deletions

View File

@ -2402,7 +2402,7 @@ xr_sync_(session_t *ps, Drawable d
if (!*pfence) if (!*pfence)
*pfence = XSyncCreateFence(ps->dpy, d, False); *pfence = XSyncCreateFence(ps->dpy, d, False);
if (*pfence) { if (*pfence) {
Bool triggered = False; Bool __attribute__((unused)) triggered = False;
/* if (XSyncQueryFence(ps->dpy, *pfence, &triggered) && triggered) /* if (XSyncQueryFence(ps->dpy, *pfence, &triggered) && triggered)
XSyncResetFence(ps->dpy, *pfence); */ XSyncResetFence(ps->dpy, *pfence); */
// The fence may fail to be created (e.g. because of died drawable) // The fence may fail to be created (e.g. because of died drawable)

View File

@ -1722,6 +1722,8 @@ win_paint_win(session_t *ps, win *w, XserverRegion reg_paint,
reg_paint, pcache_reg); reg_paint, pcache_reg);
break; break;
#endif #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); 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. * 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 static void
win_update_focused(session_t *ps, win *w) { win_update_focused(session_t *ps, win *w) {
bool focused_old = w->focused;
if (UNSET != w->focused_force) { if (UNSET != w->focused_force) {
w->focused = w->focused_force; w->focused = w->focused_force;
} }
@ -6622,6 +6599,8 @@ init_filters(session_t *ps) {
return false; return false;
} }
#endif #endif
default:
assert(false);
} }
} }

View File

@ -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); glx_set_clip(ps, reg, pcache_reg);
break; break;
#endif #endif
default:
assert(false);
} }
} }
@ -885,9 +887,6 @@ win_on_wtype_change(session_t *ps, win *w);
static void static void
win_on_factor_change(session_t *ps, win *w); 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 static void
calc_win_size(session_t *ps, win *w); calc_win_size(session_t *ps, win *w);

View File

@ -25,7 +25,7 @@
#define CDBUS_ERROR_BADARG CDBUS_ERROR_PREFIX ".bad_argument" #define CDBUS_ERROR_BADARG CDBUS_ERROR_PREFIX ".bad_argument"
#define CDBUS_ERROR_BADARG_S "Failed to parse argument %d: %s" #define CDBUS_ERROR_BADARG_S "Failed to parse argument %d: %s"
#define CDBUS_ERROR_BADWIN CDBUS_ERROR_PREFIX ".bad_window" #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 CDBUS_ERROR_PREFIX ".bad_target"
#define CDBUS_ERROR_BADTGT_S "Target \"%s\" not found." #define CDBUS_ERROR_BADTGT_S "Target \"%s\" not found."
#define CDBUS_ERROR_FORBIDDEN CDBUS_ERROR_PREFIX ".forbidden" #define CDBUS_ERROR_FORBIDDEN CDBUS_ERROR_PREFIX ".forbidden"

View File

@ -1660,8 +1660,10 @@ glx_render_(session_t *ps, const glx_texture_t *ptex,
/** /**
* Render a region with color. * 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, 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) { XserverRegion reg_tgt, const reg_data_t *pcache_reg) {
static int color = 0; 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. * 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, 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) { XserverRegion reg_tgt, const reg_data_t *pcache_reg) {
glColor4f(0.0f, 0.0f, 0.0f, 1.0f); glColor4f(0.0f, 0.0f, 0.0f, 1.0f);