diff options
author | Theodore Ts'o <tytso@mit.edu> | 2003-12-07 01:28:50 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2003-12-07 01:28:50 -0500 |
commit | 544349270e4c74a6feb971123884a8cf5052a7ee (patch) | |
tree | 7c3c483148953f1cd5eadc9cf5eb6f7faabc31c5 /e2fsck | |
parent | 3de085dd4109e6a7049dd6b85abf0313167cab5b (diff) | |
download | e2fsprogs-544349270e4c74a6feb971123884a8cf5052a7ee.tar.gz |
Fix gcc -Wall nitpicks
Diffstat (limited to 'e2fsck')
-rw-r--r-- | e2fsck/ChangeLog | 5 | ||||
-rw-r--r-- | e2fsck/badblocks.c | 8 | ||||
-rw-r--r-- | e2fsck/dict.c | 10 | ||||
-rw-r--r-- | e2fsck/ea_refcount.c | 4 | ||||
-rw-r--r-- | e2fsck/ehandler.c | 8 | ||||
-rw-r--r-- | e2fsck/journal.c | 8 | ||||
-rw-r--r-- | e2fsck/pass1.c | 29 | ||||
-rw-r--r-- | e2fsck/pass1b.c | 32 | ||||
-rw-r--r-- | e2fsck/pass2.c | 31 | ||||
-rw-r--r-- | e2fsck/pass3.c | 10 | ||||
-rw-r--r-- | e2fsck/pass5.c | 22 | ||||
-rw-r--r-- | e2fsck/problem.c | 2 | ||||
-rw-r--r-- | e2fsck/rehash.c | 10 | ||||
-rw-r--r-- | e2fsck/super.c | 12 | ||||
-rw-r--r-- | e2fsck/swapfs.c | 3 | ||||
-rw-r--r-- | e2fsck/unix.c | 22 | ||||
-rw-r--r-- | e2fsck/util.c | 3 |
17 files changed, 123 insertions, 96 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index b97949c1..4b92c1bd 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,5 +1,10 @@ 2003-12-07 Theodore Ts'o <tytso@mit.edu> + * badblocks.c, dict.c, ea_refcount.c, ehandler.c, journal.c, + pass1.c, pass1b.c, pass2.c, pass3.c, pass5.c, problem.c, + rehash.c, super.c, swapfs.c, unix.c, util.c, e2fsck.h: Fix + gcc -Wall nitpicks. + * recovery.c, jfs_user.h: Sync recovery.c with latest 2.5 kernel version. diff --git a/e2fsck/badblocks.c b/e2fsck/badblocks.c index 572af203..09ef3ab1 100644 --- a/e2fsck/badblocks.c +++ b/e2fsck/badblocks.c @@ -17,7 +17,7 @@ static int check_bb_inode_blocks(ext2_filsys fs, blk_t *block_nr, int blockcnt, void *priv_data); -static void invalid_block(ext2_filsys fs, blk_t blk) +static void invalid_block(ext2_filsys fs EXT2FS_ATTR((unused)), blk_t blk) { printf(_("Bad block %u out of range; ignored.\n"), blk); return; @@ -113,8 +113,10 @@ fatal: } -static int check_bb_inode_blocks(ext2_filsys fs, blk_t *block_nr, int blockcnt, - void *priv_data) +static int check_bb_inode_blocks(ext2_filsys fs, + blk_t *block_nr, + int blockcnt EXT2FS_ATTR((unused)), + void *priv_data EXT2FS_ATTR((unused))) { if (!*block_nr) return 0; diff --git a/e2fsck/dict.c b/e2fsck/dict.c index 350ce752..bccab8bc 100644 --- a/e2fsck/dict.c +++ b/e2fsck/dict.c @@ -20,6 +20,12 @@ #define NDEBUG +#ifdef __GNUC__ +#define EXT2FS_ATTR(x) __attribute__(x) +#else +#define EXT2FS_ATTR(x) +#endif + #include <stdlib.h> #include <stddef.h> #include <assert.h> @@ -963,12 +969,12 @@ int dict_contains(dict_t *dict, dnode_t *node) return verify_dict_has_node(dict_nil(dict), dict_root(dict), node); } -static dnode_t *dnode_alloc(void *context) +static dnode_t *dnode_alloc(void *context EXT2FS_ATTR((unused))) { return malloc(sizeof *dnode_alloc(NULL)); } -static void dnode_free(dnode_t *node, void *context) +static void dnode_free(dnode_t *node, void *context EXT2FS_ATTR((unused))) { free(node); } diff --git a/e2fsck/ea_refcount.c b/e2fsck/ea_refcount.c index de13316e..6420c728 100644 --- a/e2fsck/ea_refcount.c +++ b/e2fsck/ea_refcount.c @@ -28,7 +28,7 @@ struct ea_refcount_el { struct ea_refcount { blk_t count; blk_t size; - int cursor; + blk_t cursor; struct ea_refcount_el *list; }; @@ -83,7 +83,7 @@ errout: */ static void refcount_collapse(ext2_refcount_t refcount) { - int i, j; + unsigned int i, j; struct ea_refcount_el *list; list = refcount->list; diff --git a/e2fsck/ehandler.c b/e2fsck/ehandler.c index d4060c40..16d6d4fa 100644 --- a/e2fsck/ehandler.c +++ b/e2fsck/ehandler.c @@ -23,8 +23,8 @@ static errcode_t e2fsck_handle_read_error(io_channel channel, unsigned long block, int count, void *data, - size_t size, - int actual, + size_t size EXT2FS_ATTR((unused)), + int actual EXT2FS_ATTR((unused)), errcode_t error) { int i; @@ -69,8 +69,8 @@ static errcode_t e2fsck_handle_write_error(io_channel channel, unsigned long block, int count, const void *data, - size_t size, - int actual, + size_t size EXT2FS_ATTR((unused)), + int actual EXT2FS_ATTR((unused)), errcode_t error) { int i; diff --git a/e2fsck/journal.c b/e2fsck/journal.c index 615bd3ea..c645f3be 100644 --- a/e2fsck/journal.c +++ b/e2fsck/journal.c @@ -101,8 +101,8 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhp[]) 1, bh->b_data); if (retval) { com_err(bh->b_ctx->device_name, retval, - "while reading block %ld\n", - bh->b_blocknr); + "while reading block %lu\n", + (unsigned long) bh->b_blocknr); bh->b_err = retval; continue; } @@ -115,8 +115,8 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhp[]) 1, bh->b_data); if (retval) { com_err(bh->b_ctx->device_name, retval, - "while writing block %ld\n", - bh->b_blocknr); + "while writing block %lu\n", + (unsigned long) bh->b_blocknr); bh->b_err = retval; continue; } diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 58edd0a5..20628078 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -113,7 +113,7 @@ static __u64 ext2_max_sizes[EXT2_MAX_BLOCK_LOG_SIZE - * Free all memory allocated by pass1 in preparation for restarting * things. */ -static void unwind_pass1(ext2_filsys fs) +static void unwind_pass1(ext2_filsys fs EXT2FS_ATTR((unused))) { ext2fs_free_mem(&inodes_to_process); inodes_to_process = 0; @@ -165,7 +165,7 @@ int e2fsck_pass1_check_device_inode(ext2_filsys fs, struct ext2_inode *inode) int e2fsck_pass1_check_symlink(ext2_filsys fs, struct ext2_inode *inode, char *buf) { - int len; + unsigned int len; int i; blk_t blocks; @@ -757,7 +757,8 @@ endit: * When the inode_scan routines call this callback at the end of the * glock group, call process_inodes. */ -static errcode_t scan_callback(ext2_filsys fs, ext2_inode_scan scan, +static errcode_t scan_callback(ext2_filsys fs, + ext2_inode_scan scan EXT2FS_ATTR((unused)), dgrp_t group, void * priv_data) { struct scan_callback_struct *scan_struct; @@ -1144,7 +1145,8 @@ clear_extattr: /* Returns 1 if bad htree, 0 if OK */ static int handle_htree(e2fsck_t ctx, struct problem_context *pctx, - ext2_ino_t ino, struct ext2_inode *inode, + ext2_ino_t ino EXT2FS_ATTR((unused)), + struct ext2_inode *inode, char *block_buf) { struct ext2_dx_root_info *root; @@ -1320,7 +1322,7 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx, } else { size = EXT2_I_SIZE(inode); if ((pb.last_block >= 0) && - (size < pb.last_block * fs->blocksize)) + (size < (__u64) pb.last_block * fs->blocksize)) bad_size = 3; else if (size > ext2_max_sizes[fs->super->s_log_block_size]) bad_size = 4; @@ -1410,8 +1412,8 @@ static char *describe_illegal_block(ext2_filsys fs, blk_t block) static int process_block(ext2_filsys fs, blk_t *block_nr, e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct process_block_struct *p; @@ -1545,14 +1547,14 @@ mark_dir: static int process_bad_block(ext2_filsys fs, blk_t *block_nr, e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct process_block_struct *p; blk_t blk = *block_nr; - int first_block; - int i; + blk_t first_block; + dgrp_t i; struct problem_context *pctx; e2fsck_t ctx; @@ -1772,7 +1774,7 @@ static void new_table_block(e2fsck_t ctx, blk_t first_block, int group, static void handle_fs_bad_blocks(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; - int i; + dgrp_t i; int first_block = fs->super->s_first_data_block; for (i = 0; i < fs->group_desc_count; i++) { @@ -1803,7 +1805,8 @@ static void mark_table_blocks(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; blk_t block, b; - int i, j; + dgrp_t i; + int j; struct problem_context pctx; clear_problem_context(&pctx); diff --git a/e2fsck/pass1b.c b/e2fsck/pass1b.c index 39e9030c..f368d843 100644 --- a/e2fsck/pass1b.c +++ b/e2fsck/pass1b.c @@ -159,7 +159,8 @@ static void add_dupe(e2fsck_t ctx, ext2_ino_t ino, blk_t blk, /* * Free a duplicate inode record */ -static void inode_dnode_free(dnode_t *node, void *context) +static void inode_dnode_free(dnode_t *node, + void *context EXT2FS_ATTR((unused))) { struct dup_inode *di; struct block_el *p, *next; @@ -175,7 +176,8 @@ static void inode_dnode_free(dnode_t *node, void *context) /* * Free a duplicate block record */ -static void block_dnode_free(dnode_t *node, void *context) +static void block_dnode_free(dnode_t *node, + void *context EXT2FS_ATTR((unused))) { struct dup_block *db; struct inode_el *p, *next; @@ -298,11 +300,11 @@ static void pass1b(e2fsck_t ctx, char *block_buf) e2fsck_use_inode_shortcuts(ctx, 0); } -static int process_pass1b_block(ext2_filsys fs, +static int process_pass1b_block(ext2_filsys fs EXT2FS_ATTR((unused)), blk_t *block_nr, - e2_blkcnt_t blockcnt, - blk_t ref_blk, - int ref_offset, + e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)), + blk_t ref_blk EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct process_block_struct *p; @@ -342,8 +344,10 @@ struct search_dir_struct { static int search_dirent_proc(ext2_ino_t dir, int entry, struct ext2_dir_entry *dirent, - int offset, int blocksize, - char *buf, void *priv_data) + int offset EXT2FS_ATTR((unused)), + int blocksize EXT2FS_ATTR((unused)), + char *buf EXT2FS_ATTR((unused)), + void *priv_data) { struct search_dir_struct *sd; struct dup_inode *p; @@ -521,9 +525,9 @@ static void decrement_badcount(e2fsck_t ctx, blk_t block, struct dup_block *p) static int delete_file_block(ext2_filsys fs, blk_t *block_nr, - e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)), + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct process_block_struct *pb; @@ -623,8 +627,8 @@ struct clone_struct { static int clone_file_block(ext2_filsys fs, blk_t *block_nr, e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct dup_block *p; @@ -769,7 +773,7 @@ static int check_if_fs_block(e2fsck_t ctx, blk_t test_block) { ext2_filsys fs = ctx->fs; blk_t block; - int i; + dgrp_t i; block = fs->super->s_first_data_block; for (i = 0; i < fs->group_desc_count; i++) { diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index 6f2ac937..dee2c194 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -96,7 +96,7 @@ void e2fsck_pass2(e2fsck_t ctx) struct check_dir_struct cd; struct dx_dir_info *dx_dir; struct dx_dirblock_info *dx_db, *dx_parent; - blk_t b; + int b; int i, depth; problem_t code; int bad_dir; @@ -459,7 +459,8 @@ static int check_dotdot(e2fsck_t ctx, */ static int check_name(e2fsck_t ctx, struct ext2_dir_entry *dirent, - ext2_ino_t dir_ino, struct problem_context *pctx) + ext2_ino_t dir_ino EXT2FS_ATTR((unused)), + struct problem_context *pctx) { int i; int fixup = -1; @@ -483,8 +484,9 @@ static int check_name(e2fsck_t ctx, * Check the directory filetype (if present) */ static _INLINE_ int check_filetype(e2fsck_t ctx, - struct ext2_dir_entry *dirent, - ext2_ino_t dir_ino, struct problem_context *pctx) + struct ext2_dir_entry *dirent, + ext2_ino_t dir_ino EXT2FS_ATTR((unused)), + struct problem_context *pctx) { int filetype = dirent->name_len >> 8; int should_be = EXT2_FT_UNKNOWN; @@ -591,7 +593,7 @@ static void parse_int_node(ext2_filsys fs, #endif blk = ext2fs_le32_to_cpu(ent[i].block) & 0x0ffffff; /* Check to make sure the block is valid */ - if (blk > dx_dir->numblocks) { + if (blk > (blk_t) dx_dir->numblocks) { cd->pctx.blk = blk; if (fix_problem(cd->ctx, PR_2_HTREE_BADBLK, &cd->pctx)) @@ -644,7 +646,7 @@ clear_and_exit: static void salvage_directory(ext2_filsys fs, struct ext2_dir_entry *dirent, struct ext2_dir_entry *prev, - int *offset) + unsigned int *offset) { char *cp = (char *) dirent; int left = fs->blocksize - *offset - dirent->rec_len; @@ -708,7 +710,7 @@ static int check_dir_block(ext2_filsys fs, #endif /* ENABLE_HTREE */ struct ext2_dir_entry *dirent, *prev; ext2_dirhash_t hash; - int offset = 0; + unsigned int offset = 0; int dir_modified = 0; int dot_state; blk_t block_nr = db->blk; @@ -1071,9 +1073,9 @@ abort_free_dict: */ static int deallocate_inode_block(ext2_filsys fs, blk_t *block_nr, - e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)), + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { e2fsck_t ctx = (e2fsck_t) priv_data; @@ -1287,7 +1289,8 @@ extern int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir, */ static int allocate_dir_block(e2fsck_t ctx, struct ext2_db_entry *db, - char *buf, struct problem_context *pctx) + char *buf EXT2FS_ATTR((unused)), + struct problem_context *pctx) { ext2_filsys fs = ctx->fs; blk_t blk; @@ -1366,11 +1369,11 @@ static int allocate_dir_block(e2fsck_t ctx, /* * This is a helper function for allocate_dir_block(). */ -static int update_dir_block(ext2_filsys fs, +static int update_dir_block(ext2_filsys fs EXT2FS_ATTR((unused)), blk_t *block_nr, e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct ext2_db_entry *db; diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c index bafcb4cc..e2bdd544 100644 --- a/e2fsck/pass3.c +++ b/e2fsck/pass3.c @@ -611,9 +611,9 @@ struct fix_dotdot_struct { }; static int fix_dotdot_proc(struct ext2_dir_entry *dirent, - int offset, - int blocksize, - char *buf, + int offset EXT2FS_ATTR((unused)), + int blocksize EXT2FS_ATTR((unused)), + char *buf EXT2FS_ATTR((unused)), void *priv_data) { struct fix_dotdot_struct *fp = (struct fix_dotdot_struct *) priv_data; @@ -691,8 +691,8 @@ struct expand_dir_struct { static int expand_dir_proc(ext2_filsys fs, blk_t *blocknr, e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct expand_dir_struct *es = (struct expand_dir_struct *) priv_data; diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c index 862b7e04..e708fa41 100644 --- a/e2fsck/pass5.c +++ b/e2fsck/pass5.c @@ -114,8 +114,8 @@ static void check_block_bitmaps(e2fsck_t ctx) blk_t i; int *free_array; int group = 0; - int blocks = 0; - int free_blocks = 0; + unsigned int blocks = 0; + unsigned int free_blocks = 0; int group_free = 0; int actual, bitmap; struct problem_context pctx; @@ -275,17 +275,17 @@ static void check_inode_bitmaps(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; ext2_ino_t i; - int free_inodes = 0; - int group_free = 0; - int dirs_count = 0; - int group = 0; - int inodes = 0; - int *free_array; - int *dir_array; - int actual, bitmap; + unsigned int free_inodes = 0; + int group_free = 0; + int dirs_count = 0; + int group = 0; + unsigned int inodes = 0; + int *free_array; + int *dir_array; + int actual, bitmap; errcode_t retval; struct problem_context pctx; - int problem, save_problem, fixit, had_problem; + int problem, save_problem, fixit, had_problem; clear_problem_context(&pctx); free_array = (int *) e2fsck_allocate_memory(ctx, diff --git a/e2fsck/problem.c b/e2fsck/problem.c index a164bb52..9f0b561d 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -1440,7 +1440,7 @@ static struct latch_descr pr_latch_info[] = { { -1, 0, 0 }, }; -static const struct e2fsck_problem *find_problem(int code) +static const struct e2fsck_problem *find_problem(problem_t code) { int i; diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index c6b0b02c..727e08c2 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -79,15 +79,15 @@ struct out_dir { static int fill_dir_block(ext2_filsys fs, blk_t *block_nr, e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct fill_dir_struct *fd = (struct fill_dir_struct *) priv_data; struct hash_entry *new_array, *ent; struct ext2_dir_entry *dirent; char *dir; - int offset, dir_offset; + unsigned int offset, dir_offset; if (blockcnt < 0) return 0; @@ -589,8 +589,8 @@ struct write_dir_struct { static int write_dir_block(ext2_filsys fs, blk_t *block_nr, e2_blkcnt_t blockcnt, - blk_t ref_block, - int ref_offset, + blk_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct write_dir_struct *wd = (struct write_dir_struct *) priv_data; diff --git a/e2fsck/super.c b/e2fsck/super.c index b6c5e746..9a1ab4c0 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -60,7 +60,7 @@ struct process_block_struct { struct problem_context *pctx; int truncating; int truncate_offset; - blk_t truncate_block; + e2_blkcnt_t truncate_block; int truncated_blocks; int abort; errcode_t errcode; @@ -68,7 +68,9 @@ struct process_block_struct { static int release_inode_block(ext2_filsys fs, blk_t *block_nr, - int blockcnt, + e2_blkcnt_t blockcnt, + blk_t ref_blk EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), void *priv_data) { struct process_block_struct *pb; @@ -180,7 +182,7 @@ static int release_inode_blocks(e2fsck_t ctx, ext2_ino_t ino, pb.pctx = pctx; if (inode->i_links_count) { pb.truncating = 1; - pb.truncate_block = (blk_t) + pb.truncate_block = (e2_blkcnt_t) ((((long long)inode->i_size_high << 32) + inode->i_size + fs->blocksize - 1) / fs->blocksize); @@ -191,7 +193,7 @@ static int release_inode_blocks(e2fsck_t ctx, ext2_ino_t ino, pb.truncate_offset = 0; } pb.truncated_blocks = 0; - retval = ext2fs_block_iterate(fs, ino, BLOCK_FLAG_DEPTH_TRAVERSE, + retval = ext2fs_block_iterate2(fs, ino, BLOCK_FLAG_DEPTH_TRAVERSE, block_buf, release_inode_block, &pb); if (retval) { com_err("release_inode_blocks", retval, @@ -384,7 +386,7 @@ void check_super_block(e2fsck_t ctx) } } - if (sb->s_log_block_size != sb->s_log_frag_size) { + if (sb->s_log_block_size != (__u32) sb->s_log_frag_size) { pctx.blk = EXT2_BLOCK_SIZE(sb); pctx.blk2 = EXT2_FRAG_SIZE(sb); fix_problem(ctx, PR_0_NO_FRAGMENTS, &pctx); diff --git a/e2fsck/swapfs.c b/e2fsck/swapfs.c index 8e9a134f..3e7609b2 100644 --- a/e2fsck/swapfs.c +++ b/e2fsck/swapfs.c @@ -110,7 +110,8 @@ static void swap_inode_blocks(e2fsck_t ctx, ext2_ino_t ino, char *block_buf, static void swap_inodes(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; - int i, group; + dgrp_t group; + unsigned int i; ext2_ino_t ino = 1; char *buf, *block_buf; errcode_t retval; diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 91511bfb..4c2598f6 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -199,7 +199,7 @@ static void check_mount(e2fsck_t ctx) return; } -static int is_on_batt() +static int is_on_batt(void) { FILE *f; char tmp[80], tmp2[80]; @@ -254,12 +254,12 @@ static void check_if_skip(e2fsck_t ctx) (unsigned) fs->super->s_max_mnt_count*2)) reason = 0; } else if (fs->super->s_checkinterval && - now >= (fs->super->s_lastcheck + - fs->super->s_checkinterval)) { + ((now - fs->super->s_lastcheck) >= + fs->super->s_checkinterval)) { reason = _(" has gone %u days without being checked"); reason_arg = (now - fs->super->s_lastcheck)/(3600*24); - if (batt && (now < (fs->super->s_lastcheck + - fs->super->s_checkinterval*2))) + if (batt && ((now - fs->super->s_lastcheck) < + fs->super->s_checkinterval*2)) reason = 0; } if (reason) { @@ -279,13 +279,13 @@ static void check_if_skip(e2fsck_t ctx) if (next_check <= 0) next_check = 1; } - if (now >= (fs->super->s_lastcheck + fs->super->s_checkinterval)) + if ((now - fs->super->s_lastcheck) >= fs->super->s_checkinterval) next_check = 1; if (next_check <= 5) { if (next_check == 1) fputs(_(" (check after next mount)"), stdout); else - printf(_(" (check in %d mounts)"), next_check); + printf(_(" (check in %ld mounts)"), next_check); } fputc('\n', stdout); ext2fs_close(fs); @@ -336,7 +336,7 @@ int e2fsck_simple_progress(e2fsck_t ctx, const char *label, float percent, { static const char spinner[] = "\\|/-"; int i; - int tick; + unsigned int tick; struct timeval tv; int dpywidth; @@ -437,7 +437,7 @@ static void reserve_stdio_fds(void) } #ifdef HAVE_SIGNAL_H -static void signal_progress_on(int sig) +static void signal_progress_on(int sig EXT2FS_ATTR((unused))) { e2fsck_t ctx = e2fsck_global_ctx; @@ -448,7 +448,7 @@ static void signal_progress_on(int sig) ctx->progress_fd = 0; } -static void signal_progress_off(int sig) +static void signal_progress_off(int sig EXT2FS_ATTR((unused))) { e2fsck_t ctx = e2fsck_global_ctx; @@ -459,7 +459,7 @@ static void signal_progress_off(int sig) ctx->progress = 0; } -static void signal_cancel(int sig) +static void signal_cancel(int sig EXT2FS_ATTR((unused))) { e2fsck_t ctx = e2fsck_global_ctx; diff --git a/e2fsck/util.c b/e2fsck/util.c index 8bb538d1..569fc581 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -70,7 +70,8 @@ void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned int size, return ret; } -char *string_copy(e2fsck_t ctx, const char *str, int len) +char *string_copy(e2fsck_t ctx EXT2FS_ATTR((unused)), + const char *str, int len) { char *ret; |