summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-27 23:14:20 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-27 23:14:20 +0200
commit5ba4850606ced0dd645f2b6ce85893ef9af95289 (patch)
tree326a61525d36a9261359ee7fbefc4242b0f37a0b
parentf38c16748eb4a109b44c2e99c8ff377ddf3a23cf (diff)
ext2fs: Fix unsigned long / uint32_t confusion
-rw-r--r--ext2fs/balloc.c10
-rw-r--r--ext2fs/bitmap.c6
-rw-r--r--ext2fs/ialloc.c2
-rw-r--r--ext2fs/xattr.h2
4 files changed, 10 insertions, 10 deletions
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index c8137755..c921c0ca 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -151,7 +151,7 @@ ext2_new_block (block_t goal,
unsigned char *bh = NULL;
unsigned char *p, *r;
int i, j, k, tmp;
- unsigned long lmap;
+ uint32_t lmap;
struct ext2_group_desc *gdp;
#ifdef EXT2FS_DEBUG
@@ -213,11 +213,11 @@ repeat:
if ((j & 31) == 31)
lmap = 0;
else
- lmap = ((((unsigned long *) bh)[j >> 5]) >>
+ lmap = ((((uint32_t *) bh)[j >> 5]) >>
((j & 31) + 1));
if (j < le32toh (sblock->s_blocks_per_group) - 32)
- lmap |= (((unsigned long *) bh)[(j >> 5) + 1]) <<
+ lmap |= (((uint32_t *) bh)[(j >> 5) + 1]) <<
(31 - (j & 31));
else
lmap |= 0xffffffff << (31 - (j & 31));
@@ -251,7 +251,7 @@ repeat:
j = k;
goto search_back;
}
- k = find_next_zero_bit ((unsigned long *) bh,
+ k = find_next_zero_bit ((uint32_t *) bh,
le32toh (sblock->s_blocks_per_group),
j);
if (k < le32toh (sblock->s_blocks_per_group))
@@ -291,7 +291,7 @@ repeat:
if (j < le32toh (sblock->s_blocks_per_group))
goto search_back;
else
- j = find_first_zero_bit ((unsigned long *) bh,
+ j = find_first_zero_bit ((uint32_t *) bh,
le32toh (sblock->s_blocks_per_group));
if (j >= le32toh (sblock->s_blocks_per_group))
{
diff --git a/ext2fs/bitmap.c b/ext2fs/bitmap.c
index c6d882b9..c440c8b1 100644
--- a/ext2fs/bitmap.c
+++ b/ext2fs/bitmap.c
@@ -56,12 +56,12 @@ unsigned long count_free (unsigned char *map, unsigned int numchars)
* on Linus's ALPHA routines, which are pretty portable BTW.
*/
-static inline unsigned long
+static inline uint32_t
find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
{
- unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
+ uint32_t *p = ((uint32_t *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
- unsigned long tmp;
+ uint32_t tmp;
if (offset >= size)
return size;
diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c
index d6f5ac79..707ce142 100644
--- a/ext2fs/ialloc.c
+++ b/ext2fs/ialloc.c
@@ -225,7 +225,7 @@ repeat:
bh = disk_cache_block_ref (le32toh (gdp->bg_inode_bitmap));
if ((inum =
- find_first_zero_bit ((unsigned long *) bh, le32toh (sblock->s_inodes_per_group)))
+ find_first_zero_bit ((uint32_t *) bh, le32toh (sblock->s_inodes_per_group)))
< le32toh (sblock->s_inodes_per_group))
{
if (set_bit (inum, bh))
diff --git a/ext2fs/xattr.h b/ext2fs/xattr.h
index 245f896e..46c4fa26 100644
--- a/ext2fs/xattr.h
+++ b/ext2fs/xattr.h
@@ -80,6 +80,6 @@ struct ext2_xattr_entry
(entry->e_name_len)))
/* Checks if this entry is the last (not valid) one. */
-#define EXT2_XATTR_ENTRY_LAST(entry) (*(unsigned long *) entry == 0UL)
+#define EXT2_XATTR_ENTRY_LAST(entry) (*(uint32_t *) entry == 0UL)
#endif