]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: rename fls() to find_last_bit_set()
authorTheodore Ts'o <tytso@mit.edu>
Wed, 21 May 2025 14:39:53 +0000 (10:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 21 May 2025 14:39:53 +0000 (10:39 -0400)
In unix_io.c, rename fls() since some systems may already define it in
a system header file to fix a portability problem on MacOS.  The name
"find_last_bit_set" is a bit more self-descriptive anyway.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/unix_io.c

index 7078f3e2e30175178b70211471ac99a284f412c7..fba206abf03bd0f5e86f2dcaa13ff40057f84f79 100644 (file)
@@ -75,7 +75,7 @@
 #include "ext2fs.h"
 #include "ext2fsP.h"
 
-static inline int fls(int x)
+static inline int find_last_bit_set(int x)
 {
        int r = 32;
 
@@ -106,7 +106,7 @@ static inline int fls(int x)
 /* Get high bit set out of 32-bit argument, -1 if none set */
 static inline int highbit32(uint32_t v)
 {
-       return fls(v) - 1;
+       return find_last_bit_set(v) - 1;
 }
 
 /*