From a7d9be13840acd65d0d684666390758ede72c826 Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 25 Jun 2022 22:44:19 -0500 Subject: core: Replace all instances of ResultCode with Result --- src/core/hle/service/acc/acc.cpp | 14 +++++++------- src/core/hle/service/acc/acc.h | 2 +- src/core/hle/service/acc/async_context.h | 2 +- src/core/hle/service/acc/errors.h | 4 ++-- src/core/hle/service/acc/profile_manager.cpp | 12 ++++++------ src/core/hle/service/acc/profile_manager.h | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/core/hle/service/acc') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 88b74cbb0..b726ac27a 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -28,11 +28,11 @@ namespace Service::Account { -constexpr ResultCode ERR_INVALID_USER_ID{ErrorModule::Account, 20}; -constexpr ResultCode ERR_INVALID_APPLICATION_ID{ErrorModule::Account, 22}; -constexpr ResultCode ERR_INVALID_BUFFER{ErrorModule::Account, 30}; -constexpr ResultCode ERR_INVALID_BUFFER_SIZE{ErrorModule::Account, 31}; -constexpr ResultCode ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100}; +constexpr Result ERR_INVALID_USER_ID{ErrorModule::Account, 20}; +constexpr Result ERR_INVALID_APPLICATION_ID{ErrorModule::Account, 22}; +constexpr Result ERR_INVALID_BUFFER{ErrorModule::Account, 30}; +constexpr Result ERR_INVALID_BUFFER_SIZE{ErrorModule::Account, 31}; +constexpr Result ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100}; // Thumbnails are hard coded to be at least this size constexpr std::size_t THUMBNAIL_SIZE = 0x24000; @@ -505,7 +505,7 @@ protected: void Cancel() override {} - ResultCode GetResult() const override { + Result GetResult() const override { return ResultSuccess; } }; @@ -747,7 +747,7 @@ void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestCo rb.Push(InitializeApplicationInfoBase()); } -ResultCode Module::Interface::InitializeApplicationInfoBase() { +Result Module::Interface::InitializeApplicationInfoBase() { if (application_info) { LOG_ERROR(Service_ACC, "Application already initialized"); return ERR_ACCOUNTINFO_ALREADY_INITIALIZED; diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h index fff447fc3..1621e7c0a 100644 --- a/src/core/hle/service/acc/acc.h +++ b/src/core/hle/service/acc/acc.h @@ -41,7 +41,7 @@ public: void StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx); private: - ResultCode InitializeApplicationInfoBase(); + Result InitializeApplicationInfoBase(); void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::UUID& uuid, const u64 tid); diff --git a/src/core/hle/service/acc/async_context.h b/src/core/hle/service/acc/async_context.h index e4929f7f0..26332d241 100644 --- a/src/core/hle/service/acc/async_context.h +++ b/src/core/hle/service/acc/async_context.h @@ -26,7 +26,7 @@ public: protected: virtual bool IsComplete() const = 0; virtual void Cancel() = 0; - virtual ResultCode GetResult() const = 0; + virtual Result GetResult() const = 0; void MarkComplete(); diff --git a/src/core/hle/service/acc/errors.h b/src/core/hle/service/acc/errors.h index eafb75713..e9c16b951 100644 --- a/src/core/hle/service/acc/errors.h +++ b/src/core/hle/service/acc/errors.h @@ -7,7 +7,7 @@ namespace Service::Account { -constexpr ResultCode ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22}; -constexpr ResultCode ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41}; +constexpr Result ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22}; +constexpr Result ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41}; } // namespace Service::Account diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 0ef298180..8118ead33 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp @@ -33,9 +33,9 @@ struct ProfileDataRaw { static_assert(sizeof(ProfileDataRaw) == 0x650, "ProfileDataRaw has incorrect size."); // TODO(ogniK): Get actual error codes -constexpr ResultCode ERROR_TOO_MANY_USERS(ErrorModule::Account, u32(-1)); -constexpr ResultCode ERROR_USER_ALREADY_EXISTS(ErrorModule::Account, u32(-2)); -constexpr ResultCode ERROR_ARGUMENT_IS_NULL(ErrorModule::Account, 20); +constexpr Result ERROR_TOO_MANY_USERS(ErrorModule::Account, u32(-1)); +constexpr Result ERROR_USER_ALREADY_EXISTS(ErrorModule::Account, u32(-2)); +constexpr Result ERROR_ARGUMENT_IS_NULL(ErrorModule::Account, 20); constexpr char ACC_SAVE_AVATORS_BASE_PATH[] = "system/save/8000000000000010/su/avators"; @@ -87,7 +87,7 @@ bool ProfileManager::RemoveProfileAtIndex(std::size_t index) { } /// Helper function to register a user to the system -ResultCode ProfileManager::AddUser(const ProfileInfo& user) { +Result ProfileManager::AddUser(const ProfileInfo& user) { if (!AddToProfiles(user)) { return ERROR_TOO_MANY_USERS; } @@ -96,7 +96,7 @@ ResultCode ProfileManager::AddUser(const ProfileInfo& user) { /// Create a new user on the system. If the uuid of the user already exists, the user is not /// created. -ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& username) { +Result ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& username) { if (user_count == MAX_USERS) { return ERROR_TOO_MANY_USERS; } @@ -123,7 +123,7 @@ ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& usern /// Creates a new user on the system. This function allows a much simpler method of registration /// specifically by allowing an std::string for the username. This is required specifically since /// we're loading a string straight from the config -ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) { +Result ProfileManager::CreateNewUser(UUID uuid, const std::string& username) { ProfileUsername username_output{}; if (username.size() > username_output.size()) { diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h index 955dbd3d6..9940957f1 100644 --- a/src/core/hle/service/acc/profile_manager.h +++ b/src/core/hle/service/acc/profile_manager.h @@ -64,9 +64,9 @@ public: ProfileManager(); ~ProfileManager(); - ResultCode AddUser(const ProfileInfo& user); - ResultCode CreateNewUser(Common::UUID uuid, const ProfileUsername& username); - ResultCode CreateNewUser(Common::UUID uuid, const std::string& username); + Result AddUser(const ProfileInfo& user); + Result CreateNewUser(Common::UUID uuid, const ProfileUsername& username); + Result CreateNewUser(Common::UUID uuid, const std::string& username); std::optional GetUser(std::size_t index) const; std::optional GetUserIndex(const Common::UUID& uuid) const; std::optional GetUserIndex(const ProfileInfo& user) const; -- cgit v1.2.3