From b28db1d4e69c0a1011375f308198fde8e2f67d13 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 23 Nov 2019 19:15:52 -0500 Subject: UICommon: Make use of fmt where applicable Continues the migration to using fmt. Notably, this allows safely converting a map within USBUtils over to containing string view instances, rather than std::string instances, as fmt safely handles the formatting of string views. --- Source/Core/UICommon/Disassembler.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Source/Core/UICommon/Disassembler.cpp') diff --git a/Source/Core/UICommon/Disassembler.cpp b/Source/Core/UICommon/Disassembler.cpp index 56898d90e4..5829a3d547 100644 --- a/Source/Core/UICommon/Disassembler.cpp +++ b/Source/Core/UICommon/Disassembler.cpp @@ -1,21 +1,24 @@ +// Copyright 2008 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include "UICommon/Disassembler.h" + +#include + #if defined(HAVE_LLVM) // PowerPC.h defines PC. // This conflicts with a function that has an argument named PC #undef PC +#include #include #include #elif defined(_M_X86) #include // Bochs #endif -#include "Common/StringUtil.h" - -#include "Core/PowerPC/JitCommon/JitBase.h" -#include "Core/PowerPC/JitCommon/JitCache.h" #include "Core/PowerPC/JitInterface.h" -#include "UICommon/Disassembler.h" - #if defined(HAVE_LLVM) class HostDisassemblerLLVM : public HostDisassembler { @@ -85,7 +88,7 @@ std::string HostDisassemblerLLVM::DisassembleHostBlock(const u8* code_start, con // We can continue onward past this bad instruction. std::string inst_str; for (int i = 0; i < m_instruction_size; ++i) - inst_str += StringFromFormat("%02x", disasmPtr[i]); + inst_str += fmt::format("{:02x}", disasmPtr[i]); x86_disasm << inst_str << std::endl; disasmPtr += m_instruction_size; @@ -96,7 +99,7 @@ std::string HostDisassemblerLLVM::DisassembleHostBlock(const u8* code_start, con // Dump the rest of the block instead std::string code_block; for (int i = 0; (disasmPtr + i) < end; ++i) - code_block += StringFromFormat("%02x", disasmPtr[i]); + code_block += fmt::format("{:02x}", disasmPtr[i]); x86_disasm << code_block << std::endl; break; -- cgit v1.2.3