]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
misc: fix all the compiler warnings
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 2 Mar 2017 04:52:12 +0000 (20:52 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 3 Mar 2017 15:02:14 +0000 (10:02 -0500)
Fix the various compiler warnings that have crept in, and only define
__bitwise if the system headers haven't already done so.  Linux 4.10
changes the __bitwise definition so that our redefinition here is
just different enough that gcc complains.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c
debugfs/xattrs.c
e2fsck/pass2.c
lib/ext2fs/ext2_types.h.in
lib/ext2fs/ext_attr.c
lib/support/cstring.c
misc/dumpe2fs.c

index 1a84cfc3ed16bb2ab523aea31b6ff73242d7cec4..059ddc39dc7364989da3e9339598342b0562a1bf 100644 (file)
@@ -1605,9 +1605,7 @@ void do_unlink(int argc, char *argv[])
 void do_copy_inode(int argc, char *argv[])
 {
        ext2_ino_t      src_ino, dest_ino;
-       struct ext2_inode inode;
        unsigned char   buf[4096];
-       int             retval;
 
        if (common_args_process(argc, argv, 3, 3, "copy_inode",
                                "<source file> <dest_name>", CHECK_FS_RW))
index 2443518d62124e052964f8346391fab8a79a6001..9b87d14551dca89498c9415415692f8bdeae2757 100644 (file)
@@ -146,7 +146,7 @@ void do_get_xattr(int argc, char **argv)
        size_t buflen;
        int i;
        int print_flags = 0;
-       int handle_flags = 0;
+       unsigned int handle_flags = 0;
        errcode_t err;
 
        reset_getopt();
@@ -241,8 +241,7 @@ void do_set_xattr(int argc, char **argv)
        FILE *fp = NULL;
        char *buf = NULL;
        size_t buflen;
-       int print_flags = 0;
-       int handle_flags = 0;
+       unsigned int handle_flags = 0;
        int i;
        errcode_t err;
 
index 11c19e8c5c79935a3867ed9653d30ef885798abe..170878c1bf1429861529ead34c327939cde6ce78 100644 (file)
@@ -90,7 +90,7 @@ void e2fsck_pass2(e2fsck_t ctx)
        struct ext2_super_block *sb = ctx->fs->super;
        struct problem_context  pctx;
        ext2_filsys             fs = ctx->fs;
-       char                    *buf;
+       char                    *buf = NULL;
 #ifdef RESOURCE_TRACK
        struct resource_track   rtrack;
 #endif
index 07adc64a188c4e097011b1fdda4cef39132df716..fb36a5dddf98dece4c6ab7e6faa65d3f8666b624 100644 (file)
@@ -173,10 +173,14 @@ typedef long              __s64;
 #define EXT2_ENDIAN_H_
 
 #ifdef __CHECKER__
-#define __bitwise              __attribute__((bitwise))
+# ifndef __bitwise
+#  define __bitwise            __attribute__((bitwise))
+# endif
 #define __force                        __attribute__((force))
 #else
-#define __bitwise
+# ifndef __bitwise
+#  define __bitwise
+# endif
 #define __force
 #endif
 
index ce2f48feffcc864c28f5f9acbe3245508159139e..7a9a2d5a39bceb9548177934df9c7d1de06cf67b 100644 (file)
@@ -478,7 +478,6 @@ static errcode_t convert_posix_acl_to_disk_buffer(const void *value, size_t size
        ext4_acl_header *ext_acl;
        size_t s;
        void *e;
-       int err;
 
        int count;
 
@@ -532,7 +531,6 @@ static errcode_t convert_disk_buffer_to_posix_acl(const void *value, size_t size
        errcode_t err;
        const char *cp;
        char *out;
-       int count;
 
        if ((!value) ||
            (size < sizeof(ext4_acl_header)) ||
index 7965e9571c6ecc9386b58167432ec20745996d5e..57f4522f525788a61ba256cd214a7ebd217cf8ee 100644 (file)
 
 int parse_c_string(char *str)
 {
-       unsigned char *to, *from, ch;
+       char *to, *from, ch;
        int v;
 
        to = from = str;
 
-       for (to = from = (unsigned char *) str;
+       for (to = from = (char *) str;
             *from && *from != '"'; to++, from++) {
                if (*from == '\\') {
                        ch = *(++from);
@@ -93,7 +93,7 @@ int parse_c_string(char *str)
                *to = *from;
        }
        *to = '\0';
-       return to - (unsigned char *) str;
+       return to - (char *) str;
 }
 
 void print_c_string(FILE *f, const char *cp, int len)
index 621840ae1ba6856bfdd2359b1ac3940937d8a973..395ea9ee03a0093987aa6cc2c3ecc5f7ee84586a 100644 (file)
@@ -356,16 +356,6 @@ static void list_bad_blocks(ext2_filsys fs, int dump)
        ext2fs_badblocks_list_free(bb_list);
 }
 
-static const char *journal_checksum_type_str(__u8 type)
-{
-       switch (type) {
-       case JBD2_CRC32C_CHKSUM:
-               return "crc32c";
-       default:
-               return "unknown";
-       }
-}
-
 static void print_inline_journal_information(ext2_filsys fs)
 {
        journal_superblock_t    *jsb;
@@ -374,8 +364,6 @@ static void print_inline_journal_information(ext2_filsys fs)
        errcode_t               retval;
        ino_t                   ino = fs->super->s_journal_inum;
        char                    buf[1024];
-       __u32                   *mask_ptr, mask, m;
-       int                     i, j, size, printed = 0;
 
        if (fs->flags & EXT2_FLAG_IMAGE_FILE)
                return;
@@ -411,10 +399,7 @@ static void print_journal_information(ext2_filsys fs)
 {
        errcode_t       retval;
        char            buf[1024];
-       char            str[80];
-       unsigned int    i, j, printed = 0;
        journal_superblock_t    *jsb;
-       __u32                   *mask_ptr, mask, m;
 
        /* Get the journal superblock */
        if ((retval = io_channel_read_blk64(fs->io,