ams: use R_SUCCEED, R_THROW globally

This commit is contained in:
Michael Scire
2022-03-26 00:14:36 -07:00
parent e5b1739f65
commit dd78ede99f
370 changed files with 2107 additions and 2107 deletions

View File

@@ -46,14 +46,14 @@ namespace ams::fssystem::buffers {
}
} R_END_TRY_CATCH;
return ResultSuccess();
R_SUCCEED();
}
}
template<typename F>
Result DoContinuouslyUntilBufferIsAllocated(F f, const char *function_name) {
R_TRY(DoContinuouslyUntilBufferIsAllocated(f, []() ALWAYS_INLINE_LAMBDA { return ResultSuccess(); }, function_name));
return ResultSuccess();
R_TRY(DoContinuouslyUntilBufferIsAllocated(f, []() ALWAYS_INLINE_LAMBDA { R_SUCCEED(); }, function_name));
R_SUCCEED();
}
/* ACCURATE_TO_VERSION: Unknown */
@@ -110,10 +110,10 @@ namespace ams::fssystem::buffers {
if (buffer.first != 0) {
buffer_manager->DeallocateBuffer(buffer.first, buffer.second);
}
return fs::ResultBufferAllocationFailed();
R_THROW(fs::ResultBufferAllocationFailed());
}
*out = buffer;
return ResultSuccess();
R_SUCCEED();
};
if (context == nullptr || !context->IsNeedBlocking()) {
@@ -125,7 +125,7 @@ namespace ams::fssystem::buffers {
}
AMS_ASSERT(out->first != 0);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -155,7 +155,7 @@ namespace ams::fssystem {
m_external_attr_info_buffer = reinterpret_cast<char *>(aligned_attr_info_buf);
m_external_attr_info_count = static_cast<s32>((work_end - aligned_attr_info_buf) / sizeof(AttrInfo));
return ResultSuccess();
R_SUCCEED();
}
void Finalize();
@@ -216,7 +216,7 @@ namespace ams::fssystem {
m_peak_free_size = m_total_size;
m_peak_total_allocatable_size = m_total_size;
return ResultSuccess();
R_SUCCEED();
}
Result Initialize(s32 max_cache_count, uintptr_t address, size_t buffer_size, size_t block_size, s32 max_order) {
@@ -228,7 +228,7 @@ namespace ams::fssystem {
m_peak_free_size = m_total_size;
m_peak_total_allocatable_size = m_total_size;
return ResultSuccess();
R_SUCCEED();
}
Result Initialize(s32 max_cache_count, uintptr_t address, size_t buffer_size, size_t block_size, void *work, size_t work_size) {
@@ -245,7 +245,7 @@ namespace ams::fssystem {
m_peak_free_size = m_total_size;
m_peak_total_allocatable_size = m_total_size;
return ResultSuccess();
R_SUCCEED();
}
Result Initialize(s32 max_cache_count, uintptr_t address, size_t buffer_size, size_t block_size, s32 max_order, void *work, size_t work_size) {
@@ -262,7 +262,7 @@ namespace ams::fssystem {
m_peak_free_size = m_total_size;
m_peak_total_allocatable_size = m_total_size;
return ResultSuccess();
R_SUCCEED();
}
void Finalize() {

View File

@@ -106,7 +106,7 @@ namespace ams::fssystem {
}
*out = m_base_storage_size;
return ResultSuccess();
R_SUCCEED();
}
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
@@ -208,7 +208,7 @@ namespace ams::fssystem {
}
*out = m_base_storage_size;
return ResultSuccess();
R_SUCCEED();
}
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
@@ -295,7 +295,7 @@ namespace ams::fssystem {
}
*out = m_base_storage_size;
return ResultSuccess();
R_SUCCEED();
}
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {

View File

@@ -110,7 +110,7 @@ namespace ams::fssystem {
/* Return the allocated object. */
*out = std::move(p);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -40,13 +40,13 @@ namespace ams::fssystem {
virtual Result QueryAppropriateOffset(s64 *out, s64 offset, s64 access_size, s64 alignment_size) override {
/* Align the access. */
*out = util::AlignDown(offset + access_size, alignment_size);
return ResultSuccess();
R_SUCCEED();
}
virtual Result QueryInvocationCount(s64 *out, s64 start_offset, s64 end_offset, s64 access_size, s64 alignment_size) override {
/* Determine aligned access count. */
*out = util::DivideUp(end_offset - util::AlignDown(start_offset, alignment_size), access_size);
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -150,7 +150,7 @@ namespace ams::fssystem {
}
out_info->SetSkipCount(entry_index - param.entry_index);
return ResultSuccess();
R_SUCCEED();
}
template<typename EntryType>

View File

@@ -144,7 +144,7 @@ namespace ams::fssystem {
cur_offset += cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -58,7 +58,7 @@ namespace ams::fssystem {
virtual Result Read(s64 offset, void *buffer, size_t size) override;
virtual Result Write(s64 offset, const void *buffer, size_t size) override;
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); return fs::ResultUnsupportedSetSizeForIntegrityVerificationStorage(); }
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); R_THROW(fs::ResultUnsupportedSetSizeForIntegrityVerificationStorage()); }
virtual Result GetSize(s64 *out) override;
virtual Result Flush() override;