From c8627989ada8d67a9356326d9e7cd542f65b999c Mon Sep 17 00:00:00 2001 From: Maxim Solovyov Date: Fri, 11 Aug 2023 01:09:56 +0300 Subject: [PATCH] win: address some clang-tidy issues, run clang-format --- src/win.c | 12 ++++++------ src/win.h | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/win.c b/src/win.c index 14e2953f..bd19b3d4 100644 --- a/src/win.c +++ b/src/win.c @@ -369,7 +369,8 @@ bool win_bind_shadow(struct backend_base *b, struct managed_win *w, struct color w->shadow_image = b->ops->render_shadow(b, w->widthb, w->heightb, sctx, c); } else { if (!w->mask_image) { - // It's possible we already allocated a mask because of background blur + // It's possible we already allocated a mask because of background + // blur win_bind_mask(b, w); } w->shadow_image = b->ops->shadow_from_mask(b, w->mask_image, sctx, c); @@ -1502,12 +1503,11 @@ struct win *add_win_above(session_t *ps, xcb_window_t id, xcb_window_t below) { return NULL; } return add_win_top(ps, id); - } else { - // we found something from the hash table, so if the stack is - // empty, we are in an inconsistent state. - assert(!list_is_empty(&ps->window_stack)); - return add_win(ps, id, w->stack_neighbour.prev); } + // we found something from the hash table, so if the stack is + // empty, we are in an inconsistent state. + assert(!list_is_empty(&ps->window_stack)); + return add_win(ps, id, w->stack_neighbour.prev); } /// Query the Xorg for information about window `win` diff --git a/src/win.h b/src/win.h index b841ffc1..51e7f9d3 100644 --- a/src/win.h +++ b/src/win.h @@ -26,11 +26,12 @@ typedef struct session session_t; typedef struct _glx_texture glx_texture_t; #define win_stack_foreach_managed(w, win_stack) \ - list_foreach(struct managed_win, w, win_stack, base.stack_neighbour) if (w->base.managed) + list_foreach(struct managed_win, w, win_stack, \ + base.stack_neighbour) if ((w)->base.managed) #define win_stack_foreach_managed_safe(w, win_stack) \ list_foreach_safe(struct managed_win, w, win_stack, \ - base.stack_neighbour) if (w->base.managed) + base.stack_neighbour) if ((w)->base.managed) #ifdef CONFIG_OPENGL // FIXME this type should be in opengl.h