Whamcloud - gitweb
Fix compile error and warnings for old gcc versions
[tools/e2fsprogs.git] / debugfs / htree.c
index 83f558c..cf7d78a 100644 (file)
@@ -46,8 +46,7 @@ static void htree_dump_leaf_node(ext2_filsys fs, ext2_ino_t ino,
        int             hash_alg;
        int             csum_size = 0;
 
-       if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
-                                      EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
+       if (ext2fs_has_feature_metadata_csum(fs->super))
                csum_size = sizeof(struct ext2_dir_entry_tail);
 
        errcode = ext2fs_bmap2(fs, ino, inode, buf, 0, blk, 0, &pblk);
@@ -156,8 +155,7 @@ static void htree_dump_int_node(ext2_filsys fs, ext2_ino_t ino,
                remainder -= sizeof(struct ext2_dx_root_info) + 24;
        else
                remainder -= 8;
-       if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
-                                      EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&
+       if (ext2fs_has_feature_metadata_csum(fs->super) &&
            remainder == sizeof(struct ext2_dx_tail)) {
                tail = (struct ext2_dx_tail *)(ent + limit);
                fprintf(pager, "Checksum: 0x%08x\n",
@@ -289,7 +287,8 @@ void do_htree_dump(int argc, char *argv[])
        fprintf(pager, "\t Indirect levels: %d\n", rootnode->indirect_levels);
        fprintf(pager, "\t Flags: %d\n", rootnode->unused_flags);
 
-       ent = (struct ext2_dx_entry *) (buf + 24 + rootnode->info_length);
+       ent = (struct ext2_dx_entry *)
+               ((char *)rootnode + rootnode->info_length);
 
        htree_dump_int_node(current_fs, ino, &inode, rootnode, ent,
                            buf + current_fs->blocksize,
@@ -341,7 +340,7 @@ void do_dx_hash(int argc, char *argv[])
        err = ext2fs_dirhash(hash_version, argv[optind], strlen(argv[optind]),
                             hash_seed, &hash, &minor_hash);
        if (err) {
-               com_err(argv[0], err, "while caclulating hash");
+               com_err(argv[0], err, "while calculating hash");
                return;
        }
        printf("Hash of %s is 0x%0x (minor 0x%0x)\n", argv[optind],