summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-08 00:31:04 +0100
committerGitHub <noreply@github.com>2018-12-08 00:31:04 +0100
commitb9e80e97b7c04d8ca51b1961095dcd38129319b8 (patch)
treeaf5a185da9fa3088d9916f9d9e5da095d677523c
parentMerge pull request #1882 from FearlessTobi/backport-4418-fix (diff)
parenthle/service: Replace log + UNIMPLEMENTED with UNIMPLEMENTED_MSG (diff)
downloadyuzu-b9e80e97b7c04d8ca51b1961095dcd38129319b8.tar
yuzu-b9e80e97b7c04d8ca51b1961095dcd38129319b8.tar.gz
yuzu-b9e80e97b7c04d8ca51b1961095dcd38129319b8.tar.bz2
yuzu-b9e80e97b7c04d8ca51b1961095dcd38129319b8.tar.lz
yuzu-b9e80e97b7c04d8ca51b1961095dcd38129319b8.tar.xz
yuzu-b9e80e97b7c04d8ca51b1961095dcd38129319b8.tar.zst
yuzu-b9e80e97b7c04d8ca51b1961095dcd38129319b8.zip
-rw-r--r--src/core/hle/service/service.cpp19
-rw-r--r--src/core/hle/service/sm/sm.cpp8
2 files changed, 8 insertions, 19 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 1ec340466..d41df3732 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -70,10 +70,6 @@
#include "core/hle/service/vi/vi.h"
#include "core/hle/service/wlan/wlan.h"
-using Kernel::ClientPort;
-using Kernel::ServerPort;
-using Kernel::SharedPtr;
-
namespace Service {
/**
@@ -110,10 +106,8 @@ void ServiceFrameworkBase::InstallAsNamedPort() {
ASSERT(port == nullptr);
auto& kernel = Core::System::GetInstance().Kernel();
- SharedPtr<ServerPort> server_port;
- SharedPtr<ClientPort> client_port;
- std::tie(server_port, client_port) =
- ServerPort::CreatePortPair(kernel, max_sessions, service_name);
+ auto [server_port, client_port] =
+ Kernel::ServerPort::CreatePortPair(kernel, max_sessions, service_name);
server_port->SetHleHandler(shared_from_this());
kernel.AddNamedPort(service_name, std::move(client_port));
}
@@ -122,11 +116,9 @@ Kernel::SharedPtr<Kernel::ClientPort> ServiceFrameworkBase::CreatePort() {
ASSERT(port == nullptr);
auto& kernel = Core::System::GetInstance().Kernel();
- Kernel::SharedPtr<Kernel::ServerPort> server_port;
- Kernel::SharedPtr<Kernel::ClientPort> client_port;
- std::tie(server_port, client_port) =
+ auto [server_port, client_port] =
Kernel::ServerPort::CreatePortPair(kernel, max_sessions, service_name);
- port = MakeResult<Kernel::SharedPtr<Kernel::ServerPort>>(std::move(server_port)).Unwrap();
+ port = MakeResult(std::move(server_port)).Unwrap();
port->SetHleHandler(shared_from_this());
return client_port;
}
@@ -152,8 +144,7 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext
}
buf.push_back('}');
- LOG_ERROR(Service, "unknown / unimplemented {}", fmt::to_string(buf));
- UNIMPLEMENTED();
+ UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf));
}
void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index 0d0f63a78..d73530086 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -54,13 +54,11 @@ ResultVal<Kernel::SharedPtr<Kernel::ServerPort>> ServiceManager::RegisterService
return ERR_ALREADY_REGISTERED;
auto& kernel = Core::System::GetInstance().Kernel();
- Kernel::SharedPtr<Kernel::ServerPort> server_port;
- Kernel::SharedPtr<Kernel::ClientPort> client_port;
- std::tie(server_port, client_port) =
+ auto [server_port, client_port] =
Kernel::ServerPort::CreatePortPair(kernel, max_sessions, name);
registered_services.emplace(std::move(name), std::move(client_port));
- return MakeResult<Kernel::SharedPtr<Kernel::ServerPort>>(std::move(server_port));
+ return MakeResult(std::move(server_port));
}
ResultCode ServiceManager::UnregisterService(const std::string& name) {
@@ -83,7 +81,7 @@ ResultVal<Kernel::SharedPtr<Kernel::ClientPort>> ServiceManager::GetServicePort(
return ERR_SERVICE_NOT_REGISTERED;
}
- return MakeResult<Kernel::SharedPtr<Kernel::ClientPort>>(it->second);
+ return MakeResult(it->second);
}
ResultVal<Kernel::SharedPtr<Kernel::ClientSession>> ServiceManager::ConnectToService(