Prefer explicit bitwise operations for modifying flags

The *_is* functions for testing for bit flags have proven useful, maybe
mostly due to C's bad bitwise operator precedence, but the
*_set*/*_clear* functions just add extra code without much benefit.

Relying on explicit bitwise operations also lets us use the |=/&= shortcut
operators, which are nice.
This commit is contained in:
Christopher Haster
2023-09-22 00:46:51 -05:00
parent 1d92169e5b
commit 9b3f34eaa6
2 changed files with 79 additions and 100 deletions
+2 -4
View File
@@ -155,10 +155,8 @@ enum lfs_open_flags {
#endif
// internally used flags
// TODO do we need both unflushed and unsynced?
LFS_F_UNFLUSHED = 0x010000, // File's has data that needs to be written
LFS_F_UNSYNCED = 0x020000, // File's metadata does not match storage
LFS_F_ERRORED = 0x040000, // An error occurred during write
LFS_F_UNSYNCED = 0x010000, // File's metadata does not match storage
LFS_F_ERRORED = 0x020000, // An error occurred during write
};
// File seek flags