From 7f6ac632f14966a7bc20924284d8c87adbc6295b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 19 Oct 2019 06:28:21 -0400 Subject: [PATCH 1/2] test: Directly use specifier for size_t --- atdna/test.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/atdna/test.cpp b/atdna/test.cpp index f23c929..ede95de 100644 --- a/atdna/test.cpp +++ b/atdna/test.cpp @@ -1,5 +1,7 @@ #include "test.hpp" -#include "athena/MemoryWriter.hpp" + +#include +#include #define EXPECTED_BYTES 281 @@ -13,11 +15,14 @@ int main(int argc, const char** argv) { athena::io::MemoryCopyWriter w(nullptr, binSize); atInt64 pos = w.position(); file.write(w); - bool pass = !w.hasError() && w.position() - pos == binSize && binSize == EXPECTED_BYTES; - if (pass) - printf("[PASS] %" PRISize " bytes written\n", size_t(w.position() - pos)); - else - printf("[FAIL] %" PRISize " bytes written; %" PRISize " bytes sized; %d bytes expected\n", - size_t(w.position() - pos), binSize, EXPECTED_BYTES); + + const bool pass = !w.hasError() && w.position() - pos == binSize && binSize == EXPECTED_BYTES; + if (pass) { + fmt::print(fmt("[PASS] {} bytes written\n"), size_t(w.position() - pos)); + } else { + fmt::print(fmt("[FAIL] {} bytes written; {} bytes sized; {} bytes expected\n"), size_t(w.position() - pos), binSize, + EXPECTED_BYTES); + } + return pass ? 0 : 1; } From 93dacd42312783718660658279f76ba173bc6931 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 19 Oct 2019 06:39:44 -0400 Subject: [PATCH 2/2] Global: Remove compatibility formatting define for size_t Given the use of fmt, we can trivially remove the remaining usages of this define and remove it from the Global header. --- include/athena/Global.hpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/athena/Global.hpp b/include/athena/Global.hpp index ef7c72e..a746755 100644 --- a/include/athena/Global.hpp +++ b/include/athena/Global.hpp @@ -30,14 +30,8 @@ #if !defined(S_ISLNK) #define S_ISLNK(m) 0 #endif +#endif // _MSC_VER -#define PRISize "Iu" - -#else - -#define PRISize "zu" - -#endif // clang-format off #ifndef AT_PRETTY_FUNCTION # if defined(__PRETTY_FUNCTION__) || defined(__GNUC__)