summaryrefslogtreecommitdiff
path: root/misc/tune2fs.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-02-11 10:55:21 -0500
committerTheodore Ts'o <tytso@mit.edu>2021-02-11 10:55:21 -0500
commit33b9a60c366da5df92d9c1b003aedaf1d0e2008a (patch)
treeaade9700c6078483cb10e400114ceb889c29f666 /misc/tune2fs.c
parentfb874e6ff42bee3ee327afc2651483b83311b445 (diff)
downloade2fsprogs-33b9a60c366da5df92d9c1b003aedaf1d0e2008a.tar.gz
Fix clang warnings on architectures with a 64-bit long
On most systems where we compile e2fsprogs, the u64 type is an unsigned long long. However, there are platforms (such as the PowerPC) where a long 64-bits and so u64 is typedef'ed to be unsigned long instead of a unsigned long long. Fix this by using explicit casts in printf statements. For scanf calls, we need to receive the value into a unsigned long long, and then assign it to a u64, after doing range checks. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'misc/tune2fs.c')
-rw-r--r--misc/tune2fs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 40f51738..11715ba4 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -3142,20 +3142,21 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
ext2fs_blocks_count(sb) / 100.0);
ext2fs_mark_super_dirty(fs);
printf (_("Setting reserved blocks percentage to %g%% (%llu blocks)\n"),
- reserved_ratio, ext2fs_r_blocks_count(sb));
+ reserved_ratio,
+ (unsigned long long) ext2fs_r_blocks_count(sb));
}
if (r_flag) {
if (reserved_blocks > ext2fs_blocks_count(sb)/2) {
com_err(program_name, 0,
_("reserved blocks count is too big (%llu)"),
- reserved_blocks);
+ (unsigned long long) reserved_blocks);
rc = 1;
goto closefs;
}
ext2fs_r_blocks_count_set(sb, reserved_blocks);
ext2fs_mark_super_dirty(fs);
printf(_("Setting reserved blocks count to %llu\n"),
- reserved_blocks);
+ (unsigned long long) reserved_blocks);
}
if (s_flag == 1) {
if (ext2fs_has_feature_sparse_super(sb)) {