aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2024-03-28 13:46:44 -0400
committerTheodore Ts'o <tytso@mit.edu>2024-03-28 13:46:44 -0400
commitb112f906212ff8067da82c9449413e93944b67f4 (patch)
tree8f66d4ac67e6dd2b43b6ca07608f0b14dd570dad
parent33ee0c8b22d4fba069d0393847c84eba545ec01c (diff)
downloade2fsprogs-b112f906212ff8067da82c9449413e93944b67f4.tar.gz
e2fsck: fix various -Wall nits picked up by clang
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--e2fsck/ea_refcount.c4
-rw-r--r--e2fsck/extents.c9
-rw-r--r--e2fsck/sigcatcher.c2
3 files changed, 9 insertions, 6 deletions
diff --git a/e2fsck/ea_refcount.c b/e2fsck/ea_refcount.c
index 7154b47c3..7ca56696e 100644
--- a/e2fsck/ea_refcount.c
+++ b/e2fsck/ea_refcount.c
@@ -120,7 +120,7 @@ static struct ea_refcount_el *insert_refcount_el(ext2_refcount_t refcount,
if (refcount->count >= refcount->size) {
new_size = refcount->size + 100;
#ifdef DEBUG
- printf("Reallocating refcount %d entries...\n", new_size);
+ printf("Reallocating refcount %zu entries...\n", new_size);
#endif
retval = ext2fs_resize_mem((size_t) refcount->size *
sizeof(struct ea_refcount_el),
@@ -177,7 +177,7 @@ retry:
if (ea_key == refcount->list[refcount->cursor].ea_key)
return &refcount->list[refcount->cursor++];
#ifdef DEBUG
- printf("Non-cursor get_refcount_el: %u\n", ea_key);
+ printf("Non-cursor get_refcount_el: %llu\n", (unsigned long long) ea_key);
#endif
while (low <= high) {
mid = (low+high)/2;
diff --git a/e2fsck/extents.c b/e2fsck/extents.c
index 70798f346..652e938dc 100644
--- a/e2fsck/extents.c
+++ b/e2fsck/extents.c
@@ -201,7 +201,10 @@ static errcode_t rewrite_extent_replay(e2fsck_t ctx, struct extent_list *list,
{
errcode_t retval;
ext2_extent_handle_t handle;
- unsigned int i, ext_written;
+ unsigned int i;
+#if defined(DEBUG) || defined(DEBUG_SUMMARY)
+ unsigned int ext_written = 0;
+#endif
struct ext2fs_extent *ex, extent;
blk64_t start_val, delta;
@@ -223,8 +226,6 @@ static errcode_t rewrite_extent_replay(e2fsck_t ctx, struct extent_list *list,
if (retval)
return retval;
- ext_written = 0;
-
start_val = ext2fs_get_stat_i_blocks(ctx->fs, EXT2_INODE(inode));
for (i = 0, ex = list->extents; i < list->count; i++, ex++) {
@@ -263,7 +264,9 @@ static errcode_t rewrite_extent_replay(e2fsck_t ctx, struct extent_list *list,
retval = ext2fs_extent_fix_parents(handle);
if (retval)
goto err;
+#if defined(DEBUG) || defined(DEBUG_SUMMARY)
ext_written++;
+#endif
}
delta = ext2fs_get_stat_i_blocks(ctx->fs, EXT2_INODE(inode)) -
diff --git a/e2fsck/sigcatcher.c b/e2fsck/sigcatcher.c
index a9d3b7f2c..e20273486 100644
--- a/e2fsck/sigcatcher.c
+++ b/e2fsck/sigcatcher.c
@@ -413,7 +413,7 @@ int main(int argc, char** argv)
struct sigaction sa;
char *p = 0;
int i, c;
- volatile x=0;
+ volatile int x = 0;
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_sigaction = die_signal_handler;