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/am/applet_oe.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/core/hle/service/am/applet_oe.cpp') diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index 7bed86ec4..f9eba8f52 100644 --- a/src/core/hle/service/am/applet_oe.cpp +++ b/src/core/hle/service/am/applet_oe.cpp @@ -12,10 +12,11 @@ namespace Service::AM { class IApplicationProxy final : public ServiceFramework { public: - explicit IApplicationProxy(NVFlinger::NVFlinger& nvflinger, - std::shared_ptr msg_queue, Core::System& system) - : ServiceFramework("IApplicationProxy"), nvflinger(nvflinger), - msg_queue(std::move(msg_queue)), system(system) { + explicit IApplicationProxy(NVFlinger::NVFlinger& nvflinger_, + std::shared_ptr msg_queue_, + Core::System& system_) + : ServiceFramework{system_, "IApplicationProxy"}, nvflinger{nvflinger_}, + msg_queue{std::move(msg_queue_)} { // clang-format off static const FunctionInfo functions[] = { {0, &IApplicationProxy::GetCommonStateGetter, "GetCommonStateGetter"}, @@ -39,7 +40,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(); + rb.PushIpcInterface(system); } void GetDisplayController(Kernel::HLERequestContext& ctx) { @@ -47,7 +48,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(); + rb.PushIpcInterface(system); } void GetDebugFunctions(Kernel::HLERequestContext& ctx) { @@ -55,7 +56,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(); + rb.PushIpcInterface(system); } void GetWindowController(Kernel::HLERequestContext& ctx) { @@ -100,7 +101,6 @@ private: NVFlinger::NVFlinger& nvflinger; std::shared_ptr msg_queue; - Core::System& system; }; void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { @@ -111,10 +111,10 @@ void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { rb.PushIpcInterface(nvflinger, msg_queue, system); } -AppletOE::AppletOE(NVFlinger::NVFlinger& nvflinger, std::shared_ptr msg_queue, - Core::System& system) - : ServiceFramework("appletOE"), nvflinger(nvflinger), msg_queue(std::move(msg_queue)), - system(system) { +AppletOE::AppletOE(NVFlinger::NVFlinger& nvflinger_, std::shared_ptr msg_queue_, + Core::System& system_) + : ServiceFramework{system_, "appletOE"}, nvflinger{nvflinger_}, msg_queue{ + std::move(msg_queue_)} { static const FunctionInfo functions[] = { {0, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"}, }; -- cgit v1.2.3