summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@clusterfs.com>2007-05-25 11:18:11 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-05-25 11:18:11 -0400
commitde8f3a76218255e443ba57dec5d74850180fa75d (patch)
tree74c6aef6e2431b67990c6fbf3f32652f3de316a9
parentf954ba012fbff61730890115308e78de6720ad5f (diff)
downloade2fsprogs-de8f3a76218255e443ba57dec5d74850180fa75d.tar.gz
Fix gcc -Wall warnings, especially on 64-bit systems
Signed-off-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--debugfs/ChangeLog11
-rw-r--r--debugfs/debugfs.c21
-rw-r--r--debugfs/htree.c2
-rw-r--r--debugfs/ls.c4
-rw-r--r--debugfs/util.c2
-rw-r--r--e2fsck/ChangeLog3
-rw-r--r--e2fsck/message.c10
-rw-r--r--lib/blkid/ChangeLog5
-rw-r--r--lib/blkid/getsize.c3
-rw-r--r--lib/blkid/read.c3
-rw-r--r--lib/blkid/tst_types.c32
-rw-r--r--lib/et/ChangeLog5
-rw-r--r--lib/et/error_message.c6
-rw-r--r--lib/ext2fs/ChangeLog7
-rw-r--r--lib/ext2fs/icount.c5
-rw-r--r--lib/ext2fs/tst_bitops.c10
-rw-r--r--lib/ext2fs/tst_types.c34
-rw-r--r--misc/ChangeLog5
-rw-r--r--misc/filefrag.c3
-rw-r--r--misc/mke2fs.c11
-rw-r--r--resize/ChangeLog18
-rw-r--r--resize/main.c2
-rw-r--r--resize/online.c9
-rw-r--r--resize/resize2fs.c6
-rw-r--r--resize/resize2fs.h2
-rw-r--r--resize/sim_progress.c2
26 files changed, 144 insertions, 77 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog
index 94524fab..c3731dbc 100644
--- a/debugfs/ChangeLog
+++ b/debugfs/ChangeLog
@@ -1,3 +1,14 @@
+2007-05-22 Theodore Tso <tytso@mit.edu>
+
+ * util.c: #define _XOPEN_SOURCE so we get strptime() prototype
+
+ * htree.c (search_dir_block), ls.c (list_dir_proc), debugfs.c
+ (finish_range, dump_blocks, internal_dump_inode): Fix gcc
+ -Wall warnings on 64-bit systems.
+
+ * debugfs.c (internal_dump_inode_extra): Mark prefix and inode_num
+ parameters as unused.
+
2007-05-08 Theodore Tso <tytso@mit.edu>
* debugfs.c (internal_dump_inode), ls.c (list_dir_proc),
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index b84b96e2..66354710 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -378,10 +378,12 @@ static void finish_range(struct list_blocks_struct *lb)
else
fprintf(lb->f, ", ");
if (lb->first_block == lb->last_block)
- fprintf(lb->f, "(%lld):%u", lb->first_bcnt, lb->first_block);
+ fprintf(lb->f, "(%lld):%u",
+ (long long)lb->first_bcnt, lb->first_block);
else
- fprintf(lb->f, "(%lld-%lld):%u-%u", lb->first_bcnt,
- lb->last_bcnt, lb->first_block, lb->last_block);
+ fprintf(lb->f, "(%lld-%lld):%u-%u",
+ (long long)lb->first_bcnt, (long long)lb->last_bcnt,
+ lb->first_block, lb->last_block);
lb->first_block = 0;
}
@@ -449,8 +451,9 @@ static void dump_xattr_string(FILE *out, const char *str, int len)
fprintf(out, "%02x ", (unsigned char)str[i]);
}
-static void internal_dump_inode_extra(FILE *out, const char *prefix,
- ext2_ino_t inode_num,
+static void internal_dump_inode_extra(FILE *out,
+ const char *prefix EXT2FS_ATTR((unused)),
+ ext2_ino_t inode_num EXT2FS_ATTR((unused)),
struct ext2_inode_large *inode)
{
struct ext2_ext_attr_entry *entry;
@@ -508,7 +511,7 @@ static void dump_blocks(FILE *f, const char *prefix, ext2_ino_t inode)
list_blocks_proc, (void *)&lb);
finish_range(&lb);
if (lb.total)
- fprintf(f, "\n%sTOTAL: %lld\n", prefix, lb.total);
+ fprintf(f, "\n%sTOTAL: %lld\n", prefix, (long long)lb.total);
fprintf(f,"\n");
}
@@ -536,10 +539,10 @@ void internal_dump_inode(FILE *out, const char *prefix,
fprintf(out, "%sUser: %5d Group: %5d Size: ",
prefix, inode_uid(*inode), inode_gid(*inode));
if (LINUX_S_ISREG(inode->i_mode)) {
- __u64 i_size = (inode->i_size |
- ((unsigned long long)inode->i_size_high << 32));
+ unsigned long long i_size = (inode->i_size |
+ ((unsigned long long)inode->i_size_high << 32));
- fprintf(out, "%lld\n", i_size);
+ fprintf(out, "%llu\n", i_size);
} else
fprintf(out, "%d\n", inode->i_size);
if (os == EXT2_OS_HURD)
diff --git a/debugfs/htree.c b/debugfs/htree.c
index 0f7e9c1d..d0e673eb 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -384,7 +384,7 @@ static int search_dir_block(ext2_filsys fs, blk_t *blocknr,
strncmp(p->search_name, dirent->name,
p->len) == 0) {
printf("Entry found at logical block %lld, "
- "phys %u, offset %u\n", blockcnt,
+ "phys %u, offset %u\n", (long long)blockcnt,
*blocknr, offset);
printf("offset %u\n", offset);
return BLOCK_ABORT;
diff --git a/debugfs/ls.c b/debugfs/ls.c
index 6ae175d3..52c7e34b 100644
--- a/debugfs/ls.c
+++ b/debugfs/ls.c
@@ -92,8 +92,8 @@ static int list_dir_proc(ext2_ino_t dir EXT2FS_ATTR((unused)),
if (LINUX_S_ISDIR(inode.i_mode))
fprintf(ls->f, "%5d", inode.i_size);
else
- fprintf(ls->f, "%5lld", inode.i_size |
- ((__u64)inode.i_size_high << 32));
+ fprintf(ls->f, "%5llu", inode.i_size |
+ ((unsigned long long) inode.i_size_high << 32));
fprintf (ls->f, " %s %s\n", datestr, name);
} else {
sprintf(tmp, "%c%u%c (%d) %s ", lbr, dirent->inode, rbr,
diff --git a/debugfs/util.c b/debugfs/util.c
index 13eb7d99..a490d2cf 100644
--- a/debugfs/util.c
+++ b/debugfs/util.c
@@ -6,6 +6,8 @@
*
*/
+#define _XOPEN_SOURCE /* needed for strptime */
+
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index 505be1b3..bbd23ada 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,5 +1,8 @@
2007-05-22 Theodore Tso <tytso@mit.edu>
+ * message.c (expand_inode_expression, expand_percent_expression):
+ Fix gcc -Wall warnings on 64-bit systems.
+
* pass1.c (e2fsck_pass1_check_device_inode): Mark the fs parameter
as unused.
(e2fsck_setup_tdb_icount): Use profile_get_uint() function
diff --git a/e2fsck/message.c b/e2fsck/message.c
index 5cf126cb..22c71631 100644
--- a/e2fsck/message.c
+++ b/e2fsck/message.c
@@ -264,8 +264,8 @@ static _INLINE_ void expand_inode_expression(char ch,
else
printf("%u", inode->i_size);
#else
- printf("%llu", (inode->i_size |
- ((__u64) inode->i_size_high << 32)));
+ printf("%llu", inode->i_size |
+ ((long long)inode->i_size_high << 32));
#endif
}
break;
@@ -394,7 +394,7 @@ static _INLINE_ void expand_percent_expression(ext2_filsys fs, char ch,
#ifdef EXT2_NO_64_TYPE
printf("%d", ctx->blkcount);
#else
- printf("%lld", ctx->blkcount);
+ printf("%lld", (long long)ctx->blkcount);
#endif
break;
case 'c':
@@ -419,7 +419,7 @@ static _INLINE_ void expand_percent_expression(ext2_filsys fs, char ch,
#ifdef EXT2_NO_64_TYPE
printf("%u", ctx->num);
#else
- printf("%llu", ctx->num);
+ printf("%llu", (long long)ctx->num);
#endif
break;
case 'p':
@@ -445,7 +445,7 @@ static _INLINE_ void expand_percent_expression(ext2_filsys fs, char ch,
#ifdef EXT2_NO_64_TYPE
printf("0x%x", ctx->num);
#else
- printf("0x%llx", ctx->num);
+ printf("0x%llx", (long long)ctx->num);
#endif
break;
default:
diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog
index e33320a0..28e0cbd4 100644
--- a/lib/blkid/ChangeLog
+++ b/lib/blkid/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-23 Theodore Tso <tytso@mit.edu>
+
+ * getsize.c (main), read.c (parse_dev), tst_types.c (main): Fix
+ gcc -Wall warnings on 64-bit systems.
+
2007-05-18 Theodore Tso <tytso@mit.edu>
* tag.c (blkid_set_tag): Fix bug where bid_type, bid_label, and
diff --git a/lib/blkid/getsize.c b/lib/blkid/getsize.c
index 9e908572..04a0cd84 100644
--- a/lib/blkid/getsize.c
+++ b/lib/blkid/getsize.c
@@ -199,7 +199,8 @@ int main(int argc, char **argv)
perror(argv[0]);
bytes = blkid_get_dev_size(fd);
- printf("Device %s has %Ld 1k blocks.\n", argv[1], bytes >> 10);
+ printf("Device %s has %Ld 1k blocks.\n", argv[1],
+ (unsigned long long) bytes >> 10);
return 0;
}
diff --git a/lib/blkid/read.c b/lib/blkid/read.c
index 583b5494..dad6147e 100644
--- a/lib/blkid/read.c
+++ b/lib/blkid/read.c
@@ -197,7 +197,8 @@ static int parse_dev(blkid_cache cache, blkid_dev *dev, char **cp)
start = skip_over_blank(start + 1);
end = skip_over_word(start);
- DBG(DEBUG_READ, printf("device should be %*s\n", end - start, start));
+ DBG(DEBUG_READ, printf("device should be %*s\n",
+ (int)(end - start), start));
if (**cp == '>')
*cp = end;
diff --git a/lib/blkid/tst_types.c b/lib/blkid/tst_types.c
index 7dadb1d7..f5a3f6f8 100644
--- a/lib/blkid/tst_types.c
+++ b/lib/blkid/tst_types.c
@@ -17,43 +17,43 @@
int main(int argc, char **argv)
{
if (sizeof(__u8) != 1) {
- printf("Sizeof(__u8) is %d should be 1\n",
- sizeof(__u8));
+ printf("Sizeof(__u8) is %d should be 1\n",
+ (int)sizeof(__u8));
exit(1);
}
if (sizeof(__s8) != 1) {
- printf("Sizeof(_s8) is %d should be 1\n",
- sizeof(__s8));
+ printf("Sizeof(_s8) is %d should be 1\n",
+ (int)sizeof(__s8));
exit(1);
}
if (sizeof(__u16) != 2) {
- printf("Sizeof(__u16) is %d should be 2\n",
- sizeof(__u16));
+ printf("Sizeof(__u16) is %d should be 2\n",
+ (int)sizeof(__u16));
exit(1);
}
if (sizeof(__s16) != 2) {
- printf("Sizeof(__s16) is %d should be 2\n",
- sizeof(__s16));
+ printf("Sizeof(__s16) is %d should be 2\n",
+ (int)sizeof(__s16));
exit(1);
}
if (sizeof(__u32) != 4) {
- printf("Sizeof(__u32) is %d should be 4\n",
- sizeof(__u32));
+ printf("Sizeof(__u32) is %d should be 4\n",
+ (int)sizeof(__u32));
exit(1);
}
if (sizeof(__s32) != 4) {
- printf("Sizeof(__s32) is %d should be 4\n",
- sizeof(__s32));
+ printf("Sizeof(__s32) is %d should be 4\n",
+ (int)sizeof(__s32));
exit(1);
}
if (sizeof(__u64) != 8) {
- printf("Sizeof(__u64) is %d should be 8\n",
- sizeof(__u64));
+ printf("Sizeof(__u64) is %d should be 8\n",
+ (int)sizeof(__u64));
exit(1);
}
if (sizeof(__s64) != 8) {
- printf("Sizeof(__s64) is %d should be 8\n",
- sizeof(__s64));
+ printf("Sizeof(__s64) is %d should be 8\n",
+ (int)sizeof(__s64));
exit(1);
}
printf("The blkid_types.h types are correct.\n");
diff --git a/lib/et/ChangeLog b/lib/et/ChangeLog
index 8940dd7c..8261084d 100644
--- a/lib/et/ChangeLog
+++ b/lib/et/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-23 Theodore Tso <tytso@mit.edu>
+
+ * error_message.c: #include unistd.h and sys/types.h to provide
+ function prototypes to silence gcc -Wall warnings.
+
2006-12-22 Theodore Tso <tytso@mit.edu>
* error_message.c (add_error_table, remove_error_table): Add
diff --git a/lib/et/error_message.c b/lib/et/error_message.c
index 469ea964..4e84e35c 100644
--- a/lib/et/error_message.c
+++ b/lib/et/error_message.c
@@ -28,6 +28,12 @@
#if (!defined(HAVE_PRCTL) && defined(linux))
#include <sys/syscall.h>
#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
#include "com_err.h"
#include "error_table.h"
#include "internal.h"
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 6806b1f0..def7b2ae 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-23 Theodore Tso <tytso@mit.edu>
+
+ * icount.c (ext2fs_icount_fetch, ext2fs_icount_increment, setup):
+ Remove unusued variables and labels.
+
+ * tst_bitops.c, tst_types.c: Fix gcc -Wall warnings.
+
2007-05-18 Theodore Tso <tytso@mit.edu>
* openfs.c (ext2fs_open2): Set fs->stride from the superblock's
diff --git a/lib/ext2fs/icount.c b/lib/ext2fs/icount.c
index d1e11ae0..de0b6144 100644
--- a/lib/ext2fs/icount.c
+++ b/lib/ext2fs/icount.c
@@ -482,8 +482,6 @@ errcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *out)
errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino, __u16 *ret)
{
- struct ext2_icount_el *el;
-
EXT2_CHECK_MAGIC(icount, EXT2_ET_MAGIC_ICOUNT);
if (!ino || (ino > icount->num_inodes))
@@ -505,7 +503,6 @@ errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino, __u16 *ret)
errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino,
__u16 *ret)
{
- struct ext2_icount_el *el;
__u16 curr_value;
EXT2_CHECK_MAGIC(icount, EXT2_ET_MAGIC_ICOUNT);
@@ -538,7 +535,6 @@ errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino,
* The count was zero; mark the single bitmap
* and return.
*/
- zero_count:
ext2fs_mark_inode_bitmap(icount->single, ino);
if (ret)
*ret = 1;
@@ -731,7 +727,6 @@ struct test_program extended[] = {
static void setup(void)
{
errcode_t retval;
- int i;
struct ext2_super_block param;
initialize_ext2_error_table();
diff --git a/lib/ext2fs/tst_bitops.c b/lib/ext2fs/tst_bitops.c
index a0fb261c..eede295b 100644
--- a/lib/ext2fs/tst_bitops.c
+++ b/lib/ext2fs/tst_bitops.c
@@ -38,7 +38,7 @@ int bits_list[] = {
#define BIG_TEST_BIT (((unsigned) 1 << 31) + 42)
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
int i, j, size;
unsigned char testarray[12];
@@ -115,9 +115,9 @@ main(int argc, char **argv)
exit(1);
ext2fs_clear_bit(BIG_TEST_BIT, bigarray);
-
+
printf("big bit number (%u) test: %d, expected 0\n", BIG_TEST_BIT,
- bigarray[BIG_TEST_BIT >> 3], 0);
+ bigarray[BIG_TEST_BIT >> 3]);
if (bigarray[BIG_TEST_BIT >> 3] != 0)
exit(1);
@@ -161,9 +161,9 @@ main(int argc, char **argv)
exit(1);
ext2fs_fast_clear_bit(BIG_TEST_BIT, bigarray);
-
+
printf("big bit number (%u) test: %d, expected 0\n", BIG_TEST_BIT,
- bigarray[BIG_TEST_BIT >> 3], 0);
+ bigarray[BIG_TEST_BIT >> 3]);
if (bigarray[BIG_TEST_BIT >> 3] != 0)
exit(1);
diff --git a/lib/ext2fs/tst_types.c b/lib/ext2fs/tst_types.c
index 36a04d10..78de7bcf 100644
--- a/lib/ext2fs/tst_types.c
+++ b/lib/ext2fs/tst_types.c
@@ -15,46 +15,46 @@
#include "ext2fs/ext2_types.h"
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
if (sizeof(__u8) != 1) {
- printf("Sizeof(__u8) is %d should be 1\n",
- sizeof(__u8));
+ printf("Sizeof(__u8) is %d should be 1\n",
+ (int)sizeof(__u8));
exit(1);
}
if (sizeof(__s8) != 1) {
- printf("Sizeof(_s8) is %d should be 1\n",
- sizeof(__s8));
+ printf("Sizeof(_s8) is %d should be 1\n",
+ (int)sizeof(__s8));
exit(1);
}
if (sizeof(__u16) != 2) {
- printf("Sizeof(__u16) is %d should be 2\n",
- sizeof(__u16));
+ printf("Sizeof(__u16) is %d should be 2\n",
+ (int)sizeof(__u16));
exit(1);
}
if (sizeof(__s16) != 2) {
- printf("Sizeof(__s16) is %d should be 2\n",
- sizeof(__s16));
+ printf("Sizeof(__s16) is %d should be 2\n",
+ (int)sizeof(__s16));
exit(1);
}
if (sizeof(__u32) != 4) {
- printf("Sizeof(__u32) is %d should be 4\n",
- sizeof(__u32));
+ printf("Sizeof(__u32) is %d should be 4\n",
+ (int)sizeof(__u32));
exit(1);
}
if (sizeof(__s32) != 4) {
- printf("Sizeof(__s32) is %d should be 4\n",
- sizeof(__s32));
+ printf("Sizeof(__s32) is %d should be 4\n",
+ (int)sizeof(__s32));
exit(1);
}
if (sizeof(__u64) != 8) {
- printf("Sizeof(__u64) is %d should be 8\n",
- sizeof(__u64));
+ printf("Sizeof(__u64) is %d should be 8\n",
+ (int)sizeof(__u64));
exit(1);
}
if (sizeof(__s64) != 8) {
- printf("Sizeof(__s64) is %d should be 8\n",
- sizeof(__s64));
+ printf("Sizeof(__s64) is %d should be 8\n",
+ (int)sizeof(__s64));
exit(1);
}
printf("The ext2_types.h types are correct.\n");
diff --git a/misc/ChangeLog b/misc/ChangeLog
index 3b57d0ce..4390c92a 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -1,5 +1,10 @@
2007-05-22 Theodore Tso <tytso@mit.edu>
+ * mke2fs.c (PRS): Make num_inodes use an unsigned long long type
+ to avoid type warnings on 64-bit platforms.
+
+ * filefrag.c (frag_report): Fix printf type warning on 64-bit systems.
+
* mke2fs.c (PRS): Add sanity check if the inode size * inode count
is bigger than the filesystem size.
diff --git a/misc/filefrag.c b/misc/filefrag.c
index e625d4c7..27675b19 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -110,7 +110,8 @@ static void frag_report(const char *filename)
(fsinfo.f_type == 0xef53))
is_ext2++;
if (verbose) {
- printf("Filesystem type is: %x\n", fsinfo.f_type);
+ printf("Filesystem type is: %lx\n",
+ (unsigned long) fsinfo.f_type);
}
cylgroups = div_ceil(fsinfo.f_blocks, fsinfo.f_bsize*8);
if (verbose) {
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 737e3da5..204b8a99 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -908,7 +908,7 @@ static void PRS(int argc, char *argv[])
double reserved_ratio = 5.0;
int sector_size = 0;
int show_version_only = 0;
- __u64 num_inodes = 0; /* u64 to catch too-large input */
+ unsigned long long num_inodes = 0; /* unsigned long long to catch too-large input */
errcode_t retval;
char * oldpath = getenv("PATH");
char * extended_opts = 0;
@@ -1469,8 +1469,8 @@ static void PRS(int argc, char *argv[])
/* Make sure number of inodes specified will fit in 32 bits */
if (num_inodes == 0) {
- __u64 n;
- n = (__u64) fs_param.s_blocks_count * blocksize / inode_ratio;
+ unsigned long long n;
+ n = (unsigned long long) fs_param.s_blocks_count * blocksize / inode_ratio;
if (n > ~0U) {
com_err(program_name, 0,
_("too many inodes (%llu), raise inode ratio?"), n);
@@ -1479,7 +1479,7 @@ static void PRS(int argc, char *argv[])
} else if (num_inodes > ~0U) {
com_err(program_name, 0,
_("too many inodes (%llu), specify < 2^32 inodes"),
- (__u64)num_inodes);
+ num_inodes);
exit(1);
}
/*
@@ -1499,7 +1499,8 @@ static void PRS(int argc, char *argv[])
"specify higher inode_ratio (-i)\n\t"
"or lower inode count (-N).\n"),
inode_size ? inode_size : EXT2_GOOD_OLD_INODE_SIZE,
- fs_param.s_inodes_count, fs_param.s_blocks_count);
+ fs_param.s_inodes_count,
+ (unsigned long) fs_param.s_blocks_count);
exit(1);
}
diff --git a/resize/ChangeLog b/resize/ChangeLog
index d0f0fae6..e1f616bf 100644
--- a/resize/ChangeLog
+++ b/resize/ChangeLog
@@ -1,3 +1,21 @@
+2007-05-22 Theodore Tso <tytso@mit.edu>
+
+ * sim_progress.c (ext2fs_progress_init): Fix type-punning warning.
+
+ * resize2fs.h: #include the e2p.h header file to get the function
+ prototypes.
+
+ * resize2fs.c (adjust_fs_info): Declare new_inodes as an unsigned
+ long long to avoid gcc -Wall complaints on 64-bit
+ platforms.
+ (adjust_fs_info): Fix signed vs unsigned complaint.
+
+ * online.c (online_resize_fs): Mark flags parameter as unused.
+ Make new_desc_blocks be an unsigned long to fix signed
+ vs. unsigned comparsions, and fix up the printf format
+
+ * main.c (main): Fix signed vs. unsigned comparison
+
2007-05-18 Theodore Tso <tytso@mit.edu>
* main.c (determine_fs_stride): Use the superblock s_raid_stride
diff --git a/resize/main.c b/resize/main.c
index f9d8b848..7db4ebc3 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -348,7 +348,7 @@ int main (int argc, char ** argv)
}
if (use_stride >= 0) {
- if (use_stride >= fs->super->s_blocks_per_group) {
+ if (use_stride >= (int) fs->super->s_blocks_per_group) {
com_err(program_name, 0,
_("Invalid stride length"));
exit(1);
diff --git a/resize/online.c b/resize/online.c
index e3562e45..36b31857 100644
--- a/resize/online.c
+++ b/resize/online.c
@@ -19,15 +19,16 @@
extern char *program_name;
errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt,
- blk_t *new_size, int flags)
+ blk_t *new_size, int flags EXT2FS_ATTR((unused)))
{
struct ext2_new_group_input input;
struct ext2_super_block *sb = fs->super;
+ unsigned long new_desc_blocks;
ext2_filsys new_fs;
errcode_t retval;
dgrp_t i;
blk_t size;
- int fd, r_frac, overhead, new_desc_blocks;
+ int fd, r_frac, overhead;
printf(_("Filesystem at %s is mounted on %s; "
"on-line resizing required\n"), fs->device_name, mtpt);
@@ -47,8 +48,8 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt,
fs->super->s_first_data_block,
EXT2_BLOCKS_PER_GROUP(fs->super)),
EXT2_DESC_PER_BLOCK(fs->super));
- printf("old desc_blocks = %d, new_desc_blocks = %d\n", fs->desc_blocks,
- new_desc_blocks);
+ printf("old desc_blocks = %lu, new_desc_blocks = %lu\n",
+ fs->desc_blocks, new_desc_blocks);
if (!(fs->super->s_feature_compat &
EXT2_FEATURE_COMPAT_RESIZE_INODE) &&
new_desc_blocks != fs->desc_blocks) {
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 4b1ca225..a25cb05a 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -186,7 +186,7 @@ errcode_t adjust_fs_info(ext2_filsys fs, ext2_filsys old_fs, blk_t new_size)
unsigned long i, j, old_desc_blocks, max_group;
unsigned int meta_bg, meta_bg_size;
int has_super;
- __u64 new_inodes; /* u64 to check for overflow */
+ unsigned long long new_inodes; /* u64 to check for overflow */
fs->super->s_blocks_count = new_size;
@@ -227,7 +227,7 @@ retry:
/*
* Adjust the number of inodes
*/
- new_inodes =(__u64)fs->super->s_inodes_per_group * fs->group_desc_count;
+ new_inodes =(unsigned long long) fs->super->s_inodes_per_group * fs->group_desc_count;
if (new_inodes > ~0U) {
fprintf(stderr, _("inodes (%llu) must be less than %u"),
new_inodes, ~0U);
@@ -303,7 +303,7 @@ retry:
(old_fs->desc_blocks - fs->desc_blocks);
if (new < 0)
new = 0;
- if (new > fs->blocksize/4)
+ if (new > (int) fs->blocksize/4)
new = fs->blocksize/4;
fs->super->s_reserved_gdt_blocks = new;
if (new == 0)
diff --git a/resize/resize2fs.h b/resize/resize2fs.h
index 8d325c10..f87d04e4 100644
--- a/resize/resize2fs.h
+++ b/resize/resize2fs.h
@@ -31,9 +31,11 @@
#if EXT2_FLAT_INCLUDES
#include "ext2_fs.h"
#include "ext2fs.h"
+#include "e2p.h"
#else
#include "ext2fs/ext2_fs.h"
#include "ext2fs/ext2fs.h"
+#include "e2p/e2p.h"
#endif
#ifdef ENABLE_NLS
diff --git a/resize/sim_progress.c b/resize/sim_progress.c
index 103a727f..400e364b 100644
--- a/resize/sim_progress.c
+++ b/resize/sim_progress.c
@@ -87,7 +87,7 @@ errcode_t ext2fs_progress_init(ext2_sim_progmeter *ret_prog,
return retval;
memset(prog, 0, sizeof(struct ext2_sim_progress));
- retval = ext2fs_get_mem(strlen(label)+1, (void **) &prog->label);
+ retval = ext2fs_get_mem(strlen(label)+1, &prog->label);
if (retval) {
free(prog);
return retval;