From 664bc20ec165223a6210f62b6d7113d4bf6cca64 Mon Sep 17 00:00:00 2001 From: Tony Kuker Date: Tue, 10 Jan 2023 18:34:05 -0600 Subject: [PATCH] try %Iu --- cpp/disk_image/mmap_file_handle.cpp | 4 ++-- cpp/disk_image/posix_file_handle.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/disk_image/mmap_file_handle.cpp b/cpp/disk_image/mmap_file_handle.cpp index 50fd6670..37ea3eb8 100644 --- a/cpp/disk_image/mmap_file_handle.cpp +++ b/cpp/disk_image/mmap_file_handle.cpp @@ -47,9 +47,9 @@ MmapFileHandle::MmapFileHandle(const string &path, int size, uint32_t blocks, of { LOGWARN("Unable to run fstat. Errno:%d", errno) } - printf("Size: %zu\n", sb.st_size); + printf("Size: %Iu\n", sb.st_size); - LOGWARN("%s mmap-ed file of size: %zu", __PRETTY_FUNCTION__, sb.st_size) + LOGWARN("%s mmap-ed file of size: %Iu", __PRETTY_FUNCTION__, sb.st_size) // int x = EACCES; diff --git a/cpp/disk_image/posix_file_handle.cpp b/cpp/disk_image/posix_file_handle.cpp index eb3ad3c6..edc38658 100644 --- a/cpp/disk_image/posix_file_handle.cpp +++ b/cpp/disk_image/posix_file_handle.cpp @@ -38,7 +38,7 @@ PosixFileHandle::PosixFileHandle(const string &path, int size, uint32_t blocks, return; } - LOGWARN("%s opened file of size: %zu", __PRETTY_FUNCTION__, sb.st_size); + LOGWARN("%s opened file of size: %Iu", __PRETTY_FUNCTION__, sb.st_size); initialized = true; } @@ -73,7 +73,7 @@ bool PosixFileHandle::ReadSector(vector& buf, int block) size_t result = read(fd, buf.data(), sector_size_bytes); if (result != sector_size_bytes) { - LOGWARN("%s only read %zu bytes but wanted %zu ", __PRETTY_FUNCTION__, result, sector_size_bytes); + LOGWARN("%s only read %Iu bytes but wanted %Iu ", __PRETTY_FUNCTION__, result, sector_size_bytes); } return true; @@ -101,7 +101,7 @@ bool PosixFileHandle::WriteSector(const vector& buf, int block) size_t result = write(fd, buf.data(), sector_size_bytes); if (result != sector_size_bytes) { - LOGWARN("%s only wrote %zu bytes but wanted %zu ", __PRETTY_FUNCTION__, result, sector_size_bytes) + LOGWARN("%s only wrote %Iu bytes but wanted %Iu ", __PRETTY_FUNCTION__, result, sector_size_bytes) } return true;