Whamcloud - gitweb
misc: replace comparison macros with inline functions
authorAndreas Dilger <adilger@dilger.ca>
Mon, 7 Mar 2016 02:23:40 +0000 (21:23 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 7 Mar 2016 02:23:40 +0000 (21:23 -0500)
commit539d3ae3da75021fe391a68c2714b4bb29ddc199
treea44d1a81c8408ebbd21959eec707e12fc19b78c9
parent82af19ea20ef57f6095389328f06261ae5dcc2d4
misc: replace comparison macros with inline functions

Replace the EXT2FS_RB_EMPTY_ROOT(), EXT2FS_RB_EMPTY_NODE(),
EXT2FS_RB_CLEAR_NODE(), IS_BLOCK_BM(), IS_INODE_BM(), and
IS_INODE_TB() macros with static inline functions to avoid
suprious compiler warnings with clang:

pass1.c:618:28: warning: equality comparison with extraneous
parentheses [-Wparentheses-equality]
if ((*((__u32 *)(entry)) == 0UL)) {
             ~~~~~~~~~~~~~~~~~~~~^~~~~~
pass1.c:618:28: note: remove extraneous parentheses
around the comparison to silence this warning
if ((*((__u32 *)(entry)) == 0UL)) {
 ^~
pass1.c:618:28: note: use '=' to turn this equality
comparison into an assignment
if ((*((__u32 *)(entry)) == 0UL)) {
 ^~
 =

The static inline functions should compile identically, and allow
some extra compile-time checking for the arguments over macros.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/blkmap64_rb.c
lib/ext2fs/rbtree.h
resize/resize2fs.c