fix miscellaneous build warnings

Fix various unused variable and use-uninitialized warnings.

Add generated files into .gitignore.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
maint-test
Andreas Dilger 2014-04-14 12:20:25 -04:00 committed by Theodore Ts'o
parent aa73432f71
commit d8f401b135
9 changed files with 14 additions and 13 deletions

8
.gitignore vendored
View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);