[PATCH 06/10] libext2fs: add explicit casts to bitops.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add some explicit casts to silence some -Wconversion noise.

Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>
---
 lib/ext2fs/bitops.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h
index edf82f2..3e8132d 100644
--- a/lib/ext2fs/bitops.h
+++ b/lib/ext2fs/bitops.h
@@ -244,7 +244,7 @@ _INLINE_ void ext2fs_fast_set_bit(unsigned int nr,void * addr)
 	unsigned char	*ADDR = (unsigned char *) addr;
 
 	ADDR += nr >> 3;
-	*ADDR |= (1 << (nr & 0x07));
+	*ADDR |= (unsigned char) (1 << (nr & 0x07));
 }
 
 _INLINE_ void ext2fs_fast_clear_bit(unsigned int nr, void * addr)
@@ -252,7 +252,7 @@ _INLINE_ void ext2fs_fast_clear_bit(unsigned int nr, void * addr)
 	unsigned char	*ADDR = (unsigned char *) addr;
 
 	ADDR += nr >> 3;
-	*ADDR &= ~(1 << (nr & 0x07));
+	*ADDR &= (unsigned char) ~(1 << (nr & 0x07));
 }
 
 
@@ -261,7 +261,7 @@ _INLINE_ void ext2fs_fast_set_bit64(__u64 nr, void * addr)
 	unsigned char	*ADDR = (unsigned char *) addr;
 
 	ADDR += nr >> 3;
-	*ADDR |= (1 << (nr & 0x07));
+	*ADDR |= (unsigned char) (1 << (nr & 0x07));
 }
 
 _INLINE_ void ext2fs_fast_clear_bit64(__u64 nr, void * addr)
@@ -269,7 +269,7 @@ _INLINE_ void ext2fs_fast_clear_bit64(__u64 nr, void * addr)
 	unsigned char	*ADDR = (unsigned char *) addr;
 
 	ADDR += nr >> 3;
-	*ADDR &= ~(1 << (nr & 0x07));
+	*ADDR &= (unsigned char) ~(1 << (nr & 0x07));
 }
 
 
@@ -358,7 +358,7 @@ _INLINE_ __u16 ext2fs_swab16(__u16 val)
 
 _INLINE_ __u16 ext2fs_swab16(__u16 val)
 {
-	return (val >> 8) | (val << 8);
+	return (val >> 8) | (__u16) (val << 8);
 }
 
 _INLINE_ __u32 ext2fs_swab32(__u32 val)
@@ -371,7 +371,7 @@ _INLINE_ __u32 ext2fs_swab32(__u32 val)
 
 _INLINE_ __u64 ext2fs_swab64(__u64 val)
 {
-	return (ext2fs_swab32(val >> 32) |
+	return (ext2fs_swab32((__u32) (val >> 32)) |
 		(((__u64)ext2fs_swab32(val & 0xFFFFFFFFUL)) << 32));
 }
 
@@ -600,7 +600,7 @@ _INLINE_ errcode_t ext2fs_find_first_zero_inode_bitmap2(ext2fs_inode_bitmap bitm
 	rv = ext2fs_find_first_zero_generic_bmap((ext2fs_generic_bitmap) bitmap,
 						 start, end, &o);
 	if (!rv)
-		*out = o;
+		*out = (ext2_ino_t) o;
 	return rv;
 }
 
@@ -611,7 +611,7 @@ _INLINE_ blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap)
 
 _INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap)
 {
-	return ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap);
+	return (ext2_ino_t) ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap);
 }
 
 _INLINE_ blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap)
@@ -621,7 +621,7 @@ _INLINE_ blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap)
 
 _INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap)
 {
-	return ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap);
+	return (ext2_ino_t) ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap);
 }
 
 _INLINE_ int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,
-- 
1.8.5.rc3.362.gdf10213

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux