Whamcloud - gitweb
e2fsck: fix various -Wall nits picked up by clang
authorTheodore Ts'o <tytso@mit.edu>
Thu, 28 Mar 2024 17:46:44 +0000 (13:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Mar 2024 17:46:44 +0000 (13:46 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/ea_refcount.c
e2fsck/extents.c
e2fsck/sigcatcher.c

index 7154b47..7ca5669 100644 (file)
@@ -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;
index 70798f3..652e938 100644 (file)
@@ -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)) -
index a9d3b7f..e202734 100644 (file)
@@ -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;