364 lines
16 KiB
Diff
Executable file
364 lines
16 KiB
Diff
Executable file
From a6e09a7beaff22ac36dcc876b9505c77052993a3 Mon Sep 17 00:00:00 2001
|
|
From: Andrew Udvare <audvare@gmail.com>
|
|
Date: Mon, 2 Dec 2024 18:45:55 -0500
|
|
Subject: [PATCH 4/6] fmt 10 fixes
|
|
|
|
---
|
|
src/common/logging/formatter.h | 2 +-
|
|
src/common/typed_address.h | 6 +++---
|
|
src/core/arm/dynarmic/arm_dynarmic_cp15.cpp | 2 +-
|
|
src/core/arm/dynarmic/dynarmic_cp15.cpp | 2 +-
|
|
src/core/debugger/gdbstub.cpp | 1 +
|
|
src/core/hle/service/nfc/common/device.cpp | 1 +
|
|
src/core/hle/service/psc/time/common.h | 2 +-
|
|
src/shader_recompiler/backend/glasm/reg_alloc.h | 14 +++++++-------
|
|
src/shader_recompiler/frontend/ir/attribute.h | 2 +-
|
|
src/shader_recompiler/frontend/ir/condition.h | 2 +-
|
|
src/shader_recompiler/frontend/ir/flow_test.h | 2 +-
|
|
src/shader_recompiler/frontend/ir/opcodes.h | 2 +-
|
|
src/shader_recompiler/frontend/ir/pred.h | 2 +-
|
|
src/shader_recompiler/frontend/ir/reg.h | 2 +-
|
|
src/shader_recompiler/frontend/ir/type.h | 2 +-
|
|
src/shader_recompiler/frontend/maxwell/location.h | 2 +-
|
|
src/shader_recompiler/frontend/maxwell/opcodes.h | 2 +-
|
|
src/yuzu/main.cpp | 1 +
|
|
src/video_core/renderer_vulkan/renderer_vulkan.cpp | 1 +
|
|
src/video_core/texture_cache/formatter.h | 6 +++---
|
|
20 files changed, 30 insertions(+), 26 deletions(-)
|
|
|
|
diff --git a/src/common/logging/formatter.h b/src/common/logging/formatter.h
|
|
index 27078ee..f9c73d1 100644
|
|
--- a/src/common/logging/formatter.h
|
|
+++ b/src/common/logging/formatter.h
|
|
@@ -14,7 +14,7 @@ template <typename T>
|
|
struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>>
|
|
: formatter<std::underlying_type_t<T>> {
|
|
template <typename FormatContext>
|
|
- auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) {
|
|
+ auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) {
|
|
return fmt::formatter<std::underlying_type_t<T>>::format(
|
|
static_cast<std::underlying_type_t<T>>(value), ctx);
|
|
}
|
|
diff --git a/src/common/typed_address.h b/src/common/typed_address.h
|
|
index e0695c7..7663a2b 100644
|
|
--- a/src/common/typed_address.h
|
|
+++ b/src/common/typed_address.h
|
|
@@ -262,7 +262,7 @@ struct fmt::formatter<Common::PhysicalAddress> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Common::PhysicalAddress& addr, FormatContext& ctx) {
|
|
+ auto format(const Common::PhysicalAddress& addr, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
|
}
|
|
};
|
|
@@ -273,7 +273,7 @@ struct fmt::formatter<Common::ProcessAddress> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Common::ProcessAddress& addr, FormatContext& ctx) {
|
|
+ auto format(const Common::ProcessAddress& addr, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
|
}
|
|
};
|
|
@@ -284,7 +284,7 @@ struct fmt::formatter<Common::VirtualAddress> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Common::VirtualAddress& addr, FormatContext& ctx) {
|
|
+ auto format(const Common::VirtualAddress& addr, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
|
}
|
|
};
|
|
diff --git a/src/core/arm/dynarmic/dynarmic_cp15.cpp b/src/core/arm/dynarmic/dynarmic_cp15.cpp
|
|
index 4c13db8..3886bb7 100644
|
|
--- a/src/core/arm/dynarmic/dynarmic_cp15.cpp
|
|
+++ b/src/core/arm/dynarmic/dynarmic_cp15.cpp
|
|
@@ -22,7 +22,7 @@ struct fmt::formatter<Dynarmic::A32::CoprocReg> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Dynarmic::A32::CoprocReg& reg, FormatContext& ctx) {
|
|
+ auto format(const Dynarmic::A32::CoprocReg& reg, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "cp{}", static_cast<size_t>(reg));
|
|
}
|
|
};
|
|
diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp
|
|
index 6756c17..f052784 100644
|
|
--- a/src/core/debugger/gdbstub.cpp
|
|
+++ b/src/core/debugger/gdbstub.cpp
|
|
@@ -9,6 +9,7 @@
|
|
#include <thread>
|
|
|
|
#include <boost/algorithm/string.hpp>
|
|
+#include <fmt/xchar.h>
|
|
|
|
#include "common/hex_util.h"
|
|
#include "common/logging/log.h"
|
|
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp
|
|
index 321136c..ac88355 100644
|
|
--- a/src/core/hle/service/nfc/common/device.cpp
|
|
+++ b/src/core/hle/service/nfc/common/device.cpp
|
|
@@ -15,6 +15,7 @@
|
|
#endif
|
|
|
|
#include <fmt/format.h>
|
|
+#include <fmt/xchar.h>
|
|
|
|
#include "common/fs/file.h"
|
|
#include "common/fs/fs.h"
|
|
diff --git a/src/core/hle/service/psc/time/common.h b/src/core/hle/service/psc/time/common.h
|
|
index c940638..15599e6 100644
|
|
--- a/src/core/hle/service/psc/time/common.h
|
|
+++ b/src/core/hle/service/psc/time/common.h
|
|
@@ -167,7 +167,7 @@ constexpr inline Result GetSpanBetweenTimePoints(s64* out_seconds, const SteadyC
|
|
template <>
|
|
struct fmt::formatter<Service::PSC::Time::TimeType> : fmt::formatter<fmt::string_view> {
|
|
template <typename FormatContext>
|
|
- auto format(Service::PSC::Time::TimeType type, FormatContext& ctx) {
|
|
+ auto format(Service::PSC::Time::TimeType type, FormatContext& ctx) const {
|
|
const string_view name = [type] {
|
|
using Service::PSC::Time::TimeType;
|
|
switch (type) {
|
|
diff --git a/src/shader_recompiler/backend/glasm/reg_alloc.h b/src/shader_recompiler/backend/glasm/reg_alloc.h
|
|
index 41b8196..f7b6b3b 100644
|
|
--- a/src/shader_recompiler/backend/glasm/reg_alloc.h
|
|
+++ b/src/shader_recompiler/backend/glasm/reg_alloc.h
|
|
@@ -184,7 +184,7 @@ struct fmt::formatter<Shader::Backend::GLASM::Id> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(Shader::Backend::GLASM::Id id, FormatContext& ctx) {
|
|
+ auto format(Shader::Backend::GLASM::Id id, FormatContext& ctx) const {
|
|
return Shader::Backend::GLASM::FormatTo<true>(ctx, id);
|
|
}
|
|
};
|
|
@@ -195,7 +195,7 @@ struct fmt::formatter<Shader::Backend::GLASM::Register> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Backend::GLASM::Register& value, FormatContext& ctx) {
|
|
+ auto format(const Shader::Backend::GLASM::Register& value, FormatContext& ctx) const {
|
|
if (value.type != Shader::Backend::GLASM::Type::Register) {
|
|
throw Shader::InvalidArgument("Register value type is not register");
|
|
}
|
|
@@ -209,7 +209,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarRegister> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Backend::GLASM::ScalarRegister& value, FormatContext& ctx) {
|
|
+ auto format(const Shader::Backend::GLASM::ScalarRegister& value, FormatContext& ctx) const {
|
|
if (value.type != Shader::Backend::GLASM::Type::Register) {
|
|
throw Shader::InvalidArgument("Register value type is not register");
|
|
}
|
|
@@ -223,7 +223,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarU32> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Backend::GLASM::ScalarU32& value, FormatContext& ctx) {
|
|
+ auto format(const Shader::Backend::GLASM::ScalarU32& value, FormatContext& ctx) const {
|
|
switch (value.type) {
|
|
case Shader::Backend::GLASM::Type::Void:
|
|
break;
|
|
@@ -244,7 +244,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarS32> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Backend::GLASM::ScalarS32& value, FormatContext& ctx) {
|
|
+ auto format(const Shader::Backend::GLASM::ScalarS32& value, FormatContext& ctx) const {
|
|
switch (value.type) {
|
|
case Shader::Backend::GLASM::Type::Void:
|
|
break;
|
|
@@ -265,7 +265,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarF32> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Backend::GLASM::ScalarF32& value, FormatContext& ctx) {
|
|
+ auto format(const Shader::Backend::GLASM::ScalarF32& value, FormatContext& ctx) const {
|
|
switch (value.type) {
|
|
case Shader::Backend::GLASM::Type::Void:
|
|
break;
|
|
@@ -286,7 +286,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarF64> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Backend::GLASM::ScalarF64& value, FormatContext& ctx) {
|
|
+ auto format(const Shader::Backend::GLASM::ScalarF64& value, FormatContext& ctx) const {
|
|
switch (value.type) {
|
|
case Shader::Backend::GLASM::Type::Void:
|
|
break;
|
|
diff --git a/src/shader_recompiler/frontend/ir/attribute.h b/src/shader_recompiler/frontend/ir/attribute.h
|
|
index abc7c06..4089767 100644
|
|
--- a/src/shader_recompiler/frontend/ir/attribute.h
|
|
+++ b/src/shader_recompiler/frontend/ir/attribute.h
|
|
@@ -250,7 +250,7 @@ struct fmt::formatter<Shader::IR::Attribute> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::IR::Attribute& attribute, FormatContext& ctx) {
|
|
+ auto format(const Shader::IR::Attribute& attribute, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(attribute));
|
|
}
|
|
};
|
|
diff --git a/src/shader_recompiler/frontend/ir/condition.h b/src/shader_recompiler/frontend/ir/condition.h
|
|
index b07b3ee..f92c965 100644
|
|
--- a/src/shader_recompiler/frontend/ir/condition.h
|
|
+++ b/src/shader_recompiler/frontend/ir/condition.h
|
|
@@ -52,7 +52,7 @@ struct fmt::formatter<Shader::IR::Condition> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::IR::Condition& cond, FormatContext& ctx) {
|
|
+ auto format(const Shader::IR::Condition& cond, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(cond));
|
|
}
|
|
};
|
|
diff --git a/src/shader_recompiler/frontend/ir/flow_test.h b/src/shader_recompiler/frontend/ir/flow_test.h
|
|
index ddfb152..c3f35dc 100644
|
|
--- a/src/shader_recompiler/frontend/ir/flow_test.h
|
|
+++ b/src/shader_recompiler/frontend/ir/flow_test.h
|
|
@@ -55,7 +55,7 @@ struct fmt::formatter<Shader::IR::FlowTest> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::IR::FlowTest& flow_test, FormatContext& ctx) {
|
|
+ auto format(const Shader::IR::FlowTest& flow_test, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(flow_test));
|
|
}
|
|
};
|
|
diff --git a/src/shader_recompiler/frontend/ir/opcodes.h b/src/shader_recompiler/frontend/ir/opcodes.h
|
|
index aad70e2..7d63bf9 100644
|
|
--- a/src/shader_recompiler/frontend/ir/opcodes.h
|
|
+++ b/src/shader_recompiler/frontend/ir/opcodes.h
|
|
@@ -103,7 +103,7 @@ struct fmt::formatter<Shader::IR::Opcode> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::IR::Opcode& op, FormatContext& ctx) {
|
|
+ auto format(const Shader::IR::Opcode& op, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(op));
|
|
}
|
|
};
|
|
diff --git a/src/shader_recompiler/frontend/ir/pred.h b/src/shader_recompiler/frontend/ir/pred.h
|
|
index 51dbf78..dff0cd4 100644
|
|
--- a/src/shader_recompiler/frontend/ir/pred.h
|
|
+++ b/src/shader_recompiler/frontend/ir/pred.h
|
|
@@ -33,7 +33,7 @@ struct fmt::formatter<Shader::IR::Pred> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::IR::Pred& pred, FormatContext& ctx) {
|
|
+ auto format(const Shader::IR::Pred& pred, FormatContext& ctx) const {
|
|
if (pred == Shader::IR::Pred::PT) {
|
|
return fmt::format_to(ctx.out(), "PT");
|
|
} else {
|
|
diff --git a/src/shader_recompiler/frontend/ir/reg.h b/src/shader_recompiler/frontend/ir/reg.h
|
|
index ba96f48..0bba552 100644
|
|
--- a/src/shader_recompiler/frontend/ir/reg.h
|
|
+++ b/src/shader_recompiler/frontend/ir/reg.h
|
|
@@ -319,7 +319,7 @@ struct fmt::formatter<Shader::IR::Reg> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::IR::Reg& reg, FormatContext& ctx) {
|
|
+ auto format(const Shader::IR::Reg& reg, FormatContext& ctx) const {
|
|
if (reg == Shader::IR::Reg::RZ) {
|
|
return fmt::format_to(ctx.out(), "RZ");
|
|
} else if (static_cast<int>(reg) >= 0 && static_cast<int>(reg) < 255) {
|
|
diff --git a/src/shader_recompiler/frontend/ir/type.h b/src/shader_recompiler/frontend/ir/type.h
|
|
index b740680..3b6dc56 100644
|
|
--- a/src/shader_recompiler/frontend/ir/type.h
|
|
+++ b/src/shader_recompiler/frontend/ir/type.h
|
|
@@ -54,7 +54,7 @@ struct fmt::formatter<Shader::IR::Type> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::IR::Type& type, FormatContext& ctx) {
|
|
+ auto format(const Shader::IR::Type& type, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{}", NameOf(type));
|
|
}
|
|
};
|
|
diff --git a/src/shader_recompiler/frontend/maxwell/location.h b/src/shader_recompiler/frontend/maxwell/location.h
|
|
index 95bea0a..81d067d 100644
|
|
--- a/src/shader_recompiler/frontend/maxwell/location.h
|
|
+++ b/src/shader_recompiler/frontend/maxwell/location.h
|
|
@@ -102,7 +102,7 @@ struct fmt::formatter<Shader::Maxwell::Location> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Maxwell::Location& location, FormatContext& ctx) {
|
|
+ auto format(const Shader::Maxwell::Location& location, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{:04x}", location.Offset());
|
|
}
|
|
};
|
|
diff --git a/src/shader_recompiler/frontend/maxwell/opcodes.h b/src/shader_recompiler/frontend/maxwell/opcodes.h
|
|
index 899711d..1fec013 100644
|
|
--- a/src/shader_recompiler/frontend/maxwell/opcodes.h
|
|
+++ b/src/shader_recompiler/frontend/maxwell/opcodes.h
|
|
@@ -23,7 +23,7 @@ struct fmt::formatter<Shader::Maxwell::Opcode> {
|
|
return ctx.begin();
|
|
}
|
|
template <typename FormatContext>
|
|
- auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) {
|
|
+ auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{}", NameOf(opcode));
|
|
}
|
|
};
|
|
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
|
|
index 0d3b10c..7b4ca9f 100644
|
|
--- a/src/yuzu/main.cpp
|
|
+++ b/src/yuzu/main.cpp
|
|
@@ -93,6 +93,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
|
#endif
|
|
|
|
#include <fmt/format.h>
|
|
+#include <fmt/xchar.h>
|
|
#include "common/detached_tasks.h"
|
|
#include "common/fs/fs.h"
|
|
#include "common/fs/path_util.h"
|
|
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
|
|
index 3f9a364..525b46d 100644
|
|
--- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp
|
|
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
|
|
@@ -10,6 +10,7 @@
|
|
#include <vector>
|
|
|
|
#include <fmt/format.h>
|
|
+#include <fmt/xchar.h>
|
|
|
|
#include "common/logging/log.h"
|
|
#include "common/polyfill_ranges.h"
|
|
diff --git a/src/video_core/texture_cache/formatter.h b/src/video_core/texture_cache/formatter.h
|
|
index 42fed09..0b11b4c 100644
|
|
--- a/src/video_core/texture_cache/formatter.h
|
|
+++ b/src/video_core/texture_cache/formatter.h
|
|
@@ -13,7 +13,7 @@
|
|
template <>
|
|
struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::string_view> {
|
|
template <typename FormatContext>
|
|
- auto format(VideoCore::Surface::PixelFormat format, FormatContext& ctx) {
|
|
+ auto format(VideoCore::Surface::PixelFormat format, FormatContext& ctx) const {
|
|
using VideoCore::Surface::PixelFormat;
|
|
const string_view name = [format] {
|
|
switch (format) {
|
|
@@ -234,7 +234,7 @@ struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::str
|
|
template <>
|
|
struct fmt::formatter<VideoCommon::ImageType> : fmt::formatter<fmt::string_view> {
|
|
template <typename FormatContext>
|
|
- auto format(VideoCommon::ImageType type, FormatContext& ctx) {
|
|
+ auto format(VideoCommon::ImageType type, FormatContext& ctx)const {
|
|
const string_view name = [type] {
|
|
using VideoCommon::ImageType;
|
|
switch (type) {
|
|
@@ -262,7 +262,7 @@ struct fmt::formatter<VideoCommon::Extent3D> {
|
|
}
|
|
|
|
template <typename FormatContext>
|
|
- auto format(const VideoCommon::Extent3D& extent, FormatContext& ctx) {
|
|
+ auto format(const VideoCommon::Extent3D& extent, FormatContext& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{{{}, {}, {}}}", extent.width, extent.height,
|
|
extent.depth);
|
|
}
|
|
--
|
|
2.47.1
|
|
|