+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),
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;
}
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;
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");
}
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)
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;
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,
*
*/
+#define _XOPEN_SOURCE /* needed for strptime */
+
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
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
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;
#ifdef EXT2_NO_64_TYPE
printf("%d", ctx->blkcount);
#else
- printf("%lld", ctx->blkcount);
+ printf("%lld", (long long)ctx->blkcount);
#endif
break;
case 'c':
#ifdef EXT2_NO_64_TYPE
printf("%u", ctx->num);
#else
- printf("%llu", ctx->num);
+ printf("%llu", (long long)ctx->num);
#endif
break;
case 'p':
#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:
+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
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;
}
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;
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");
+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
#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"
+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
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))
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);
* The count was zero; mark the single bitmap
* and return.
*/
- zero_count:
ext2fs_mark_inode_bitmap(icount->single, ino);
if (ret)
*ret = 1;
static void setup(void)
{
errcode_t retval;
- int i;
struct ext2_super_block param;
initialize_ext2_error_table();
#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];
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);
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);
#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");
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.
(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) {
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;
/* 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);
} 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);
}
/*
"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);
}
+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
}
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);
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);
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) {
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;
/*
* 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);
(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)
#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
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;