From: Christoph Hellwig Date: Sat, 16 Jul 2011 17:40:19 +0000 (-0700) Subject: xfsprogs: fix gcc 4.6 variable set but not used warnings X-Git-Tag: v3.1.6~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a9371e218a741c5c3f07a1e663b4b9a561bc6ed8;p=thirdparty%2Fxfsprogs-dev.git xfsprogs: fix gcc 4.6 variable set but not used warnings Signed-off-by: Christoph Hellwig Signed-off-by: Alex Elder --- diff --git a/db/attrset.c b/db/attrset.c index 35fea111c..21980ef06 100644 --- a/db/attrset.c +++ b/db/attrset.c @@ -80,7 +80,7 @@ attr_set_f( { xfs_inode_t *ip = NULL; char *name, *value, *sp; - int c, namelen, valuelen = 0, flags = 0; + int c, valuelen = 0, flags = 0; if (cur_typ == NULL) { dbprintf(_("no current type\n")); @@ -139,7 +139,6 @@ attr_set_f( } name = argv[optind]; - namelen = strlen(name); if (valuelen) { value = (char *)memalign(getpagesize(), valuelen); @@ -183,7 +182,7 @@ attr_remove_f( { xfs_inode_t *ip = NULL; char *name; - int c, namelen, flags = 0; + int c, flags = 0; if (cur_typ == NULL) { dbprintf(_("no current type\n")); @@ -225,7 +224,6 @@ attr_remove_f( } name = argv[optind]; - namelen = strlen(name); if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &ip, 0)) { dbprintf(_("failed to iget inode %llu\n"), diff --git a/db/bmroot.c b/db/bmroot.c index 364987363..3e18917a6 100644 --- a/db/bmroot.c +++ b/db/bmroot.c @@ -192,11 +192,9 @@ bmrootd_key_offset( { xfs_bmdr_block_t *block; xfs_bmdr_key_t *kp; - xfs_dinode_t *dip; ASSERT(bitoffs(startoff) == 0); ASSERT(obj == iocur_top->data); - dip = obj; block = (xfs_bmdr_block_t *)((char *)obj + byteize(startoff)); ASSERT(be16_to_cpu(block->bb_level) > 0); kp = XFS_BMDR_KEY_ADDR(block, idx); diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c index 4a86b9dac..98ce5df6d 100644 --- a/growfs/xfs_growfs.c +++ b/growfs/xfs_growfs.c @@ -304,7 +304,6 @@ main(int argc, char **argv) error = 0; if (dflag | aflag) { xfs_growfs_data_t in; - __uint64_t new_agcount; if (!mflag) maxpct = geo.imaxpct; @@ -318,9 +317,6 @@ main(int argc, char **argv) error = 1; } - new_agcount = dsize / geo.agblocks - + (dsize % geo.agblocks != 0); - if (!error && dsize < geo.datablocks) { fprintf(stderr, _("data size %lld too small," " old size is %lld\n"), diff --git a/io/fiemap.c b/io/fiemap.c index fa990cc4d..066e693f1 100644 --- a/io/fiemap.c +++ b/io/fiemap.c @@ -163,7 +163,6 @@ fiemap_f( int max_extents = 0; int num_extents = 32; int last = 0; - int nflag = 0; int lflag = 0; int vflag = 0; int fiemap_flags = FIEMAP_FLAG_SYNC; @@ -190,7 +189,6 @@ fiemap_f( break; case 'n': max_extents = atoi(optarg); - nflag = 1; break; case 'v': vflag++; diff --git a/repair/phase6.c b/repair/phase6.c index d0560631f..7ef6278a2 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -3217,7 +3217,6 @@ process_dir_inode( xfs_fsblock_t first; xfs_inode_t *ip; xfs_trans_t *tp; - xfs_dahash_t hashval; dir_hash_tab_t *hashtab; int need_dot, committed; int dirty, num_illegal, error, nres; @@ -3344,8 +3343,6 @@ process_dir_inode( } dir_hash_done(hashtab); - hashval = 0; - /* * We don't support repairing of v1 dir anymore, report errors and exit */ diff --git a/rtcp/xfs_rtcp.c b/rtcp/xfs_rtcp.c index d91da3194..6ea7ab930 100644 --- a/rtcp/xfs_rtcp.c +++ b/rtcp/xfs_rtcp.c @@ -36,7 +36,6 @@ main(int argc, char **argv) { register int c, i, r, errflg = 0; struct stat64 s2; - int eflag; int extsize = - 1; progname = basename(argv[0]); @@ -47,7 +46,6 @@ main(int argc, char **argv) while ((c = getopt(argc, argv, "pe:V")) != EOF) { switch (c) { case 'e': - eflag = 1; extsize = atoi(optarg); break; case 'p':