1
0
Fork 0
forked from suyu/suyu

Merge pull request #6517 from lioncash/fmtlib

externals: Update fmt to 8.0.0
This commit is contained in:
bunnei 2021-06-23 15:31:04 -07:00 committed by GitHub
commit 1b09d6628b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 17 deletions

View file

@ -172,7 +172,7 @@ macro(yuzu_find_packages)
set(REQUIRED_LIBS
# Cmake Pkg Prefix Version Conan Pkg
"Catch2 2.13 catch2/2.13.0"
"fmt 7.1 fmt/7.1.2"
"fmt 8.0 fmt/8.0.0"
"lz4 1.8 lz4/1.9.2"
"nlohmann_json 3.8 nlohmann_json/3.8.0"
"ZLIB 1.2 zlib/1.2.11"

2
externals/dynarmic vendored

@ -1 +1 @@
Subproject commit c6125082ea992c245edab26b6f86e7b904b86eec
Subproject commit 7946868af49d403fe54c92d2d60ef986513d1fec

View file

@ -53,8 +53,9 @@ template <typename ContiguousContainer>
std::string out;
out.reserve(std::size(data) * pad_width);
const auto format_str = fmt::runtime(upper ? "{:02X}" : "{:02x}");
for (const u8 c : data) {
out += fmt::format(upper ? "{:02X}" : "{:02x}", c);
out += fmt::format(format_str, c);
}
return out;

View file

@ -835,7 +835,7 @@ void KeyManager::SetKey(S128KeyType id, Key128 key, u64 field1, u64 field2) {
"key_area_key_ocean_{:02X}",
"key_area_key_system_{:02X}",
};
WriteKeyToFile(category, fmt::format(kak_names.at(field2), field1), key);
WriteKeyToFile(category, fmt::format(fmt::runtime(kak_names.at(field2)), field1), key);
} else if (id == S128KeyType::Master) {
WriteKeyToFile(category, fmt::format("master_key_{:02X}", field1), key);
} else if (id == S128KeyType::Package1) {

View file

@ -58,14 +58,17 @@ static bool FollowsNcaIdFormat(std::string_view name) {
static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bool second_hex_upper,
bool within_two_digit, bool cnmt_suffix) {
if (!within_two_digit)
return fmt::format(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca",
Common::HexToString(nca_id, second_hex_upper));
if (!within_two_digit) {
const auto format_str = fmt::runtime(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca");
return fmt::format(format_str, Common::HexToString(nca_id, second_hex_upper));
}
Core::Crypto::SHA256Hash hash{};
mbedtls_sha256_ret(nca_id.data(), nca_id.size(), hash.data(), 0);
return fmt::format(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca", hash[0],
Common::HexToString(nca_id, second_hex_upper));
const auto format_str =
fmt::runtime(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca");
return fmt::format(format_str, hash[0], Common::HexToString(nca_id, second_hex_upper));
}
static std::string GetCNMTName(TitleType type, u64 title_id) {

View file

@ -4,6 +4,7 @@
#pragma once
#include <functional>
#include <memory>
#include <string>
#include <tuple>

View file

@ -149,10 +149,10 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext
std::string function_name = info == nullptr ? fmt::format("{}", ctx.GetCommand()) : info->name;
fmt::memory_buffer buf;
fmt::format_to(buf, "function '{}': port='{}' cmd_buf={{[0]=0x{:X}", function_name,
service_name, cmd_buf[0]);
fmt::format_to(std::back_inserter(buf), "function '{}': port='{}' cmd_buf={{[0]=0x{:X}",
function_name, service_name, cmd_buf[0]);
for (int i = 1; i <= 8; ++i) {
fmt::format_to(buf, ", [{}]=0x{:X}", i, cmd_buf[i]);
fmt::format_to(std::back_inserter(buf), ", [{}]=0x{:X}", i, cmd_buf[i]);
}
buf.push_back('}');

View file

@ -454,7 +454,7 @@ private:
template <typename... Args>
void AddExpression(std::string_view text, Args&&... args) {
shader_source += fmt::format(text, std::forward<Args>(args)...);
shader_source += fmt::format(fmt::runtime(text), std::forward<Args>(args)...);
}
template <typename... Args>

View file

@ -96,7 +96,7 @@ public:
// etc).
template <typename... Args>
void AddLine(std::string_view text, Args&&... args) {
AddExpression(fmt::format(text, std::forward<Args>(args)...));
AddExpression(fmt::format(fmt::runtime(text), std::forward<Args>(args)...));
AddNewLine();
}

View file

@ -14,7 +14,8 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDia
const auto build_id = std::string(Common::g_build_id);
const auto yuzu_build = fmt::format("yuzu Development Build | {}-{}", branch_name, description);
const auto override_build = fmt::format(std::string(Common::g_title_bar_format_idle), build_id);
const auto override_build =
fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id);
const auto yuzu_build_version = override_build.empty() ? yuzu_build : override_build;
ui->setupUi(this);

View file

@ -236,7 +236,8 @@ GMainWindow::GMainWindow()
const auto build_id = std::string(Common::g_build_id);
const auto yuzu_build = fmt::format("yuzu Development Build | {}-{}", branch_name, description);
const auto override_build = fmt::format(std::string(Common::g_title_bar_format_idle), build_id);
const auto override_build =
fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id);
const auto yuzu_build_version = override_build.empty() ? yuzu_build : override_build;
LOG_INFO(Frontend, "yuzu Version: {}", yuzu_build_version);
@ -2858,7 +2859,8 @@ void GMainWindow::UpdateWindowTitle(const std::string& title_name,
const auto build_id = std::string(Common::g_build_id);
const auto yuzu_title = fmt::format("yuzu | {}-{}", branch_name, description);
const auto override_title = fmt::format(std::string(Common::g_title_bar_format_idle), build_id);
const auto override_title =
fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id);
const auto window_title = override_title.empty() ? yuzu_title : override_title;
if (title_name.empty()) {