Whamcloud - gitweb
Fix gcc -Wall warnings.
authorTheodore Ts'o <tytso@mit.edu>
Sat, 19 Apr 2003 17:48:27 +0000 (13:48 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 19 Apr 2003 17:48:27 +0000 (13:48 -0400)
12 files changed:
e2fsck/ChangeLog
e2fsck/e2fsck.h
e2fsck/pass2.c
e2fsck/rehash.c
e2fsck/unix.c
lib/blkid/ChangeLog
lib/blkid/blkidP.h
lib/e2p/ChangeLog
lib/e2p/fgetflags.c
lib/e2p/fsetflags.c
lib/e2p/hashstr.c
lib/e2p/iod.c

index 7169343..923ca95 100644 (file)
@@ -1,3 +1,12 @@
+2003-04-19  Theodore Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@mit.edu>
 
        * rehash.c (name_cmp): Sort the deleted inodes to the end of the
index 67d4b95..344d859 100644 (file)
@@ -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);
index 4dd9c10..516e058 100644 (file)
@@ -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)
index 81d4976..c6b0b02 100644 (file)
@@ -45,6 +45,8 @@
  * require that e2fsck use VM first.
  */
 
+#include <string.h>
+#include <ctype.h>
 #include <errno.h>
 #include "e2fsck.h"
 #include "problem.h"
index f2d762b..c0c9274 100644 (file)
@@ -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;
index 9e408a2..f23dc94 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-19  Theodore Ts'o  <tytso@mit.edu>
+
+       * blkidP.h: Fix gcc -Wall warnings by using __inline__ instead of
+               inline. 
+
 2003-04-02  Theodore Ts'o  <tytso@mit.edu>
 
        * probe.c, probe.h: Fix XFS superblock definition.  Add support to
index a121106..1ab29c5 100644 (file)
@@ -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;
 
index 3886e6f..f187887 100644 (file)
@@ -1,3 +1,12 @@
+2003-04-19  Theodore Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@mit.edu>
 
        * iod.c (iterate_on_dir): Support systems that don't have d_reclen
index f2d0399..9459f06 100644 (file)
@@ -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);
index f12af1c..183f782 100644 (file)
@@ -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);
index c889bd9..b257eb2 100644 (file)
@@ -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)
index 42e69d9..255bfdf 100644 (file)
@@ -18,6 +18,7 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#include <stdlib.h>
 
 int iterate_on_dir (const char * dir_name,
                    int (*func) (const char *, struct dirent *, void *),