Whamcloud - gitweb
debugfs: Fix miscellaneous gcc -Wall warnings
authorTheodore Ts'o <tytso@mit.edu>
Sun, 12 Jul 2009 03:23:16 +0000 (23:23 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 12 Jul 2009 03:23:16 +0000 (23:23 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/debugfs.c
debugfs/debugfs.h
debugfs/htree.c
debugfs/ncheck.c

index 94ffc6f..1710aa2 100644 (file)
@@ -1871,7 +1871,7 @@ static int find_supp_feature(__u32 *supp, int feature_type, char *name)
 
 void do_supported_features(int argc, char *argv[])
 {
-        int    i, j, ret;
+        int    ret;
        __u32   supp[3] = { EXT2_LIB_FEATURE_COMPAT_SUPP,
                            EXT2_LIB_FEATURE_INCOMPAT_SUPP,
                            EXT2_LIB_FEATURE_RO_COMPAT_SUPP };
index 3c0f016..bbfa760 100644 (file)
@@ -124,4 +124,5 @@ extern void do_features(int argc, char **argv);
 extern void do_bmap(int argc, char **argv);
 extern void do_imap(int argc, char **argv);
 extern void do_set_current_time(int argc, char **argv);
+extern void do_supported_features(int argc, char **argv);
 
index 01e4ca5..77dc88b 100644 (file)
@@ -23,6 +23,8 @@ extern char *optarg;
 #endif
 
 #include "debugfs.h"
+#include "uuid/uuid.h"
+#include "e2p/e2p.h"
 
 static FILE *pager;
 
@@ -75,7 +77,7 @@ static void htree_dump_leaf_node(ext2_filsys fs, ext2_ino_t ino,
                if (((offset + rec_len) > fs->blocksize) ||
                    (rec_len < 8) ||
                    ((rec_len % 4) != 0) ||
-                   (((dirent->name_len & 0xFF)+8) > rec_len)) {
+                   ((((unsigned) dirent->name_len & 0xFF)+8) > rec_len)) {
                        fprintf(pager, "Corrupted directory block (%u)!\n", blk);
                        break;
                }
@@ -309,7 +311,7 @@ void do_dx_hash(int argc, char *argv[])
                                hash_version = atoi(optarg);
                        break;
                case 's':
-                       if (uuid_parse(optarg, hash_seed)) {
+                       if (uuid_parse(optarg, (unsigned char *) hash_seed)) {
                                fprintf(stderr, "Invalid UUID format: %s\n",
                                        optarg);
                                return;
@@ -413,7 +415,7 @@ static int search_dir_block(ext2_filsys fs, blk_t *blocknr,
                        com_err("htree_dump_leaf_inode", errcode,
                                "while getting rec_len for block %lu",
                                (unsigned long) *blocknr);
-                       return;
+                       return BLOCK_ABORT;
                }
                if (dirent->inode &&
                    p->len == (dirent->name_len & 0xFF) &&
index 166be6b..a366281 100644 (file)
@@ -34,8 +34,6 @@ static int ncheck_proc(struct ext2_dir_entry *dirent,
 {
        struct inode_walk_struct *iw = (struct inode_walk_struct *) private;
        int     i;
-       char    *pathname;
-       errcode_t       retval;
 
        iw->position++;
        if (iw->position <= 2)