mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 22:15:17 -04:00
fs: revise allocation-fail result names
This commit is contained in:
parent
11e4bed199
commit
e13b81aa9e
50 changed files with 304 additions and 218 deletions
|
@ -203,7 +203,7 @@ namespace ams::fs {
|
|||
R_UNLESS(cur != InvalidPosition, fs::ResultDbmKeyNotFound());
|
||||
|
||||
u8 *buf = static_cast<u8 *>(::ams::fs::impl::Allocate(MaxAuxiliarySize));
|
||||
R_UNLESS(buf != nullptr, fs::ResultAllocationFailureInDbmRomKeyValueStorage());
|
||||
R_UNLESS(buf != nullptr, fs::ResultAllocationMemoryFailedInDbmRomKeyValueStorage());
|
||||
ON_SCOPE_EXIT { ::ams::fs::impl::Deallocate(buf, MaxAuxiliarySize); };
|
||||
|
||||
while (true) {
|
||||
|
|
|
@ -434,7 +434,7 @@ namespace ams::fs {
|
|||
/* Allocate a new buffer. */
|
||||
const size_t size = util::AlignUp(len, WriteBufferAlignmentLength);
|
||||
auto buf = fs::impl::MakeUnique<char[]>(size);
|
||||
R_UNLESS(buf != nullptr, fs::ResultAllocationFailureInMakeUnique());
|
||||
R_UNLESS(buf != nullptr, fs::ResultAllocationMemoryFailedMakeUnique());
|
||||
|
||||
/* Normalize into it. */
|
||||
R_TRY(PathFormatter::Normalize(buf.get(), size, util::GetReference(m_write_buffer).get(), m_write_buffer_length, flags));
|
||||
|
@ -480,7 +480,7 @@ namespace ams::fs {
|
|||
/* Allocate buffer. */
|
||||
const size_t size = util::AlignUp(length, WriteBufferAlignmentLength);
|
||||
auto buf = fs::impl::MakeUnique<char[]>(size);
|
||||
R_UNLESS(buf != nullptr, fs::ResultAllocationFailureInMakeUnique());
|
||||
R_UNLESS(buf != nullptr, fs::ResultAllocationMemoryFailedMakeUnique());
|
||||
|
||||
/* Set write buffer. */
|
||||
this->SetModifiableBuffer(std::move(buf), size);
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace ams::fs {
|
|||
R_TRY(m_base_fs->OpenFile(std::addressof(base_file), path, mode));
|
||||
|
||||
auto read_only_file = std::make_unique<ReadOnlyFile>(std::move(base_file));
|
||||
R_UNLESS(read_only_file != nullptr, fs::ResultAllocationFailureInReadOnlyFileSystemA());
|
||||
R_UNLESS(read_only_file != nullptr, fs::ResultAllocationMemoryFailedInReadOnlyFileSystemA());
|
||||
|
||||
*out_file = std::move(read_only_file);
|
||||
return ResultSuccess();
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace ams::fs {
|
|||
R_TRY(fsFsOpenFile(std::addressof(m_base_fs), sf_path.str, mode, std::addressof(f)));
|
||||
|
||||
auto file = std::make_unique<RemoteFile>(f);
|
||||
R_UNLESS(file != nullptr, fs::ResultAllocationFailureInNew());
|
||||
R_UNLESS(file != nullptr, fs::ResultAllocationMemoryFailedNew());
|
||||
|
||||
*out_file = std::move(file);
|
||||
return ResultSuccess();
|
||||
|
@ -192,7 +192,7 @@ namespace ams::fs {
|
|||
R_TRY(fsFsOpenDirectory(std::addressof(m_base_fs), sf_path.str, mode, std::addressof(d)));
|
||||
|
||||
auto dir = std::make_unique<RemoteDirectory>(d);
|
||||
R_UNLESS(dir != nullptr, fs::ResultAllocationFailureInNew());
|
||||
R_UNLESS(dir != nullptr, fs::ResultAllocationMemoryFailedNew());
|
||||
|
||||
*out_dir = std::move(dir);
|
||||
return ResultSuccess();
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace ams::fssrv::impl {
|
|||
} else {
|
||||
/* Make a new entry. */
|
||||
auto *entry = new ExternalKeyEntry(rights_id, access_key);
|
||||
R_UNLESS(entry != nullptr, fs::ResultAllocationFailure());
|
||||
R_UNLESS(entry != nullptr, fs::ResultAllocationMemoryFailed());
|
||||
|
||||
/* Add the entry to our list. */
|
||||
m_key_list.push_back(*entry);
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace ams::fssrv::impl {
|
|||
for (int i = 0; i < count; ++i) {
|
||||
/* Allocate new entry. */
|
||||
auto *entry = new ProgramIndexMapInfoEntry;
|
||||
R_UNLESS(entry != nullptr, fs::ResultAllocationFailureInNew());
|
||||
R_UNLESS(entry != nullptr, fs::ResultAllocationMemoryFailedNew());
|
||||
|
||||
/* Copy over the info. */
|
||||
entry->program_id = infos[i].program_id;
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace ams::fssystem::impl {
|
|||
if (max_entries > 0) {
|
||||
/* Create the entries. */
|
||||
m_entries = fs::impl::MakeUnique<CacheEntry[]>(static_cast<size_t>(max_entries));
|
||||
R_UNLESS(m_entries != nullptr, fs::ResultAllocationFailureInMakeUnique());
|
||||
R_UNLESS(m_entries != nullptr, fs::ResultAllocationMemoryFailedMakeUnique());
|
||||
|
||||
/* Clear the entries. */
|
||||
std::memset(m_entries.get(), 0, sizeof(CacheEntry) * max_entries);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue