diff options
author | Jean-Baptiste Boric <jblbeurope@gmail.com> | 2021-03-17 18:20:11 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-17 23:22:42 +0100 |
commit | 10df91b424cc5eafa63f612182589207df8def17 (patch) | |
tree | 4935eea42f3be76a803c01a381bb1973ab55cb83 /Userland | |
parent | 607fac662da628afdcfafa2393a72bc908db4f20 (diff) | |
download | serenity-10df91b424cc5eafa63f612182589207df8def17.zip |
df: Make 64 bit clean
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/df.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Userland/Utilities/df.cpp b/Userland/Utilities/df.cpp index 2ffab267e0..baf8e050db 100644 --- a/Userland/Utilities/df.cpp +++ b/Userland/Utilities/df.cpp @@ -33,6 +33,7 @@ #include <LibCore/ArgsParser.h> #include <LibCore/File.h> #include <fcntl.h> +#include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -76,11 +77,11 @@ int main(int argc, char** argv) json.for_each([](auto& value) { auto fs_object = value.as_object(); auto fs = fs_object.get("class_name").to_string(); - auto total_block_count = fs_object.get("total_block_count").to_u32(); - auto free_block_count = fs_object.get("free_block_count").to_u32(); - [[maybe_unused]] auto total_inode_count = fs_object.get("total_inode_count").to_u32(); - [[maybe_unused]] auto free_inode_count = fs_object.get("free_inode_count").to_u32(); - auto block_size = fs_object.get("block_size").to_u32(); + auto total_block_count = fs_object.get("total_block_count").to_u64(); + auto free_block_count = fs_object.get("free_block_count").to_u64(); + [[maybe_unused]] auto total_inode_count = fs_object.get("total_inode_count").to_u64(); + [[maybe_unused]] auto free_inode_count = fs_object.get("free_inode_count").to_u64(); + auto block_size = fs_object.get("block_size").to_u64(); auto mount_point = fs_object.get("mount_point").to_string(); printf("%-10s", fs.characters()); @@ -90,9 +91,9 @@ int main(int argc, char** argv) printf("%10s ", human_readable_size((total_block_count - free_block_count) * block_size).characters()); printf("%10s ", human_readable_size(free_block_count * block_size).characters()); } else { - printf("%10u ", total_block_count); - printf("%10u ", total_block_count - free_block_count); - printf("%10u ", free_block_count); + printf("%10" PRIu64 " ", total_block_count); + printf("%10" PRIu64 " ", total_block_count - free_block_count); + printf("%10" PRIu64 " ", free_block_count); } printf("%s", mount_point.characters()); |