]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix gcc -Wall warnings
authorTheodore Ts'o <tytso@mit.edu>
Fri, 3 Aug 2007 22:56:01 +0000 (18:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 3 Aug 2007 22:56:01 +0000 (18:56 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/debugfs.c
debugfs/debugfs.h
debugfs/set_fields.c
debugfs/util.c
lib/blkid/devname.c
lib/blkid/probe.c
misc/badblocks.c
misc/mke2fs.c
misc/util.c
misc/util.h

index 6635471002734ea65857d8151125de1c7448db32..190c4b7b26fef7e94392b49496d8cd2f5052ea70 100644 (file)
@@ -1011,7 +1011,7 @@ static void make_link(char *sourcename, char *destname)
        struct ext2_inode inode;
        int             retval;
        ext2_ino_t      dir;
-       char            *dest, *cp, *basename;
+       char            *dest, *cp, *base_name;
 
        /*
         * Get the source inode
@@ -1019,17 +1019,17 @@ static void make_link(char *sourcename, char *destname)
        ino = string_to_inode(sourcename);
        if (!ino)
                return;
-       basename = strrchr(sourcename, '/');
-       if (basename)
-               basename++;
+       base_name = strrchr(sourcename, '/');
+       if (base_name)
+               base_name++;
        else
-               basename = sourcename;
+               base_name = sourcename;
        /*
         * Figure out the destination.  First see if it exists and is
         * a directory.  
         */
        if (! (retval=ext2fs_namei(current_fs, root, cwd, destname, &dir)))
-               dest = basename;
+               dest = base_name;
        else {
                /*
                 * OK, it doesn't exist.  See if it is
@@ -1123,19 +1123,19 @@ static void unlink_file_by_name(char *filename)
 {
        int             retval;
        ext2_ino_t      dir;
-       char            *basename;
+       char            *base_name;
        
-       basename = strrchr(filename, '/');
-       if (basename) {
-               *basename++ = '\0';
+       base_name = strrchr(filename, '/');
+       if (base_name) {
+               *base_name++ = '\0';
                dir = string_to_inode(filename);
                if (!dir)
                        return;
        } else {
                dir = cwd;
-               basename = filename;
+               base_name = filename;
        }
-       retval = ext2fs_unlink(current_fs, dir, basename, 0, 0);
+       retval = ext2fs_unlink(current_fs, dir, base_name, 0, 0);
        if (retval)
                com_err("unlink_file_by_name", retval, 0);
        return;
index d72c7acae9baab57e5d63a2af38951492fab0d2d..003c19adf150115e96bce9c9cd4bbe395464bb8d 100644 (file)
@@ -78,6 +78,7 @@ extern void do_ncheck(int argc, char **argv);
 /* set_fields.c */
 extern void do_set_super(int argc, char **);
 extern void do_set_inode(int argc, char **);
+extern void do_set_block_group_descriptor(int argc, char **);
 
 /* unused.c */
 extern void do_dump_unused(int argc, char **argv);
index b50ff7cc8ec6452aece16f147688e8cf7e74e3d9..ce0301f4a8ffda197814aed8203064329340aa8e 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
+#include <strings.h>
 #include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
index a490d2cf2ab4b01a8a30b47fa545dbace90c65e3..70318500bc64e5213f07db047d94364bf6fa008e 100644 (file)
@@ -190,7 +190,7 @@ char *time_to_string(__u32 cl)
 {
        static int      do_gmt = -1;
        time_t          t = (time_t) cl;
-       char *          tz;
+       const char      *tz;
 
        if (do_gmt == -1) {
                /* The diet libc doesn't respect the TZ environemnt variable */
index 13500768e25722453fd49c1fd4d20e0733982a78..79d928e8ae2afe8e2a178c7a48edd5529b9b0a23 100644 (file)
@@ -154,8 +154,10 @@ set_pri:
 }
 
 #ifdef HAVE_DEVMAPPER
-static void dm_quiet_log(int level, const char *file, int line,
-                        const char *f, ...)
+static void dm_quiet_log(int level __BLKID_ATTR((unused)), 
+                        const char *file __BLKID_ATTR((unused)), 
+                        int line __BLKID_ATTR((unused)),
+                        const char *f __BLKID_ATTR((unused)), ...)
 {
        return;
 }
@@ -168,7 +170,7 @@ static int dm_device_has_dep(const dev_t dev, const char *name)
        struct dm_task *task;
        struct dm_deps *deps;
        struct dm_info info;
-       int i;
+       unsigned int i;
 
        task = dm_task_create(DM_DEVICE_DEPS);
        if (!task)
@@ -224,7 +226,7 @@ static int dm_device_is_leaf(const dev_t dev)
 
        n = 0;
        do {
-               names = (void *)names + next;
+               names = (struct dm_names *) ((char *)names + next);
 
                if (dm_device_has_dep(dev, names->name))
                        ret = 0;
@@ -289,7 +291,7 @@ static void dm_probe_all(blkid_cache cache, int only_if_new)
                char *device = NULL;
                dev_t dev = 0;
 
-               names = (void *)names + next;
+               names = (struct dm_names *) ((char *)names + next);
 
                rc = asprintf(&device, "mapper/%s", names->name);
                if (rc < 0)
index 69a43b06cb8ef49993c1b1fa1eb72328c12257ff..d56292ec5277e77dd645cdf5b017930e2edab943 100644 (file)
@@ -121,7 +121,7 @@ static int check_mdraid(int fd, unsigned char *ret_uuid)
        return 0;
 }
 
-static void set_uuid(blkid_dev dev, uuid_t uuid, char *tag)
+static void set_uuid(blkid_dev dev, uuid_t uuid, const char *tag)
 {
        char    str[37];
 
@@ -220,7 +220,7 @@ static int probe_jbd(struct blkid_probe *probe,
 #define FAT_ATTR_MASK                  0x3f
 #define FAT_ENTRY_FREE                 0xe5
 
-static char *no_name = "NO NAME    ";
+static const char *no_name = "NO NAME    ";
 
 static unsigned char *search_fat_label(struct vfat_dir_entry *dir, int count)
 {
@@ -582,10 +582,11 @@ static int probe_luks(struct blkid_probe *probe,
                       struct blkid_magic *id __BLKID_ATTR((unused)),
                       unsigned char *buf)
 {
-       unsigned char uuid[40];
+       char uuid[40];
+
        /* 168 is the offset to the 40 character uuid:
         * http://luks.endorphin.org/LUKS-on-disk-format.pdf */
-       strncpy(uuid, buf+168, 40);
+       strncpy(uuid, (char *) buf+168, 40);
        blkid_set_tag(probe->dev, "UUID", uuid, sizeof(uuid));
        return 0;
 }
index 88c5a745d441584dcb3e10642e060dd2197f3c2b..29c5a5c7c17d25afba07192f370de2a01f369e17 100644 (file)
@@ -1012,7 +1012,7 @@ int main (int argc, char ** argv)
                }
        } else from_count = 0;
        if (from_count >= last_block) {
-           com_err (program_name, 0, _("invalid starting block (%d): must be less than %lu"),
+           com_err (program_name, 0, _("invalid starting block (%lu): must be less than %lu"),
                     (unsigned long) from_count, (unsigned long) last_block);
            exit (1);
        }
index 0c6d4f30d72d6dd58ef5f3a5e0efed2e3c20583f..4a6cace0c08137bf00722d631be5344b2eb8d803 100644 (file)
@@ -1526,7 +1526,7 @@ int main (int argc, char *argv[])
        errcode_t       retval = 0;
        ext2_filsys     fs;
        badblocks_list  bb_list = 0;
-       int             journal_blocks;
+       unsigned int    journal_blocks;
        unsigned int    i;
        int             val;
        io_manager      io_ptr;
@@ -1734,7 +1734,7 @@ int main (int argc, char *argv[])
                        goto no_journal;
                }
                if (!quiet) {
-                       printf(_("Creating journal (%d blocks): "),
+                       printf(_("Creating journal (%u blocks): "),
                               journal_blocks);
                        fflush(stdout);
                }
index 7522e9b0db74a1027564f2de57b54c3a7846391c..6a4c40cff6c1c6be6cddb6854af5c930cd681f78 100644 (file)
@@ -249,7 +249,7 @@ void parse_journal_opts(const char *opts)
  * in the filesystem.  For very small filesystems, it is not reasonable to
  * have a journal that fills more than half of the filesystem.
  */
-int figure_journal_size(int size, ext2_filsys fs)
+unsigned int figure_journal_size(int size, ext2_filsys fs)
 {
        int j_blocks;
 
@@ -269,7 +269,7 @@ int figure_journal_size(int size, ext2_filsys fs)
                                j_blocks);
                        exit(1);
                }
-               if (j_blocks > fs->super->s_free_blocks_count / 2) {
+               if ((unsigned) j_blocks > fs->super->s_free_blocks_count / 2) {
                        fputs(_("\nJournal size too big for filesystem.\n"),
                              stderr);
                        exit(1);
index 3b6a881659cc6c93006e15825f15d45d5c34cafe..0df2aacf156abd74fa183e3358d1cd8e1985017b 100644 (file)
@@ -22,5 +22,5 @@ extern void proceed_question(void);
 extern void check_plausibility(const char *device);
 extern void parse_journal_opts(const char *opts);
 extern void check_mount(const char *device, int force, const char *type);
-extern int figure_journal_size(int size, ext2_filsys fs);
+extern unsigned int figure_journal_size(int size, ext2_filsys fs);
 extern void print_check_message(ext2_filsys fs);