build: fix miscellaneous build warnings
PATCH 1/1 build: fix miscellaneous build warnings
Fix various unused variable and use-uninitialized warnings.
Add generated files into .gitignore.
Signed-off-by Andreas Dilger <[email protected]>
--- .gitignore | 8 ++++++++ lib/blkid/save.c | 2 +- lib/ext2fs/alloc.c | 2 +- lib/ext2fs/blkmap64_rb.c | 5 +---- lib/ext2fs/csum.c | 1 - lib/ext2fs/gen_bitmap64.c | 2 -- misc/mk_hugefiles.c | 2 +- misc/mke2fs.c | 3 +-- misc/tune2fs.c | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-)
.gitignore +8 -0
@@ -8,9 +8,11 @@ FILES patches Makefile *.bak +*.diff *.dSYM *.o *.orig +*.patch *.pc *.rej *.swp
@@ -22,6 +24,7 @@ config.status debugfs/debug_cmds.c debugfs/debugfs debugfs/debugfs.8 +debugfs/extent_cmds.c doc/libext2fs.aux doc/libext2fs.cp doc/libext2fs.dvi
@@ -159,9 +162,11 @@ misc/e2undo misc/e2undo.8 misc/e4defrag misc/e4defrag.8 +misc/ext4.5 misc/filefrag misc/filefrag.8 misc/findfs.8 +misc/findsuper misc/fsck misc/fsck.8 misc/logsave
@@ -195,6 +200,7 @@ tags TAGS tests/progs/test_icount tests/progs/test_icount_cmds.c +tests/progs/crcsum tests/*.ok tests/*.failed tests/*.log
@@ -202,7 +208,9 @@ tests/*.tmp tests/mke2fs.conf tests/test_script tests/test_one +util/dirpaths.h util/gen-tarball +util/install-symlink util/subst util/subst.conf Meta
lib/blkid/save.c +1 -1
@@ -146,7 +146,7 @@ int blkid_flush_cache(blkid_cache cache)if (backup) {sprintf (backup,"%s.old" , filename);unlink (backup); -link (filename, backup); + (void )link (filename, backup);free (backup); }if (rename (opened, filename) <0 )
lib/ext2fs/alloc.c +1 -1
@@ -138,7 +138,7 @@ errcode_t ext2fs_new_block2(ext2_filsys fs, blk64_t goal, ext2fs_block_bitmap map, blk64_t *ret) { errcode_t retval; -blk64_t b; +blk64_t b =0 ;EXT2_CHECK_MAGIC (fs,EXT2_ET_MAGIC_EXT2FS_FILSYS );
lib/ext2fs/blkmap64_rb.c +1 -4
@@ -813,10 +813,8 @@ static errcode_t rb_find_first_zero(ext2fs_generic_bitmap bitmap, __u64 start, __u64 end, __u64 *out) { struct rb_node *parent = NULL, **n; -struct rb_node *node, *next;struct ext2fs_rb_private *bp;struct bmap_rb_extent *ext; -int retval =1 ; bp = (struct ext2fs_rb_private *) bitmap->private; n = &bp->root.rb_node;
@@ -851,10 +849,9 @@ static errcode_t rb_find_first_set(ext2fs_generic_bitmap bitmap, __u64 start, __u64 end, __u64 *out) { struct rb_node *parent = NULL, **n; -struct rb_node *node, *next; +struct rb_node *node;struct ext2fs_rb_private *bp;struct bmap_rb_extent *ext; -int retval =1 ; bp = (struct ext2fs_rb_private *) bitmap->private; n = &bp->root.rb_node;
lib/ext2fs/csum.c +0 -1
@@ -35,7 +35,6 @@ __u16 ext2fs_group_desc_csum(ext2_filsys fs, dgrp_t group)struct ext2_group_desc *desc =ext2fs_group_desc (fs, fs->group_desc, group);size_t size =EXT2_DESC_SIZE (fs->super); -size_t offset;__u16 crc =0 ;if (fs->super->s_feature_ro_compat &EXT4_FEATURE_RO_COMPAT_GDT_CSUM ) {
lib/ext2fs/gen_bitmap64.c +0 -2
@@ -800,7 +800,6 @@ errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs,errcode_t ext2fs_find_first_zero_generic_bmap (ext2fs_generic_bitmap bitmap,__u64 start,__u64 end,__u64 *out) { -int b;__u64 cstart, cend, cout;errcode_t retval;
@@ -855,7 +854,6 @@ errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,errcode_t ext2fs_find_first_set_generic_bmap (ext2fs_generic_bitmap bitmap,__u64 start,__u64 end,__u64 *out) { -int b;__u64 cstart, cend, cout;errcode_t retval;
misc/mk_hugefiles.c +1 -1
@@ -119,7 +119,7 @@ static errcode_t mk_hugefile(ext2_filsys fs, blk64_t num, {errcode_t retval; -blk64_t lblk, bend; +blk64_t lblk, bend =0 ;__u64 size;blk64_t left;blk64_t count =0 ;
misc/mke2fs.c +1 -2
@@ -115,7 +115,6 @@ char **fs_types;static profile_t profile;static int sys_page_size =4096 ; -static int linux_version_code =0 ;static void usage (void ) {
@@ -2489,7 +2488,7 @@ int main (int argc, char *argv[])errcode_t retval =0 ;ext2_filsys fs;badblocks_list bb_list =0 ; -unsigned int journal_blocks; +unsigned int journal_blocks =0 ;unsigned int i, checkinterval;int max_mnt_count;int val, hash_alg;
misc/tune2fs.c +1 -1
@@ -2052,7 +2052,7 @@ retry_open:printf (_ ("Setting reserved blocks gid to %lu\n" ), resgid); }if (i_flag) { -if (interval >= (1ULL <<32 )) { +if ((unsigned long long )interval >= (1ULL <<32 )) {com_err (program_name,0 ,_ ("interval between checks is too big (%lu)" ), interval);
Signature · 1 line
1.7.3.4
Theodore Ts'o
AppliedQuoted 5 lines · Andreas Dilger
Fix various unused variable and use-uninitialized warnings.
Add generated files into .gitignore.
Signed-off-by Andreas Dilger <[email protected]>
Thanks, applied.
- Ted