Manual merge.

2004/03/09 14:38:50+00:00 cantab.net!aia21
Fix all occurences of printf with %ll length modifiers but 64 bit
arguments to typecast the arguments to (unsigned) long long to avoid
the warnings when compiling on 64 bit architectures.

(Logical change 1.306)
edge.strict_endians
cantab.net!aia21 2004-03-09 14:47:34 +00:00
parent ddeee65b8d
commit 8b9213603f
2 changed files with 49 additions and 39 deletions

View File

@ -327,27 +327,27 @@ int info (ntfs_volume *vol)
t = mc >> cb;
u = mc * 100 / b / e;
printf ("bytes per sector : %lld\n", a);
printf ("bytes per cluster : %lld\n", b);
printf ("sectors per cluster : %lld\n", c);
printf ("bytes per volume : %lld\n", d);
printf ("sectors per volume : %lld\n", e);
printf ("clusters per volume : %lld\n", f);
printf ("mft records total : %lld\n", g);
printf ("mft records in use : %lld\n", h);
printf ("mft records percentage : %lld\n", i);
printf ("bytes of free space : %lld\n", j);
printf ("sectors of free space : %lld\n", k);
printf ("clusters of free space : %lld\n", l);
printf ("percentage free space : %lld\n", m);
printf ("bytes of user data : %lld\n", n);
printf ("sectors of user data : %lld\n", o);
printf ("clusters of user data : %lld\n", p);
printf ("percentage user data : %lld\n", q);
printf ("bytes of metadata : %lld\n", r);
printf ("sectors of metadata : %lld\n", s);
printf ("clusters of metadata : %lld\n", t);
printf ("percentage metadata : %lld\n", u);
printf ("bytes per sector : %llu\n", (unsigned long long)a);
printf ("bytes per cluster : %llu\n", (unsigned long long)b);
printf ("sectors per cluster : %llu\n", (unsigned long long)c);
printf ("bytes per volume : %llu\n", (unsigned long long)d);
printf ("sectors per volume : %llu\n", (unsigned long long)e);
printf ("clusters per volume : %llu\n", (unsigned long long)f);
printf ("mft records total : %llu\n", (unsigned long long)g);
printf ("mft records in use : %llu\n", (unsigned long long)h);
printf ("mft records percentage : %llu\n", (unsigned long long)i);
printf ("bytes of free space : %llu\n", (unsigned long long)j);
printf ("sectors of free space : %llu\n", (unsigned long long)k);
printf ("clusters of free space : %llu\n", (unsigned long long)l);
printf ("percentage free space : %llu\n", (unsigned long long)m);
printf ("bytes of user data : %llu\n", (unsigned long long)n);
printf ("sectors of user data : %llu\n", (unsigned long long)o);
printf ("clusters of user data : %llu\n", (unsigned long long)p);
printf ("percentage user data : %llu\n", (unsigned long long)q);
printf ("bytes of metadata : %llu\n", (unsigned long long)r);
printf ("sectors of metadata : %llu\n", (unsigned long long)s);
printf ("clusters of metadata : %llu\n", (unsigned long long)t);
printf ("percentage metadata : %llu\n", (unsigned long long)u);
return 0;
}
@ -463,9 +463,10 @@ int main (int argc, char *argv[])
switch (opts.action) {
case act_sector:
if (opts.range_begin == opts.range_end)
Qprintf ("Searching for sector %lld\n", opts.range_begin);
Qprintf ("Searching for sector %llu\n",
(unsigned long long)opts.range_begin);
else
Qprintf ("Searching for sector range %lld-%lld\n", opts.range_begin, opts.range_end);
Qprintf ("Searching for sector range %llu-%llu\n", (unsigned long long)opts.range_begin, (unsigned long long)opts.range_end);
/* Convert to clusters */
opts.range_begin >>= (vol->cluster_size_bits - vol->sector_size_bits);
opts.range_end >>= (vol->cluster_size_bits - vol->sector_size_bits);
@ -473,9 +474,10 @@ int main (int argc, char *argv[])
break;
case act_cluster:
if (opts.range_begin == opts.range_end)
Qprintf ("Searching for cluster %lld\n", opts.range_begin);
Qprintf ("Searching for cluster %llu\n",
(unsigned long long)opts.range_begin);
else
Qprintf ("Searching for cluster range %lld-%lld\n", opts.range_begin, opts.range_end);
Qprintf ("Searching for cluster range %llu-%llu\n", (unsigned long long)opts.range_begin, (unsigned long long)opts.range_end);
result = cluster_find (vol, opts.range_begin, opts.range_end, (cluster_cb*)&print_match, NULL);
break;
case act_file:

View File

@ -693,7 +693,9 @@ static void collect_shrink_info(ntfs_resize_t *resize, runlist *rl)
return;
printf("Relocation needed for inode %8lld attr 0x%x LCN 0x%08llx "
"length %6lld\n", inode, resize->ctx->attr->type, start, len);
"length %6lld\n", (long long)inode,
resize->ctx->attr->type, (unsigned long long)start,
(long long)len);
}
/**
@ -741,9 +743,11 @@ static void build_lcn_usage_bitmap(ntfs_resize_t *resize)
if (++resize->multi_ref > 10)
continue;
printf("Cluster %llu (0x%llx) referenced "
"multiply times!\n", k, k);
"multiply times!\n",
(unsigned long long)k,
(unsigned long long)k);
}
}
@ -834,9 +838,11 @@ static void compare_bitmaps(struct bitmap *a)
if (++mismatch > 10)
continue;
printf("Cluster accounting failed at %llu "
"(0x%llx): %s cluster in $Bitmap\n",
cl, cl, bit ? "missing" : "extra");
printf("Cluster accounting failed at %lld "
"(0x%llx): %s cluster in "
"$Bitmap\n", (long long)cl,
(unsigned long long)cl,
bit ? "missing" : "extra");
}
}
}
@ -1463,7 +1469,8 @@ static void print_hint(const char *s, struct llcn_t llcn)
runs_b = llcn.lcn * vol->cluster_size;
runs_mb = rounded_up_division(runs_b, NTFS_MBYTE);
printf("%-19s: %9lld MB %8lld\n", s, runs_mb, llcn.inode);
printf("%-19s: %9lld MB %8lld\n", s, (long long)runs_mb,
(long long)llcn.inode);
}
/**
@ -1660,8 +1667,8 @@ static void truncate_bitmap_data_attr(ntfs_resize_t *resize)
if (bm_bsize != size) {
if (size == -1)
perr_exit("Couldn't write $Bitmap");
err_exit("Couldn't write full $Bitmap file "
"(%lld from %lld)\n", size, bm_bsize);
err_exit("Couldn't write full $Bitmap file (%lld from %lld)\n",
(long long)size, (long long)bm_bsize);
}
free(rl);
@ -1810,8 +1817,8 @@ static s64 vol_size(ntfs_volume *v, s64 nr_clusters)
*/
static void print_vol_size(const char *str, s64 bytes)
{
printf("%s: %lld bytes (%lld MB)\n",
str, bytes, rounded_up_division(bytes, NTFS_MBYTE));
printf("%s: %lld bytes (%lld MB)\n", str, (long long)bytes,
(long long)rounded_up_division(bytes, NTFS_MBYTE));
}
/**
@ -1827,7 +1834,7 @@ static void print_disk_usage(ntfs_resize_t *resize)
used = resize->inuse * vol->cluster_size;
printf("Space in use : %lld MB (%.1f%%)\n",
rounded_up_division(used, NTFS_MBYTE),
(long long)rounded_up_division(used, NTFS_MBYTE),
100.0 * ((float)used / total));
}
@ -1835,8 +1842,9 @@ static void print_num_of_relocations(ntfs_resize_t *resize)
{
s64 relocations = resize->relocations * vol->cluster_size;
printf("Needed relocations : %lld (%lld MB)\n", resize->relocations,
rounded_up_division(relocations, NTFS_MBYTE));
printf("Needed relocations : %lld (%lld MB)\n",
(long long)resize->relocations, (long long)
rounded_up_division(relocations, NTFS_MBYTE));
}
/**