From bd6c469543ce679a30724be9a2b9db1c1258c8f5 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Mon, 16 Sep 2024 02:48:52 +0300 Subject: [PATCH] Code-review fixes --- Core/MIPS/IR/IRInst.cpp | 2 +- Core/MIPS/MIPSTracer.cpp | 4 ++-- Core/MIPS/MIPSTracer.h | 8 ++++---- UI/GameSettingsScreen.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Core/MIPS/IR/IRInst.cpp b/Core/MIPS/IR/IRInst.cpp index ff235546d3..13eb16a52f 100644 --- a/Core/MIPS/IR/IRInst.cpp +++ b/Core/MIPS/IR/IRInst.cpp @@ -190,7 +190,7 @@ static const IRMeta irMeta[] = { { IROp::ApplyRoundingMode, "ApplyRoundingMode", "" }, { IROp::UpdateRoundingMode, "UpdateRoundingMode", "" }, - {IROp::LogIRBlock, "LogIRBlock", ""} + { IROp::LogIRBlock, "LogIRBlock", "" }, }; const IRMeta *metaIndex[256]; diff --git a/Core/MIPS/MIPSTracer.cpp b/Core/MIPS/MIPSTracer.cpp index a533a6d8e9..20289a5d92 100644 --- a/Core/MIPS/MIPSTracer.cpp +++ b/Core/MIPS/MIPSTracer.cpp @@ -57,7 +57,7 @@ void TraceBlockStorage::clear() { INFO_LOG(Log::JIT, "TraceBlockStorage cleared"); } -void MIPSTracer::prepare_block(MIPSComp::IRBlock* block, MIPSComp::IRBlockCache& blocks) { +void MIPSTracer::prepare_block(const MIPSComp::IRBlock* block, MIPSComp::IRBlockCache& blocks) { u32 virt_addr, size; block->GetRange(&virt_addr, &size); @@ -120,7 +120,7 @@ bool MIPSTracer::flush_to_file() { return true; } -void MIPSTracer::flush_block_to_file(TraceBlockInfo& block_info) { +void MIPSTracer::flush_block_to_file(const TraceBlockInfo& block_info) { char buffer[512]; // The log format is '{prefix}{disassembled line}', where 'prefix' is '0x{8 hex digits of the address}: ' diff --git a/Core/MIPS/MIPSTracer.h b/Core/MIPS/MIPSTracer.h index 8bb6d75cab..a3a7ee584e 100644 --- a/Core/MIPS/MIPSTracer.h +++ b/Core/MIPS/MIPSTracer.h @@ -144,16 +144,16 @@ struct MIPSTracer { void start_tracing(); void stop_tracing(); - void prepare_block(MIPSComp::IRBlock* block, MIPSComp::IRBlockCache& blocks); - void setLoggingPath(std::string path) { + void prepare_block(const MIPSComp::IRBlock* block, MIPSComp::IRBlockCache& blocks); + void set_logging_path(std::string path) { logging_path = Path(path); } - std::string getLoggingPath() const { + std::string get_logging_path() const { return logging_path.ToString(); } bool flush_to_file(); - void flush_block_to_file(TraceBlockInfo& block); + void flush_block_to_file(const TraceBlockInfo& block); void initialize(u32 storage_capacity, u32 max_trace_size); void clear(); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 197b12e910..2545438e71 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1909,7 +1909,7 @@ void DeveloperToolsScreen::CreateViews() { return true; }); - MIPSTracerPath_ = mipsTracer.getLoggingPath(); + MIPSTracerPath_ = mipsTracer.get_logging_path(); MIPSTracerPath = list->Add(new InfoItem(dev->T("Current log file"), MIPSTracerPath_)); PopupSliderChoice* storage_capacity = list->Add( @@ -2151,7 +2151,7 @@ UI::EventReturn DeveloperToolsScreen::OnMIPSTracerPathChanged(UI::EventParams &e auto dev = GetI18NCategory(I18NCat::DEVELOPER); System_BrowseForFile(GetRequesterToken(), dev->T("Select the log file"), BrowseFileType::ANY, [this](const std::string &value, int) { - mipsTracer.setLoggingPath(value); + mipsTracer.set_logging_path(value); MIPSTracerPath_ = value; MIPSTracerPath->SetRightText(MIPSTracerPath_); });