]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
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 71693431bfc992319255926492ffc14eb4c34ca8..923ca950335dbed93c0458a1c6581bd34260b452 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 67d4b95c55e61dbadefc5de095363af8ac3f9006..344d85981a061ff8f08cd8726dd819f0f35de0c8 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 4dd9c10360a356afd3e91bd05763e6a013babdb8..516e058d33fd0257fbe57e7ef366599138618f67 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 81d4976ca38d5ef9baa799e0e81fbef91e929106..c6b0b02c2334a36e7e7344d28c5fae902155010f 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 f2d762bbc7b8f56f37a2d32deac4c5de146f10a2..c0c92749ea6e7a1c4e6d40da978f21a917d910c7 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 9e408a23027ca83793c636a584651d7156995916..f23dc943fe6c4aa5b02038b9219160c10880285a 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 a121106cb25fa6b45cbc7a1a4a497685ceeb51b2..1ab29c5bfd6d12e89a8916fe65a50d89f33ec729 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 3886e6fa530f3e45e3981cb35e2622c246cfda03..f1878878f98a85df11eb06dd3283a545fda6db9d 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 f2d0399eae7e268773738fd14caf06cd7e12eccf..9459f062d4961ec8107d4dffea2ad0624caaea7c 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 f12af1c8650977388b414aacf0b72a61dea94dc2..183f7822b1a47a0bc605ae128512c213b9ab33b9 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 c889bd964e229dd7286a9d3ceae0f45ed19435c7..b257eb26cb922efb3f81a8c2d20f715b796d486e 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 42e69d9d1bd194d2f80a89ef3a11eb4f879459e7..255bfdf24101932ad9cb2d291f3e38f0cee5aa43 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 *),