From 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Nov 2020 15:19:08 -0500 Subject: service: Eliminate usages of the global system instance Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services. --- src/core/hle/service/fgm/fgm.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/core/hle/service/fgm/fgm.cpp') diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp index e461274c1..9dc1bc52e 100644 --- a/src/core/hle/service/fgm/fgm.cpp +++ b/src/core/hle/service/fgm/fgm.cpp @@ -14,7 +14,7 @@ namespace Service::FGM { class IRequest final : public ServiceFramework { public: - explicit IRequest() : ServiceFramework{"IRequest"} { + explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "Initialize"}, @@ -30,7 +30,7 @@ public: class FGM final : public ServiceFramework { public: - explicit FGM(const char* name) : ServiceFramework{name} { + explicit FGM(Core::System& system_, const char* name) : ServiceFramework{system_, name} { // clang-format off static const FunctionInfo functions[] = { {0, &FGM::Initialize, "Initialize"}, @@ -46,13 +46,13 @@ private: IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(); + rb.PushIpcInterface(system); } }; class FGM_DBG final : public ServiceFramework { public: - explicit FGM_DBG() : ServiceFramework{"fgm:dbg"} { + explicit FGM_DBG(Core::System& system_) : ServiceFramework{system_, "fgm:dbg"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "Initialize"}, @@ -65,11 +65,11 @@ public: } }; -void InstallInterfaces(SM::ServiceManager& sm) { - std::make_shared("fgm")->InstallAsService(sm); - std::make_shared("fgm:0")->InstallAsService(sm); - std::make_shared("fgm:9")->InstallAsService(sm); - std::make_shared()->InstallAsService(sm); +void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { + std::make_shared(system, "fgm")->InstallAsService(sm); + std::make_shared(system, "fgm:0")->InstallAsService(sm); + std::make_shared(system, "fgm:9")->InstallAsService(sm); + std::make_shared(system)->InstallAsService(sm); } } // namespace Service::FGM -- cgit v1.2.3