Skip to content

Commit

Permalink
e2fsck: fix various -Wall nits picked up by clang
Browse files Browse the repository at this point in the history
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
tytso committed Mar 28, 2024
1 parent 33ee0c8 commit b112f90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions e2fsck/ea_refcount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -177,7 +177,7 @@ static struct ea_refcount_el *get_refcount_el(ext2_refcount_t refcount,
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;
Expand Down
9 changes: 6 additions & 3 deletions e2fsck/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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++) {
Expand Down Expand Up @@ -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)) -
Expand Down
2 changes: 1 addition & 1 deletion e2fsck/sigcatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b112f90

Please sign in to comment.