diff --git a/src/c2.c b/src/c2.c index f2db608..457ee3d 100644 --- a/src/c2.c +++ b/src/c2.c @@ -249,7 +249,7 @@ static inline int strcmp_wd(const char *needle, const char *src) { /** * Return whether a c2_ptr_t is empty. */ -static inline bool c2_ptr_isempty(const c2_ptr_t p) { +static inline attr_unused bool c2_ptr_isempty(const c2_ptr_t p) { return !(p.isbranch ? (bool)p.b : (bool)p.l); } diff --git a/src/opengl.h b/src/opengl.h index fd3fe9c..5ef58c4 100644 --- a/src/opengl.h +++ b/src/opengl.h @@ -134,7 +134,7 @@ static inline bool ensure_glx_context(session_t *ps) { /** * Free a GLX texture. */ -static inline void free_texture_r(session_t *ps, GLuint *ptexture) { +static inline void free_texture_r(session_t *ps attr_unused, GLuint *ptexture) { if (*ptexture) { assert(glx_has_context(ps)); glDeleteTextures(1, ptexture); diff --git a/src/utils.h b/src/utils.h index 104bcca..e6feaac 100644 --- a/src/utils.h +++ b/src/utils.h @@ -57,7 +57,7 @@ safe_isnan(double a) { /// being always true or false. #define ASSERT_IN_RANGE(var, lower, upper) \ do { \ - auto __tmp = (var); \ + auto __tmp attr_unused = (var); \ _Pragma("GCC diagnostic push"); \ _Pragma("GCC diagnostic ignored \"-Wtype-limits\""); \ assert(__tmp >= lower); \ @@ -69,7 +69,7 @@ safe_isnan(double a) { /// being always true or false. #define ASSERT_GEQ(var, lower) \ do { \ - auto __tmp = (var); \ + auto __tmp attr_unused = (var); \ _Pragma("GCC diagnostic push"); \ _Pragma("GCC diagnostic ignored \"-Wtype-limits\""); \ assert(__tmp >= lower); \ @@ -111,7 +111,7 @@ safe_isnan(double a) { #define to_u32_checked(val) \ ({ \ auto tmp = (val); \ - int64_t max = UINT32_MAX; /* silence clang tautological \ + int64_t max attr_unused = UINT32_MAX; /* silence clang tautological \ comparison warning*/ \ ASSERT_IN_RANGE(tmp, 0, max); \ (uint32_t) tmp; \ diff --git a/src/win.c b/src/win.c index fd247be..d0be605 100644 --- a/src/win.c +++ b/src/win.c @@ -329,8 +329,7 @@ void win_release_images(struct backend_base *backend, struct managed_win *w) { void win_process_flags(session_t *ps, struct managed_win *w) { // Make sure all pending window updates are processed before this. Making this // assumption simplifies some checks (e.g. whether window is mapped) - auto iw = (struct managed_win_internal *)w; - assert(iw->pending_updates == 0); + assert(((struct managed_win_internal *)w)->pending_updates == 0); if (!w->flags || (w->flags & WIN_FLAGS_IMAGE_ERROR) != 0) { return; @@ -2250,6 +2249,7 @@ win_is_fullscreen_xcb(xcb_connection_t *c, const struct atom *a, const xcb_windo void win_queue_update(struct managed_win *_w, enum win_update update) { auto w = (struct managed_win_internal *)_w; assert(popcount(update) == 1); + assert(update == WIN_UPDATE_MAP); // Currently the only supported update if (unlikely(_w->state == WSTATE_DESTROYING)) { log_error("Updates queued on a destroyed window %#010x (%s)", _w->base.id, @@ -2257,7 +2257,7 @@ void win_queue_update(struct managed_win *_w, enum win_update update) { return; } - w->pending_updates |= WIN_UPDATE_MAP; + w->pending_updates |= update; } /// Process pending updates on a window. Has to be called in X critical section