core: Replace all instances of ResultCode with Result

This commit is contained in:
german77 2022-06-25 22:44:19 -05:00
parent abfd690601
commit a7d9be1384
140 changed files with 1133 additions and 1173 deletions

View file

@ -74,7 +74,7 @@ void ProgressServiceBackend::CommitDirectory(std::string_view dir_name) {
SignalUpdate();
}
void ProgressServiceBackend::FinishDownload(ResultCode result) {
void ProgressServiceBackend::FinishDownload(Result result) {
impl.total_downloaded_bytes = impl.total_bytes;
impl.status = DeliveryCacheProgressImpl::Status::Done;
impl.result = result;

View file

@ -49,7 +49,7 @@ struct DeliveryCacheProgressImpl {
};
Status status;
ResultCode result = ResultSuccess;
Result result = ResultSuccess;
DirectoryName current_directory;
FileName current_file;
s64 current_downloaded_bytes; ///< Bytes downloaded on current file.
@ -90,7 +90,7 @@ public:
void CommitDirectory(std::string_view dir_name);
// Notifies the application that the operation completed with result code result.
void FinishDownload(ResultCode result);
void FinishDownload(Result result);
private:
explicit ProgressServiceBackend(Core::System& system, std::string_view event_name);

View file

@ -18,15 +18,15 @@
namespace Service::BCAT {
constexpr ResultCode ERROR_INVALID_ARGUMENT{ErrorModule::BCAT, 1};
constexpr ResultCode ERROR_FAILED_OPEN_ENTITY{ErrorModule::BCAT, 2};
constexpr ResultCode ERROR_ENTITY_ALREADY_OPEN{ErrorModule::BCAT, 6};
constexpr ResultCode ERROR_NO_OPEN_ENTITY{ErrorModule::BCAT, 7};
constexpr Result ERROR_INVALID_ARGUMENT{ErrorModule::BCAT, 1};
constexpr Result ERROR_FAILED_OPEN_ENTITY{ErrorModule::BCAT, 2};
constexpr Result ERROR_ENTITY_ALREADY_OPEN{ErrorModule::BCAT, 6};
constexpr Result ERROR_NO_OPEN_ENTITY{ErrorModule::BCAT, 7};
// The command to clear the delivery cache just calls fs IFileSystem DeleteFile on all of the files
// and if any of them have a non-zero result it just forwards that result. This is the FS error code
// for permission denied, which is the closest approximation of this scenario.
constexpr ResultCode ERROR_FAILED_CLEAR_CACHE{ErrorModule::FS, 6400};
constexpr Result ERROR_FAILED_CLEAR_CACHE{ErrorModule::FS, 6400};
using BCATDigest = std::array<u8, 0x10>;