diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-09-14 01:43:59 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-09-14 01:44:02 -0400 |
| commit | da64da367b207a969fb00a8cbbc167a03bd57b4b (patch) | |
| tree | 428058541eb60bed18d388accdb7d122ee8d0fc2 /src/core/hle/service/sm/sm.cpp | |
| parent | 8e7497d5bb17b7e322d191cd103479972bcdb39b (diff) | |
services/sm: Amend error code constants
Courtesy of @ogniK5377.
This also moves them into the cpp file and limits the visibility to
where they're directly used. It also gets rid of unused or duplicate
error codes.
Diffstat (limited to 'src/core/hle/service/sm/sm.cpp')
| -rw-r--r-- | src/core/hle/service/sm/sm.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 18d1641b8..096f0fd52 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -15,6 +15,10 @@ namespace Service::SM { +constexpr ResultCode ERR_ALREADY_REGISTERED(ErrorModule::SM, 4); +constexpr ResultCode ERR_INVALID_NAME(ErrorModule::SM, 6); +constexpr ResultCode ERR_SERVICE_NOT_REGISTERED(ErrorModule::SM, 7); + ServiceManager::ServiceManager() = default; ServiceManager::~ServiceManager() = default; @@ -24,10 +28,10 @@ void ServiceManager::InvokeControlRequest(Kernel::HLERequestContext& context) { static ResultCode ValidateServiceName(const std::string& name) { if (name.size() <= 0 || name.size() > 8) { - return ERR_INVALID_NAME_SIZE; + return ERR_INVALID_NAME; } if (name.find('\0') != std::string::npos) { - return ERR_NAME_CONTAINS_NUL; + return ERR_INVALID_NAME; } return RESULT_SUCCESS; } |
