static void print_pathname(FILE *f, ext2_filsys fs, ext2_ino_t dir,
ext2_ino_t ino)
{
- errcode_t retval;
+ errcode_t retval = 0;
char *path;
if (!dir && (ino < num_special_inodes)) {
return 0;
}
if (!(ptr->flags & PR_CONFIG)) {
- char key[9], *new_desc;
+ char key[9], *new_desc = NULL;
sprintf(key, "0x%06x", code);
int main(int argc, char **argv)
{
- region_t r;
+ region_t r = NULL;
int pc = 0, ret;
region_addr_t start, end;
int old_bitmaps;
__u32 features[3];
char *cp;
- int qtype; /* quota type */
+ int qtype = 0; /* quota type */
clear_problem_context(&pctx);
sigcatcher_setup();
const char *profile_name, unsigned int *old_type)
{
unsigned type;
- errcode_t retval;
if (old_type)
*old_type = fs->default_bitmap_type;
struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
- struct hfs_mdb *hfs = (struct hfs_mdb *) buf;
+ struct hfs_mdb *hfs = (struct hfs_mdb *)buf;
+ unsigned long long *uuid_ptr;
char uuid_str[17];
__u64 uuid;
(memcmp(hfs->embed_sig, "HX", 2) == 0))
return 1; /* Not hfs, but an embedded HFS+ */
- uuid = blkid_le64(*((unsigned long long *) hfs->finder_info.id));
+ uuid_ptr = (unsigned long long *)hfs->finder_info.id;
+ uuid = blkid_le64(*uuid_ptr);
if (uuid) {
sprintf(uuid_str, "%016llX", uuid);
blkid_set_tag(probe->dev, "UUID", uuid_str, 0);
unsigned int leaf_node_size;
unsigned int leaf_block;
unsigned int label_len;
- int ext;
+ unsigned long long *uuid_ptr;
__u64 leaf_off, uuid;
char uuid_str[17], label[512];
+ int ext;
/* Check for a HFS+ volume embedded in a HFS volume */
if (memcmp(sbd->signature, "BD", 2) == 0) {
(memcmp(hfsplus->signature, "HX", 2) != 0))
return 1;
- uuid = blkid_le64(*((unsigned long long *) hfsplus->finder_info.id));
+ uuid_ptr = (unsigned long long *)hfsplus->finder_info.id;
+ uuid = blkid_le64(*uuid_ptr);
if (uuid) {
sprintf(uuid_str, "%016llX", uuid);
blkid_set_tag(probe->dev, "UUID", uuid_str, 0);
be = ext2fs_crc32c_be(t->crc, test_buf + t->start, t->length);
if (le != t->crc_le) {
printf("Test %d LE fails, %x != %x\n",
- (t - test), le, t->crc_le);
+ (int)(t - test), le, t->crc_le);
failures++;
}
if (be != t->crc_be) {
printf("Test %d BE fails, %x != %x\n",
- (t - test), be, t->crc_be);
+ (int)(t - test), be, t->crc_be);
failures++;
}
t++;
struct ext2_db_entry2 *list,
ext2_dblist *ret_dblist)
{
- ext2_dblist dblist;
+ ext2_dblist dblist = NULL;
errcode_t retval;
ext2_ino_t num_dirs;
size_t len;
errcode_t ret = 0;
unsigned int l1_index, l2_index;
ext2_off64_t offset;
- blk64_t *l1_table, *l2_table;
+ blk64_t *l1_table, *l2_table = NULL;
void *copy_buf = NULL;
size_t size;
int block_nbytes = EXT2_CLUSTERS_PER_GROUP(fs->super) / 8;
int inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
int csum_flag = 0;
- int do_image = fs->flags & EXT2_FLAG_IMAGE_FILE;
unsigned int cnt;
blk64_t blk;
blk64_t blk_itr = EXT2FS_B2C(fs, fs->super->s_first_data_block);
void setup_cmd(int argc, char **argv)
{
- errcode_t retval;
- int i, c, err;
+ int c, err;
unsigned int blocks = 128;
unsigned int inodes = 0;
unsigned int type = EXT2FS_BMAP64_BITARRAY;
{
unsigned int block, num;
int err;
- int test_result, op_result;
+ int test_result;
if (check_fs_open(argv[0]))
return;
{
unsigned int inode;
int err;
- int test_result, op_result;
+ int test_result;
if (check_fs_open(argv[0]))
return;
blocks = parse_ulong(optarg, argv[0],
"number of blocks", &err);
if (err)
- return;
+ return err;
break;
case 'i':
inodes = parse_ulong(optarg, argv[0],
"number of blocks", &err);
if (err)
- return;
+ return err;
break;
case 'l': /* Legacy bitmaps */
flags = 0;
type = parse_ulong(optarg, argv[0],
"bitmap backend type", &err);
if (err)
- return;
+ return err;
break;
case 'R':
request = optarg;
#define UINT_TO_VOIDPTR(val) ((void *)(intptr_t)(val))
#define VOIDPTR_TO_UINT(ptr) ((unsigned int)(intptr_t)(ptr))
+#if DEBUG_QUOTA
static void print_inode(struct ext2_inode *inode)
{
if (!inode)
return;
}
+#endif
/*
* Returns 0 if not able to find the quota file, otherwise returns its
int retval = 0, i;
dict_t *dict;
ext2_filsys fs;
- struct quota_handle *h;
+ struct quota_handle *h = NULL;
int fmt = QFMT_VFS_V1;
if (!qctx)
int ref_offset EXT2FS_ATTR((unused)),
void *private)
{
- blk64_t block;
blk64_t *num_blocks = private;
*num_blocks += 1;
{
struct ext2_inode inode;
errcode_t err;
- int i;
if ((err = ext2fs_read_inode(fs, ino, &inode)))
return err;
} while (last == 0);
*num_extents = tot_extents;
-out:
+
return 0;
}
{
struct ext2_inode inode;
errcode_t retval;
- char * block_buf;
+ char * block_buf = NULL;
if (!(fs->super->s_feature_compat &
EXT2_FEATURE_COMPAT_RESIZE_INODE))