summaryrefslogtreecommitdiff
path: root/src/core/hle/service/friend
diff options
context:
space:
mode:
authorGravatar Lioncash2020-11-26 15:19:08 -0500
committerGravatar Lioncash2020-11-26 20:03:11 -0500
commit1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f (patch)
tree3593cd42e0ba676c3919561983f7e9766fcb641c /src/core/hle/service/friend
parentMerge pull request #4975 from comex/invalid-syncpoint-id (diff)
downloadyuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.gz
yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.xz
yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.zip
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.
Diffstat (limited to 'src/core/hle/service/friend')
-rw-r--r--src/core/hle/service/friend/friend.cpp13
-rw-r--r--src/core/hle/service/friend/friend.h4
-rw-r--r--src/core/hle/service/friend/interface.cpp4
-rw-r--r--src/core/hle/service/friend/interface.h2
4 files changed, 12 insertions, 11 deletions
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index ebb323da2..40a289594 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -17,7 +17,7 @@ namespace Service::Friend {
17 17
18class IFriendService final : public ServiceFramework<IFriendService> { 18class IFriendService final : public ServiceFramework<IFriendService> {
19public: 19public:
20 IFriendService() : ServiceFramework("IFriendService") { 20 explicit IFriendService(Core::System& system_) : ServiceFramework{system_, "IFriendService"} {
21 // clang-format off 21 // clang-format off
22 static const FunctionInfo functions[] = { 22 static const FunctionInfo functions[] = {
23 {0, nullptr, "GetCompletionEvent"}, 23 {0, nullptr, "GetCompletionEvent"},
@@ -171,8 +171,8 @@ private:
171 171
172class INotificationService final : public ServiceFramework<INotificationService> { 172class INotificationService final : public ServiceFramework<INotificationService> {
173public: 173public:
174 INotificationService(Common::UUID uuid, Core::System& system) 174 explicit INotificationService(Common::UUID uuid_, Core::System& system_)
175 : ServiceFramework("INotificationService"), uuid(uuid) { 175 : ServiceFramework{system_, "INotificationService"}, uuid{uuid_} {
176 // clang-format off 176 // clang-format off
177 static const FunctionInfo functions[] = { 177 static const FunctionInfo functions[] = {
178 {0, &INotificationService::GetEvent, "GetEvent"}, 178 {0, &INotificationService::GetEvent, "GetEvent"},
@@ -267,7 +267,7 @@ private:
267void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) { 267void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
268 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 268 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
269 rb.Push(RESULT_SUCCESS); 269 rb.Push(RESULT_SUCCESS);
270 rb.PushIpcInterface<IFriendService>(); 270 rb.PushIpcInterface<IFriendService>(system);
271 LOG_DEBUG(Service_ACC, "called"); 271 LOG_DEBUG(Service_ACC, "called");
272} 272}
273 273
@@ -282,8 +282,9 @@ void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx
282 rb.PushIpcInterface<INotificationService>(uuid, system); 282 rb.PushIpcInterface<INotificationService>(uuid, system);
283} 283}
284 284
285Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name) 285Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_,
286 : ServiceFramework(name), module(std::move(module)), system(system) {} 286 const char* name)
287 : ServiceFramework{system_, name}, module{std::move(module_)} {}
287 288
288Module::Interface::~Interface() = default; 289Module::Interface::~Interface() = default;
289 290
diff --git a/src/core/hle/service/friend/friend.h b/src/core/hle/service/friend/friend.h
index 24f3fc969..8be3321db 100644
--- a/src/core/hle/service/friend/friend.h
+++ b/src/core/hle/service/friend/friend.h
@@ -16,7 +16,8 @@ class Module final {
16public: 16public:
17 class Interface : public ServiceFramework<Interface> { 17 class Interface : public ServiceFramework<Interface> {
18 public: 18 public:
19 explicit Interface(std::shared_ptr<Module> module, Core::System& system, const char* name); 19 explicit Interface(std::shared_ptr<Module> module_, Core::System& system_,
20 const char* name);
20 ~Interface() override; 21 ~Interface() override;
21 22
22 void CreateFriendService(Kernel::HLERequestContext& ctx); 23 void CreateFriendService(Kernel::HLERequestContext& ctx);
@@ -24,7 +25,6 @@ public:
24 25
25 protected: 26 protected:
26 std::shared_ptr<Module> module; 27 std::shared_ptr<Module> module;
27 Core::System& system;
28 }; 28 };
29}; 29};
30 30
diff --git a/src/core/hle/service/friend/interface.cpp b/src/core/hle/service/friend/interface.cpp
index 58155f652..7368ccec2 100644
--- a/src/core/hle/service/friend/interface.cpp
+++ b/src/core/hle/service/friend/interface.cpp
@@ -6,8 +6,8 @@
6 6
7namespace Service::Friend { 7namespace Service::Friend {
8 8
9Friend::Friend(std::shared_ptr<Module> module, Core::System& system, const char* name) 9Friend::Friend(std::shared_ptr<Module> module_, Core::System& system_, const char* name)
10 : Interface(std::move(module), system, name) { 10 : Interface(std::move(module_), system_, name) {
11 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
12 {0, &Friend::CreateFriendService, "CreateFriendService"}, 12 {0, &Friend::CreateFriendService, "CreateFriendService"},
13 {1, &Friend::CreateNotificationService, "CreateNotificationService"}, 13 {1, &Friend::CreateNotificationService, "CreateNotificationService"},
diff --git a/src/core/hle/service/friend/interface.h b/src/core/hle/service/friend/interface.h
index 465a35770..43d914b32 100644
--- a/src/core/hle/service/friend/interface.h
+++ b/src/core/hle/service/friend/interface.h
@@ -10,7 +10,7 @@ namespace Service::Friend {
10 10
11class Friend final : public Module::Interface { 11class Friend final : public Module::Interface {
12public: 12public:
13 explicit Friend(std::shared_ptr<Module> module, Core::System& system, const char* name); 13 explicit Friend(std::shared_ptr<Module> module_, Core::System& system_, const char* name);
14 ~Friend() override; 14 ~Friend() override;
15}; 15};
16 16