From a4963321362f8379a0cfa19d13805f8f88fd2d9a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 6 Jan 2024 14:37:57 +0100 Subject: [PATCH] use proper printf format specifiers for size_t and ptrdiff_t. --- source/common/engine/stringtable.cpp | 2 +- source/common/filesystem/source/filesystem.cpp | 2 +- source/core/searchpaths.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/common/engine/stringtable.cpp b/source/common/engine/stringtable.cpp index 6bfbe12804..5fd020ed04 100644 --- a/source/common/engine/stringtable.cpp +++ b/source/common/engine/stringtable.cpp @@ -321,7 +321,7 @@ void FStringTable::LoadLanguage (int lumpnum, const char* buffer, size_t size) } else { - sc.ScriptError ("The language code must be 2 or 3 characters long.\n'%s' is %lu characters long.", + sc.ScriptError ("The language code must be 2 or 3 characters long.\n'%s' is %zu characters long.", sc.String, len); } } diff --git a/source/common/filesystem/source/filesystem.cpp b/source/common/filesystem/source/filesystem.cpp index a310efb406..f011c4c57d 100644 --- a/source/common/filesystem/source/filesystem.cpp +++ b/source/common/filesystem/source/filesystem.cpp @@ -1273,7 +1273,7 @@ void FileSystem::ReadFile (int lump, void *dest) if (numread != size) { - throw FileSystemException("W_ReadFile: only read %ld of %ld on '%s'\n", + throw FileSystemException("W_ReadFile: only read %td of %td on '%s'\n", numread, size, FileInfo[lump].LongName); } } diff --git a/source/core/searchpaths.cpp b/source/core/searchpaths.cpp index a46e9c626b..0e063d26f9 100644 --- a/source/core/searchpaths.cpp +++ b/source/core/searchpaths.cpp @@ -377,7 +377,7 @@ void SaveCRCs(TArray& crclist) { for (auto& crc : crclist) { - FStringf line("\"%s\" %llu %llu %u\n", crc.FileName.GetChars(), (long long)crc.FileLength, (long long)crc.FileTime, crc.CRCValue); + FStringf line("\"%s\" %zu %zu %u\n", crc.FileName.GetChars(), crc.FileLength, crc.FileTime, crc.CRCValue); fw->Write(line.GetChars(), line.Len()); } delete fw;