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/eupld/eupld.cpp | 10 +++++----- src/core/hle/service/eupld/eupld.h | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/eupld') diff --git a/src/core/hle/service/eupld/eupld.cpp b/src/core/hle/service/eupld/eupld.cpp index 0d6d244f4..2d650b1b7 100644 --- a/src/core/hle/service/eupld/eupld.cpp +++ b/src/core/hle/service/eupld/eupld.cpp @@ -12,7 +12,7 @@ namespace Service::EUPLD { class ErrorUploadContext final : public ServiceFramework { public: - explicit ErrorUploadContext() : ServiceFramework{"eupld:c"} { + explicit ErrorUploadContext(Core::System& system_) : ServiceFramework{system_, "eupld:c"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "SetUrl"}, @@ -29,7 +29,7 @@ public: class ErrorUploadRequest final : public ServiceFramework { public: - explicit ErrorUploadRequest() : ServiceFramework{"eupld:r"} { + explicit ErrorUploadRequest(Core::System& system_) : ServiceFramework{system_, "eupld:r"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "Initialize"}, @@ -45,9 +45,9 @@ public: } }; -void InstallInterfaces(SM::ServiceManager& sm) { - std::make_shared()->InstallAsService(sm); - std::make_shared()->InstallAsService(sm); +void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { + std::make_shared(system)->InstallAsService(sm); + std::make_shared(system)->InstallAsService(sm); } } // namespace Service::EUPLD diff --git a/src/core/hle/service/eupld/eupld.h b/src/core/hle/service/eupld/eupld.h index 6eef2c15f..539993a9d 100644 --- a/src/core/hle/service/eupld/eupld.h +++ b/src/core/hle/service/eupld/eupld.h @@ -4,6 +4,10 @@ #pragma once +namespace Core { +class System; +} + namespace Service::SM { class ServiceManager; } @@ -11,6 +15,6 @@ class ServiceManager; namespace Service::EUPLD { /// Registers all EUPLD services with the specified service manager. -void InstallInterfaces(SM::ServiceManager& sm); +void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); } // namespace Service::EUPLD -- cgit v1.2.3