From f954ba012fbff61730890115308e78de6720ad5f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 22 May 2007 20:53:01 -0400 Subject: [PATCH] Fix gcc -Wall issues in e2fsck sources Signed-off-by: "Theodore Ts'o" Signed-off-by: Andreas Dilger --- e2fsck/ChangeLog | 14 ++++++++++++++ e2fsck/dirinfo.c | 17 +++++++++-------- e2fsck/pass1.c | 12 +++++++----- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 02dcd8a..505be1b 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,5 +1,19 @@ 2007-05-22 Theodore Tso + * pass1.c (e2fsck_pass1_check_device_inode): Mark the fs parameter + as unused. + (e2fsck_setup_tdb_icount): Use profile_get_uint() function + for reading the threshold. Remove unused variables. + + * dirinfo.c (setup_tdb): Use the profile_get_uint() function for + reading the threshold. + (setup_db): Declare it as static + (setup_tdb): #include uuid.h since we use a uuid function + (e2fsck_get_dir_info, e2fsck_dir_info_iter_begin): Remove + unused variables + (e2fsck_dir_info_iter_end): Mark the ctx parameter as + unused. + * profile.h, profile.c (profile_get_uint): New function which returns an unsigned integer. diff --git a/e2fsck/dirinfo.c b/e2fsck/dirinfo.c index 487a086..aaa4d09 100644 --- a/e2fsck/dirinfo.c +++ b/e2fsck/dirinfo.c @@ -10,6 +10,7 @@ #include "e2fsck.h" #include #include +#include "uuid/uuid.h" #include @@ -38,14 +39,15 @@ static void e2fsck_put_dir_info(e2fsck_t ctx, struct dir_info *dir); static void setup_tdb(e2fsck_t ctx, ext2_ino_t num_dirs) { struct dir_info_db *db = ctx->dir_info; + unsigned int threshold; errcode_t retval; char *tdb_dir, uuid[40]; - int fd, threshold, enable; + int fd, enable; profile_get_string(ctx->profile, "scratch_files", "directory", 0, 0, &tdb_dir); - profile_get_integer(ctx->profile, "scratch_files", - "numdirs_threshold", 0, 0, &threshold); + profile_get_uint(ctx->profile, "scratch_files", + "numdirs_threshold", 0, 0, &threshold); profile_get_boolean(ctx->profile, "scratch_files", "dirinfo", 0, 1, &enable); @@ -65,7 +67,7 @@ static void setup_tdb(e2fsck_t ctx, ext2_ino_t num_dirs) close(fd); } -void setup_db(e2fsck_t ctx) +static void setup_db(e2fsck_t ctx) { struct dir_info_db *db; ext2_ino_t num_dirs; @@ -173,8 +175,8 @@ void e2fsck_add_dir_info(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent) static struct dir_info *e2fsck_get_dir_info(e2fsck_t ctx, ext2_ino_t ino) { struct dir_info_db *db = ctx->dir_info; - int low, high, mid, ret; - struct dir_info_ent *buf; + int low, high, mid; + struct dir_info_ent *buf; static struct dir_info ret_dir_info; if (!db) @@ -310,7 +312,6 @@ extern struct dir_info_iter *e2fsck_dir_info_iter_begin(e2fsck_t ctx) { struct dir_info_iter *iter; struct dir_info_db *db = ctx->dir_info; - int ret; iter = e2fsck_allocate_memory(ctx, sizeof(struct dir_info_iter), "dir_info iterator"); @@ -322,7 +323,7 @@ extern struct dir_info_iter *e2fsck_dir_info_iter_begin(e2fsck_t ctx) return iter; } -extern void e2fsck_dir_info_iter_end(e2fsck_t ctx, +extern void e2fsck_dir_info_iter_end(e2fsck_t ctx EXT2FS_ATTR((unused)), struct dir_info_iter *iter) { if (iter->tdb_iter.dptr) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 830974f..8f5a314 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -128,7 +128,8 @@ static void unwind_pass1(ext2_filsys fs EXT2FS_ATTR((unused))) * since they have the same requirement; the i_block fields should be * zero. */ -int e2fsck_pass1_check_device_inode(ext2_filsys fs, struct ext2_inode *inode) +int e2fsck_pass1_check_device_inode(ext2_filsys fs EXT2FS_ATTR((unused)), + struct ext2_inode *inode) { int i; @@ -434,17 +435,18 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx, extern void e2fsck_setup_tdb_icount(e2fsck_t ctx, int flags, ext2_icount_t *ret) { + unsigned int threshold; ext2_ino_t num_dirs; errcode_t retval; - char *tdb_dir, uuid[40]; - int fd, threshold, enable; + char *tdb_dir; + int enable; *ret = 0; profile_get_string(ctx->profile, "scratch_files", "directory", 0, 0, &tdb_dir); - profile_get_integer(ctx->profile, "scratch_files", - "numdirs_threshold", 0, 0, &threshold); + profile_get_uint(ctx->profile, "scratch_files", + "numdirs_threshold", 0, 0, &threshold); profile_get_boolean(ctx->profile, "scratch_files", "icount", 0, 1, &enable); -- 1.8.3.1