]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
misc: quiet signed/unsigned charactr compiler warnings
authorAndreas Dilger <adilger@dilger.ca>
Tue, 29 Jul 2014 23:30:39 +0000 (17:30 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 2 Aug 2014 01:39:27 +0000 (21:39 -0400)
Quiet warnings about signed vs. unsigned character mismatch.
Use __u8 for storing UUIDs instead of char to match the superblock
s_uuid field.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c
misc/tune2fs.c

index dc925de26983b2e376dd18687d00b17ea545da9c..00c2d3818da74f999f1e133733f1b9f9a28c5ce5 100644 (file)
@@ -2153,7 +2153,7 @@ void do_imap(int argc, char *argv[])
 void do_idump(int argc, char *argv[])
 {
        ext2_ino_t      ino;
-       char            *buf;
+       unsigned char   *buf;
        errcode_t       err;
        int             isize;
 
index 639809db55d09e6a39492a5cd6aa8322d86e22b3..b65dab9df8bf3e1694bce2641965a3a0a2e5f0ff 100644 (file)
@@ -207,8 +207,8 @@ static int get_journal_sb(ext2_filsys jfs, char buf[SUPERBLOCK_SIZE])
        return 0;
 }
 
-static void *
-journal_user(char uuid[UUID_SIZE], char s_users[JFS_USERS_SIZE], int nr_users)
+static __u8 *journal_user(__u8 uuid[UUID_SIZE], __u8 s_users[JFS_USERS_SIZE],
+                         int nr_users)
 {
        int i;
        for (i = 0; i < nr_users; i++) {
@@ -285,9 +285,10 @@ static int remove_journal_device(ext2_filsys fs)
        jsb->s_nr_users = htonl(nr_users);
 
        /* Write back the journal superblock */
-       if ((retval = io_channel_write_blk64(jfs->io,
-                               ext2fs_journal_sb_start(fs->blocksize),
-                               -SUPERBLOCK_SIZE, buf))) {
+       retval = io_channel_write_blk64(jfs->io,
+                                       ext2fs_journal_sb_start(fs->blocksize),
+                                       -SUPERBLOCK_SIZE, buf);
+       if (retval) {
                com_err(program_name, retval,
                        "while writing journal superblock.");
                goto no_valid_journal;
@@ -1925,12 +1926,13 @@ static int tune2fs_setup_tdb(const char *name, io_manager *io_ptr)
 }
 
 int
-fs_update_journal_user(struct ext2_super_block *sb, char old_uuid[UUID_SIZE])
+fs_update_journal_user(struct ext2_super_block *sb, __u8 old_uuid[UUID_SIZE])
 {
        int retval, nr_users, start;
        journal_superblock_t *jsb;
        ext2_filsys jfs;
-       char *j_uuid, *journal_path;
+       __u8 *j_uuid;
+       char *journal_path;
        char uuid[UUID_STR_SIZE];
        char buf[SUPERBLOCK_SIZE];
 
@@ -1953,7 +1955,8 @@ fs_update_journal_user(struct ext2_super_block *sb, char old_uuid[UUID_SIZE])
                return retval;
        }
 
-       if ((retval = get_journal_sb(jfs, buf))) {
+       retval = get_journal_sb(jfs, buf);
+       if (retval != 0) {
                if (retval == EXT2_ET_UNSUPP_FEATURE)
                        fprintf(stderr, _("%s is not a journal device.\n"),
                                journal_path);
@@ -1964,7 +1967,8 @@ fs_update_journal_user(struct ext2_super_block *sb, char old_uuid[UUID_SIZE])
        /* Find the filesystem UUID */
        nr_users = ntohl(jsb->s_nr_users);
 
-       if (!(j_uuid = journal_user(old_uuid, jsb->s_users, nr_users))) {
+       j_uuid = journal_user(old_uuid, jsb->s_users, nr_users);
+       if (j_uuid == NULL) {
                fputs(_("Filesystem's UUID not found on journal device.\n"),
                      stderr);
                return EXT2_ET_LOAD_EXT_JOURNAL;
@@ -1974,8 +1978,8 @@ fs_update_journal_user(struct ext2_super_block *sb, char old_uuid[UUID_SIZE])
 
        start = ext2fs_journal_sb_start(jfs->blocksize);
        /* Write back the journal superblock */
-       if ((retval = io_channel_write_blk64(jfs->io, start,
-           -SUPERBLOCK_SIZE, buf))) {
+       retval = io_channel_write_blk64(jfs->io, start, -SUPERBLOCK_SIZE, buf);
+       if (retval != 0) {
                com_err(program_name, retval,
                        "while writing journal superblock.");
                return retval;
@@ -2274,7 +2278,7 @@ retry_open:
                int set_csum = 0;
                dgrp_t i;
                char buf[SUPERBLOCK_SIZE];
-               char old_uuid[UUID_SIZE];
+               __u8 old_uuid[UUID_SIZE];
 
                if (sb->s_feature_ro_compat &
                    EXT4_FEATURE_RO_COMPAT_GDT_CSUM) {