From 244732d22379a074e733074ecbcc8feb6d58fe87 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 21 May 2025 22:41:57 -0500 Subject: [PATCH] Adopted and-not over not-or for bitmask chains Except for the unknown flag checks. I don't know why but they really mess with readability there for me. Maybe because the logic matches english grammar ("is not any of these" vs "is any not of these")? No code changes. --- lfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lfs.c b/lfs.c index 9d821664..2d1aca64 100644 --- a/lfs.c +++ b/lfs.c @@ -1694,7 +1694,7 @@ static inline bool lfsr_data_isbptr(lfsr_data_t data) { } static inline lfs_size_t lfsr_data_size(lfsr_data_t data) { - return data.size & ~(LFSR_DATA_ONDISK | LFSR_DATA_ISBPTR); + return data.size & ~LFSR_DATA_ONDISK & ~LFSR_DATA_ISBPTR; } #ifdef LFS_CKDATACKSUMS @@ -7651,7 +7651,7 @@ static lfsr_tag_t lfsr_mdir_nametag(const lfs_t *lfs, const lfsr_mdir_t *mdir, // in-sync file handles to decide if it really exists } else if (tag == LFSR_TAG_STICKYNOTE && !lfsr_omdir_ismidopen(lfs, mid, - ~(LFS_o_ZOMBIE | LFS_O_DESYNC))) { + ~LFS_o_ZOMBIE & ~LFS_O_DESYNC)) { return LFSR_TAG_ORPHAN; // map unknown types -> LFSR_TAG_UNKNOWN, this simplifies higher @@ -15463,7 +15463,10 @@ static int lfsr_traversal_rewind_(lfs_t *lfs, lfsr_traversal_t *t) { // reset traversal lfsr_traversal_init(t, - t->b.o.flags & ~(LFS_t_DIRTY | LFS_t_MUTATED | LFS_t_TSTATE)); + t->b.o.flags + & ~LFS_t_DIRTY + & ~LFS_t_MUTATED + & ~LFS_t_TSTATE); // and clear any pending blocks t->blocks[0] = -1;