diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-05-21 07:05:04 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-06-02 06:39:27 +0200 |
commit | 12c1766997f2596b4b1b1a6a411e4f6d56605ee7 (patch) | |
tree | e718a0f18be8aaf664ebdcd197af513e5a118b72 /src/core/hle/service/filesystem | |
parent | Merge pull request #6395 from lioncash/result-move (diff) | |
download | yuzu-12c1766997f2596b4b1b1a6a411e4f6d56605ee7.tar yuzu-12c1766997f2596b4b1b1a6a411e4f6d56605ee7.tar.gz yuzu-12c1766997f2596b4b1b1a6a411e4f6d56605ee7.tar.bz2 yuzu-12c1766997f2596b4b1b1a6a411e4f6d56605ee7.tar.lz yuzu-12c1766997f2596b4b1b1a6a411e4f6d56605ee7.tar.xz yuzu-12c1766997f2596b4b1b1a6a411e4f6d56605ee7.tar.zst yuzu-12c1766997f2596b4b1b1a6a411e4f6d56605ee7.zip |
Diffstat (limited to 'src/core/hle/service/filesystem')
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 32 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 68 |
2 files changed, 50 insertions, 50 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 78664439d..84d1717ab 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -60,7 +60,7 @@ ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 } const auto entry_type = GetEntryType(path); - if (entry_type.Code() == RESULT_SUCCESS) { + if (entry_type.Code() == ResultSuccess) { return FileSys::ERROR_PATH_ALREADY_EXISTS; } @@ -73,14 +73,14 @@ ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 // TODO(DarkLordZach): Find a better error code for this return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const { std::string path(Common::FS::SanitizePath(path_)); if (path.empty()) { // TODO(DarkLordZach): Why do games call this and what should it do? Works as is but... - return RESULT_SUCCESS; + return ResultSuccess; } auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); @@ -92,7 +92,7 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { @@ -106,7 +106,7 @@ ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) // TODO(DarkLordZach): Find a better error code for this return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) const { @@ -116,7 +116,7 @@ ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) // TODO(DarkLordZach): Find a better error code for this return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::string& path_) const { @@ -126,7 +126,7 @@ ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::str // TODO(DarkLordZach): Find a better error code for this return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::string& path) const { @@ -138,7 +138,7 @@ ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::stri return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, @@ -154,12 +154,12 @@ ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, // TODO(DarkLordZach): Find a better error code for this return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } // Move by hand -- TODO(DarkLordZach): Optimize auto c_res = CreateFile(dest_path, src->GetSize()); - if (c_res != RESULT_SUCCESS) + if (c_res != ResultSuccess) return c_res; auto dest = backing->GetFileRelative(dest_path); @@ -173,7 +173,7 @@ ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_, @@ -189,7 +189,7 @@ ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_pa // TODO(DarkLordZach): Find a better error code for this return RESULT_UNKNOWN; } - return RESULT_SUCCESS; + return ResultSuccess; } // TODO(DarkLordZach): Implement renaming across the tree (move). @@ -258,7 +258,7 @@ FileSystemController::~FileSystemController() = default; ResultCode FileSystemController::RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory) { romfs_factory = std::move(factory); LOG_DEBUG(Service_FS, "Registered RomFS"); - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode FileSystemController::RegisterSaveData( @@ -266,21 +266,21 @@ ResultCode FileSystemController::RegisterSaveData( ASSERT_MSG(save_data_factory == nullptr, "Tried to register a second save data"); save_data_factory = std::move(factory); LOG_DEBUG(Service_FS, "Registered save data"); - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode FileSystemController::RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory) { ASSERT_MSG(sdmc_factory == nullptr, "Tried to register a second SDMC"); sdmc_factory = std::move(factory); LOG_DEBUG(Service_FS, "Registered SDMC"); - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode FileSystemController::RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory) { ASSERT_MSG(bis_factory == nullptr, "Tried to register a second BIS"); bis_factory = std::move(factory); LOG_DEBUG(Service_FS, "Registered BIS"); - return RESULT_SUCCESS; + return ResultSuccess; } void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) { diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 92ea27074..37bcec5a1 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -100,7 +100,7 @@ private: ctx.WriteBuffer(output); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void GetSize(Kernel::HLERequestContext& ctx) { @@ -108,7 +108,7 @@ private: LOG_DEBUG(Service_FS, "called, size={}", size); IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push<u64>(size); } }; @@ -162,7 +162,7 @@ private: ctx.WriteBuffer(output); IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(static_cast<u64>(output.size())); } @@ -206,7 +206,7 @@ private: written); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void Flush(Kernel::HLERequestContext& ctx) { @@ -215,7 +215,7 @@ private: // Exists for SDK compatibiltity -- No need to flush file. IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void SetSize(Kernel::HLERequestContext& ctx) { @@ -226,7 +226,7 @@ private: backend->Resize(size); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void GetSize(Kernel::HLERequestContext& ctx) { @@ -234,7 +234,7 @@ private: LOG_DEBUG(Service_FS, "called, size={}", size); IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push<u64>(size); } }; @@ -290,7 +290,7 @@ private: ctx.WriteBuffer(begin, range_size); IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(actual_entries); } @@ -300,7 +300,7 @@ private: u64 count = entries.size() - next_entry_index; IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(count); } }; @@ -430,7 +430,7 @@ public: auto file = std::make_shared<IFile>(system, result.Unwrap()); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IFile>(std::move(file)); } @@ -455,7 +455,7 @@ public: auto directory = std::make_shared<IDirectory>(system, result.Unwrap()); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IDirectory>(std::move(directory)); } @@ -473,7 +473,7 @@ public: } IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push<u32>(static_cast<u32>(*result)); } @@ -481,14 +481,14 @@ public: LOG_WARNING(Service_FS, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void GetFreeSpaceSize(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_FS, "called"); IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(size.get_free_size()); } @@ -496,7 +496,7 @@ public: LOG_DEBUG(Service_FS, "called"); IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(size.get_total_size()); } @@ -538,7 +538,7 @@ public: ctx.WriteBuffer(begin, range_size); IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push<u32>(static_cast<u32>(actual_entries)); } @@ -796,7 +796,7 @@ void FSP_SRV::SetCurrentProcess(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_FS, "called. current_process_id=0x{:016X}", current_process_id); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) { @@ -818,7 +818,7 @@ void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) { SizeGetter::FromStorageId(fsc, FileSys::StorageId::SdCard)); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); } @@ -835,7 +835,7 @@ void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) { fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, save_struct); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { @@ -879,7 +879,7 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { SizeGetter::FromStorageId(fsc, id)); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); } @@ -894,7 +894,7 @@ void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& LOG_INFO(Service_FS, "called, space={}", space); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<ISaveDataInfoReader>( std::make_shared<ISaveDataInfoReader>(system, space, fsc)); } @@ -903,7 +903,7 @@ void FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute(Kernel::HLEReq LOG_WARNING(Service_FS, "(STUBBED) called."); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( @@ -929,7 +929,7 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( parameters.attribute.index); IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(flags); } @@ -948,7 +948,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap())); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IStorage>(std::move(storage)); } @@ -968,7 +968,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) { if (archive != nullptr) { IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface(std::make_shared<IStorage>(system, archive)); return; } @@ -988,7 +988,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) { system, pm.PatchRomFS(std::move(data.Unwrap()), 0, FileSys::ContentRecordType::Data)); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IStorage>(std::move(storage)); } @@ -1026,7 +1026,7 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) { auto storage = std::make_shared<IStorage>(system, std::move(patched_romfs.Unwrap())); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IStorage>(std::move(storage)); } @@ -1037,14 +1037,14 @@ void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_FS, "called, log_mode={:08X}", log_mode); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_FS, "called"); IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushEnum(log_mode); } @@ -1058,14 +1058,14 @@ void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) { reporter.SaveFilesystemAccessReport(log_mode, std::move(log)); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_FS, "called"); IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushEnum(AccessLogVersion::Latest); rb.Push(access_log_program_index); } @@ -1088,14 +1088,14 @@ private: LOG_WARNING(Service_FS, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void Commit(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_FS, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } }; @@ -1103,7 +1103,7 @@ void FSP_SRV::OpenMultiCommitManager(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_FS, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface<IMultiCommitManager>(std::make_shared<IMultiCommitManager>(system)); } |