From 208a5fbc7a9c99773b0467e259c8ee1266eac881 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 9 Sep 2021 13:37:18 +0200 Subject: Use runtime_exception() instead of exception() as the latter doesn't have a constructor that takes a message according to the C++20 standard --- zencore/string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zencore/string.cpp') diff --git a/zencore/string.cpp b/zencore/string.cpp index 21ba5b204..3037df0e7 100644 --- a/zencore/string.cpp +++ b/zencore/string.cpp @@ -437,7 +437,7 @@ template [[noreturn]] void StringBuilderImpl::Fail(const char* reason) { - throw std::exception(reason); + throw std::runtime_error(reason); } // Instantiate templates once -- cgit v1.2.3 From 8d346a746d998330f974b022c19b7e7e19834e51 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 9 Sep 2021 13:39:59 +0200 Subject: Replaced use of "%ll?" format specifiers with PRI?64 --- zencore/string.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'zencore/string.cpp') diff --git a/zencore/string.cpp b/zencore/string.cpp index 3037df0e7..764b3de03 100644 --- a/zencore/string.cpp +++ b/zencore/string.cpp @@ -34,14 +34,14 @@ namespace zen { bool ToString(std::span Buffer, uint64_t Num) { - snprintf(Buffer.data(), Buffer.size(), "%I64u", Num); + snprintf(Buffer.data(), Buffer.size(), "%" PRIu64, Num); return true; } bool ToString(std::span Buffer, int64_t Num) { - snprintf(Buffer.data(), Buffer.size(), "%I64d", Num); + snprintf(Buffer.data(), Buffer.size(), "%" PRId64, Num); return true; } @@ -231,12 +231,12 @@ NiceNumGeneral(uint64_t Num, std::span Buffer, NicenumFormat Format) switch (Format) { case kNicenumRaw: - return snprintf(Buffer.data(), Buffer.size(), "%llu", (uint64_t)Num); + return snprintf(Buffer.data(), Buffer.size(), "%" PRIu64, (uint64_t)Num); case kNicenumRawTime: if (Num > 0) { - return snprintf(Buffer.data(), Buffer.size(), "%llu", (uint64_t)Num); + return snprintf(Buffer.data(), Buffer.size(), "%" PRIu64, (uint64_t)Num); } else { @@ -275,7 +275,7 @@ NiceNumGeneral(uint64_t Num, std::span Buffer, NicenumFormat Format) * If this is an even multiple of the base, always display * without any decimal precision. */ - return snprintf(Buffer.data(), Buffer.size(), "%llu%s", (uint64_t)n, u); + return snprintf(Buffer.data(), Buffer.size(), "%" PRIu64 "%s", (uint64_t)n, u); } else { -- cgit v1.2.3 From c1f3797f580cf8bb4837e4f360de55b720804585 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 15 Sep 2021 11:17:44 +0200 Subject: Missing include for pow() --- zencore/string.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'zencore/string.cpp') diff --git a/zencore/string.cpp b/zencore/string.cpp index 764b3de03..542fec487 100644 --- a/zencore/string.cpp +++ b/zencore/string.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3 From ebb3a183238f615927932723671ca3f06169326c Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 15 Sep 2021 11:18:37 +0200 Subject: Missing include for std::runtime_error() --- zencore/string.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'zencore/string.cpp') diff --git a/zencore/string.cpp b/zencore/string.cpp index 542fec487..8ea10d2a3 100644 --- a/zencore/string.cpp +++ b/zencore/string.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include -- cgit v1.2.3