Merge pull request #1574 from antmicro/msieron/fix-format-warnings

liblitedram/utils: fix format warnings
This commit is contained in:
enjoy-digital 2023-01-19 12:42:40 +01:00 committed by GitHub
commit 73b88c6de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -14,18 +14,18 @@
void print_size(uint64_t size) {
if (size < KIB)
printf("%lluB", size);
printf("%" PRIu64 "B", size);
else if (size < MIB)
printf("%llu.%lluKiB", size/KIB, (size/1 - KIB*(size/KIB))/(KIB/10));
printf("%" PRIu64 ".%" PRIu64 "KiB", size/KIB, (size/1 - KIB*(size/KIB))/(KIB/10));
else if (size < GIB)
printf("%llu.%lluMiB", size/MIB, (size/KIB - KIB*(size/MIB))/(KIB/10));
printf("%" PRIu64 ".%" PRIu64 "MiB", size/MIB, (size/KIB - KIB*(size/MIB))/(KIB/10));
else
printf("%llu.%lluGiB", size/GIB, (size/MIB - KIB*(size/GIB))/(KIB/10));
printf("%" PRIu64 ".%" PRIu64 "GiB", size/GIB, (size/MIB - KIB*(size/GIB))/(KIB/10));
}
void print_progress(const char * header, uint64_t origin, uint64_t size)
{
printf("%s 0x%llx-0x%llx ", header, origin, origin + size);
printf("%s 0x%" PRIx64 "-0x%" PRIx64 " ", header, origin, origin + size);
print_size(size);
printf(" \r");
}