tree-wide: replace FLAGS_SET(..., 1 << v) with BIT_SET(..., v)

This commit is contained in:
Mike Yuan
2024-12-28 15:08:00 +01:00
parent 382f3438d9
commit 1e4e557262
23 changed files with 77 additions and 60 deletions
+3 -2
View File
@@ -5,6 +5,7 @@
#include <sys/mman.h>
#include "alloc-util.h"
#include "bitfield.h"
#include "errno-util.h"
#include "fd-util.h"
#include "hashmap.h"
@@ -109,7 +110,7 @@ static Window* window_unlink(Window *w) {
}
for (unsigned i = 0; i < _MMAP_CACHE_CATEGORY_MAX; i++)
if (FLAGS_SET(w->flags, 1u << i))
if (BIT_SET(w->flags, i))
assert_se(TAKE_PTR(m->windows_by_category[i]) == w);
return LIST_REMOVE(windows, w->fd->windows, w);
@@ -193,7 +194,7 @@ static void category_detach_window(MMapCache *m, MMapCacheCategory c) {
if (!w)
return; /* Nothing attached. */
assert(FLAGS_SET(w->flags, 1u << c));
assert(BIT_SET(w->flags, c));
w->flags &= ~(1u << c);
if (WINDOW_IS_UNUSED(w)) {