From e77c3cd5729f9ab3486f1abc5f9362b8dc059214 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Skutnik Date: Tue, 2 Apr 2024 18:14:30 +0300 Subject: [PATCH] Upgrade to fmt v10; fix access to c_str in wld --- src/colors.h | 6 +++--- src/worldloader.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/colors.h b/src/colors.h index c74946f..f46c5d2 100644 --- a/src/colors.h +++ b/src/colors.h @@ -8,6 +8,7 @@ #include #include #include +#include using nlohmann::json; using std::list; @@ -220,7 +221,7 @@ void from_json(const json &j, Palette &p); } // namespace Colors -template <> struct fmt::formatter { +template <> struct fmt::formatter : formatter { char presentation = 'c'; constexpr auto parse(format_parse_context &ctx) { auto it = ctx.begin(), end = ctx.end(); @@ -236,8 +237,7 @@ template <> struct fmt::formatter { return it; } - template - auto format(const Colors::Color &c, FormatContext &ctx) { + auto format(const Colors::Color &c, format_context &ctx) const { if (c.ALPHA == 0xff) return format_to(ctx.out(), "#{:02x}{:02x}{:02x}", c.R, c.G, c.B); else diff --git a/src/worldloader.cpp b/src/worldloader.cpp index c96848a..7ce9794 100644 --- a/src/worldloader.cpp +++ b/src/worldloader.cpp @@ -98,7 +98,7 @@ void Data::loadChunk(const ChunkCoordinates coords) { if (!nbt::parse(chunkBuffer, length, data) || !Chunk::assert_chunk(data)) { fclose(regionHandle); logger::trace("Chunk parsing failed for chunk {} {} in {}", coords.x, - coords.z, regionFile.c_str()); + coords.z, regionFile.string()); return; }