From 637aa4ddef405266d6bbf98bd32e960d4150e9cb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 18 Nov 2020 02:06:42 -0500 Subject: core: Make use of [[nodiscard]] with the System class Given this is a central class, we should flag cases where the return value of some functions not being used is likely a bug. --- src/core/core.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core/core.cpp') diff --git a/src/core/core.cpp b/src/core/core.cpp index 2427960084..e33ed77cd2 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -632,7 +632,11 @@ const std::string& System::GetStatusDetails() const { return impl->status_details; } -Loader::AppLoader& System::GetAppLoader() const { +Loader::AppLoader& System::GetAppLoader() { + return *impl->app_loader; +} + +const Loader::AppLoader& System::GetAppLoader() const { return *impl->app_loader; } -- cgit v1.2.3 From 82ef99b10746079a17f7ffe46fab8da85558fb8a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 18 Nov 2020 02:09:05 -0500 Subject: core: Remove unused private Init function for the System class This isn't used, so it can be removed. --- src/core/core.cpp | 12 ++++-------- src/core/core.h | 8 -------- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'src/core/core.cpp') diff --git a/src/core/core.cpp b/src/core/core.cpp index e33ed77cd2..8d65a5d912 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -444,6 +444,10 @@ void System::InvalidateCpuInstructionCaches() { impl->kernel.InvalidateAllInstructionCaches(); } +void System::Shutdown() { + impl->Shutdown(); +} + System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath) { return impl->Load(*this, emu_window, filepath); } @@ -752,14 +756,6 @@ const System::CurrentBuildProcessID& System::GetCurrentProcessBuildID() const { return impl->build_id; } -System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { - return impl->Init(*this, emu_window); -} - -void System::Shutdown() { - impl->Shutdown(); -} - Service::SM::ServiceManager& System::ServiceManager() { return *impl->service_manager; } diff --git a/src/core/core.h b/src/core/core.h index e1cc2975dc..cd155625c1 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -388,14 +388,6 @@ public: private: System(); - /** - * Initialize the emulated system. - * @param emu_window Reference to the host-system window used for video output and keyboard - * input. - * @return ResultStatus code, indicating if the operation succeeded. - */ - [[nodiscard]] ResultStatus Init(Frontend::EmuWindow& emu_window); - struct Impl; std::unique_ptr impl; -- cgit v1.2.3