From: Theodore Ts'o Date: Sat, 19 Apr 2003 17:48:27 +0000 (-0400) Subject: Fix gcc -Wall warnings. X-Git-Tag: android-x86-6.0-r1~26^2~2483 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=520ead378ec5ddef828a8d206434cc3a444b2e9e;p=android-x86%2Fexternal-e2fsprogs.git Fix gcc -Wall warnings. --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 71693431..923ca950 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,12 @@ +2003-04-19 Theodore Ts'o + + * rehash.c: Fix lint warnings by including string.h and ctype.h + + * pass2.c (dict_de_cmp): Fix lint warnings by using const pointers. + + * unix.c (e2fsck_simple_progress), e2fsck.h: Fix lint warnings by + using const pointers. Remove unused variables. + 2003-04-17 Theodore Ts'o * rehash.c (name_cmp): Sort the deleted inodes to the end of the diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h index 67d4b95c..344d8598 100644 --- a/e2fsck/e2fsck.h +++ b/e2fsck/e2fsck.h @@ -458,5 +458,5 @@ extern int ext2_file_type(unsigned int mode); /* unix.c */ extern void e2fsck_clear_progbar(e2fsck_t ctx); -extern int e2fsck_simple_progress(e2fsck_t ctx, char *label, +extern int e2fsck_simple_progress(e2fsck_t ctx, const char *label, float percent, unsigned int dpynum); diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index 4dd9c103..516e058d 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -308,12 +308,12 @@ static int htree_depth(struct dx_dir_info *dx_dir, static int dict_de_cmp(const void *a, const void *b) { - struct ext2_dir_entry *de_a, *de_b; + const struct ext2_dir_entry *de_a, *de_b; int a_len, b_len; - de_a = (struct ext2_dir_entry *) a; + de_a = (const struct ext2_dir_entry *) a; a_len = de_a->name_len & 0xFF; - de_b = (struct ext2_dir_entry *) b; + de_b = (const struct ext2_dir_entry *) b; b_len = de_b->name_len & 0xFF; if (a_len != b_len) diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index 81d4976c..c6b0b02c 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -45,6 +45,8 @@ * require that e2fsck use VM first. */ +#include +#include #include #include "e2fsck.h" #include "problem.h" diff --git a/e2fsck/unix.c b/e2fsck/unix.c index f2d762bb..c0c92749 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -333,11 +333,10 @@ extern void e2fsck_clear_progbar(e2fsck_t ctx) ctx->flags &= ~E2F_FLAG_PROG_BAR; } -int e2fsck_simple_progress(e2fsck_t ctx, char *label, float percent, +int e2fsck_simple_progress(e2fsck_t ctx, const char *label, float percent, unsigned int dpynum) { static const char spinner[] = "\\|/-"; - char buf[80]; int i; int tick; struct timeval tv; @@ -401,13 +400,8 @@ int e2fsck_simple_progress(e2fsck_t ctx, char *label, float percent, static int e2fsck_update_progress(e2fsck_t ctx, int pass, unsigned long cur, unsigned long max) { - static const char spinner[] = "\\|/-"; char buf[80]; - int i; float percent; - int tick; - struct timeval tv; - static int dpywidth = 0; if (pass == 0) return 0; diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index 9e408a23..f23dc943 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,8 @@ +2003-04-19 Theodore Ts'o + + * blkidP.h: Fix gcc -Wall warnings by using __inline__ instead of + inline. + 2003-04-02 Theodore Ts'o * probe.c, probe.h: Fix XFS superblock definition. Add support to diff --git a/lib/blkid/blkidP.h b/lib/blkid/blkidP.h index a121106c..1ab29c5b 100644 --- a/lib/blkid/blkidP.h +++ b/lib/blkid/blkidP.h @@ -141,7 +141,7 @@ extern int blkid_debug_mask; #endif #ifdef CONFIG_BLKID_DEBUG -static inline void DEB_DUMP_TAG(int mask, blkid_tag tag) +static __inline__ void DEB_DUMP_TAG(int mask, blkid_tag tag) { if (!(mask & blkid_debug_mask)) return; @@ -154,7 +154,7 @@ static inline void DEB_DUMP_TAG(int mask, blkid_tag tag) printf(" tag: %s=\"%s\"\n", tag->bit_name, tag->bit_val); } -static inline void DEB_DUMP_DEV(int mask, blkid_dev dev) +static __inline__ void DEB_DUMP_DEV(int mask, blkid_dev dev) { struct list_head *p; @@ -179,7 +179,7 @@ static inline void DEB_DUMP_DEV(int mask, blkid_dev dev) printf("\n"); } -static inline void DEB_DUMP_CACHE(int mask, blkid_cache cache) +static __inline__ void DEB_DUMP_CACHE(int mask, blkid_cache cache) { struct list_head *p; diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index 3886e6fa..f1878878 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,12 @@ +2003-04-19 Theodore Ts'o + + * fgetflags.c (fgetflags), fsetflags.c (fsetflags): Remove unused + and useless close(fd). + + * hashstr.c (e2p_hash2string): Remove unused variables. + + * iod.c: Fix gcc -Wall warnings by including stdlib.h. + 2003-04-12 Theodore Ts'o * iod.c (iterate_on_dir): Support systems that don't have d_reclen diff --git a/lib/e2p/fgetflags.c b/lib/e2p/fgetflags.c index f2d0399e..9459f062 100644 --- a/lib/e2p/fgetflags.c +++ b/lib/e2p/fgetflags.c @@ -67,7 +67,6 @@ int fgetflags (const char * name, unsigned long * flags) if (!stat(name, &buf) && !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) { - close(fd); goto notsupp; } fd = open (name, OPEN_FLAGS); diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c index f12af1c8..183f7822 100644 --- a/lib/e2p/fsetflags.c +++ b/lib/e2p/fsetflags.c @@ -64,7 +64,6 @@ int fsetflags (const char * name, unsigned long flags) if (!stat(name, &buf) && !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) { - close(fd); goto notsupp; } fd = open (name, OPEN_FLAGS); diff --git a/lib/e2p/hashstr.c b/lib/e2p/hashstr.c index c889bd96..b257eb26 100644 --- a/lib/e2p/hashstr.c +++ b/lib/e2p/hashstr.c @@ -32,8 +32,6 @@ const char *e2p_hash2string(int num) { struct hash *p; static char buf[20]; - char fchar; - int fnum; for (p = hash_list; p->string; p++) { if (num == p->num) diff --git a/lib/e2p/iod.c b/lib/e2p/iod.c index 42e69d9d..255bfdf2 100644 --- a/lib/e2p/iod.c +++ b/lib/e2p/iod.c @@ -18,6 +18,7 @@ #if HAVE_UNISTD_H #include #endif +#include int iterate_on_dir (const char * dir_name, int (*func) (const char *, struct dirent *, void *),