summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2007-08-03 18:56:01 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-08-03 18:56:01 -0400
commitd4e0b1c6f5aa8c6a248d9149ed5634a310952411 (patch)
tree5986d390c9aafb8e310a1e0b93bd7ade8a15003e
parentf1f115a78f5ea599fc5f8815a741d43fedd5840d (diff)
downloade2fsprogs-d4e0b1c6f5aa8c6a248d9149ed5634a310952411.tar.gz
Fix gcc -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--debugfs/debugfs.c24
-rw-r--r--debugfs/debugfs.h1
-rw-r--r--debugfs/set_fields.c1
-rw-r--r--debugfs/util.c2
-rw-r--r--lib/blkid/devname.c12
-rw-r--r--lib/blkid/probe.c9
-rw-r--r--misc/badblocks.c2
-rw-r--r--misc/mke2fs.c4
-rw-r--r--misc/util.c4
-rw-r--r--misc/util.h2
10 files changed, 33 insertions, 28 deletions
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 66354710..190c4b7b 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -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;
diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h
index d72c7aca..003c19ad 100644
--- a/debugfs/debugfs.h
+++ b/debugfs/debugfs.h
@@ -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);
diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c
index b50ff7cc..ce0301f4 100644
--- a/debugfs/set_fields.c
+++ b/debugfs/set_fields.c
@@ -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>
diff --git a/debugfs/util.c b/debugfs/util.c
index a490d2cf..70318500 100644
--- a/debugfs/util.c
+++ b/debugfs/util.c
@@ -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 */
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
index 13500768..79d928e8 100644
--- a/lib/blkid/devname.c
+++ b/lib/blkid/devname.c
@@ -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)
diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c
index 69a43b06..d56292ec 100644
--- a/lib/blkid/probe.c
+++ b/lib/blkid/probe.c
@@ -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;
}
diff --git a/misc/badblocks.c b/misc/badblocks.c
index 88c5a745..29c5a5c7 100644
--- a/misc/badblocks.c
+++ b/misc/badblocks.c
@@ -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);
}
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 0c6d4f30..4a6cace0 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -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);
}
diff --git a/misc/util.c b/misc/util.c
index 7522e9b0..6a4c40cf 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -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);
diff --git a/misc/util.h b/misc/util.h
index 3b6a8816..0df2aacf 100644
--- a/misc/util.h
+++ b/misc/util.h
@@ -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);