diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-11-23 19:15:52 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-11-23 19:41:40 -0500 |
| commit | b28db1d4e69c0a1011375f308198fde8e2f67d13 (patch) | |
| tree | 6d33e27b3c20aadcb680badeb11bd45ace872668 /Source/Core/UICommon/Disassembler.cpp | |
| parent | ec895f544cf23616483cea9fdb26a84d6264f844 (diff) | |
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.
Diffstat (limited to 'Source/Core/UICommon/Disassembler.cpp')
| -rw-r--r-- | Source/Core/UICommon/Disassembler.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
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 <sstream> + #if defined(HAVE_LLVM) // PowerPC.h defines PC. // This conflicts with a function that has an argument named PC #undef PC +#include <fmt/format.h> #include <llvm-c/Disassembler.h> #include <llvm-c/Target.h> #elif defined(_M_X86) #include <disasm.h> // 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; |
