ams: use R_SUCCEED, R_THROW globally
This commit is contained in:
@@ -48,7 +48,7 @@ namespace ams::erpt::srv {
|
||||
switch (type) {
|
||||
case AttachmentOpenType_Create: return this->OpenStream(this->FileName().name, StreamMode_Write, AttachmentStreamBufferSize);
|
||||
case AttachmentOpenType_Read: return this->OpenStream(this->FileName().name, StreamMode_Read, AttachmentStreamBufferSize);
|
||||
default: return erpt::ResultInvalidArgument();
|
||||
default: R_THROW(erpt::ResultInvalidArgument());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
Result Attachment::GetFlags(AttachmentFlagSet *out) const {
|
||||
*out = m_record->m_info.flags;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Attachment::SetFlags(AttachmentFlagSet flags) {
|
||||
@@ -74,7 +74,7 @@ namespace ams::erpt::srv {
|
||||
m_record->m_info.flags |= flags;
|
||||
return Journal::Commit();
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Attachment::GetSize(s64 *out) const {
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace ams::erpt::srv {
|
||||
R_TRY(m_attachment->Open(AttachmentOpenType_Read));
|
||||
attachment_guard.Cancel();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AttachmentImpl::Read(ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer) {
|
||||
@@ -67,7 +67,7 @@ namespace ams::erpt::srv {
|
||||
delete m_attachment;
|
||||
m_attachment = nullptr;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AttachmentImpl::GetSize(ams::sf::Out<s64> out) {
|
||||
|
||||
@@ -62,12 +62,12 @@ namespace ams::erpt::srv {
|
||||
case FieldType_I8Array: R_TRY(Cipher::AddField(report, field->id, reinterpret_cast< s8 *>(arr_buf + field->value_array.start_idx), field->value_array.size / sizeof(s8))); break;
|
||||
case FieldType_I32Array: R_TRY(Cipher::AddField(report, field->id, reinterpret_cast< s32 *>(arr_buf + field->value_array.start_idx), field->value_array.size / sizeof(s32))); break;
|
||||
case FieldType_I64Array: R_TRY(Cipher::AddField(report, field->id, reinterpret_cast< s64 *>(arr_buf + field->value_array.start_idx), field->value_array.size / sizeof(s64))); break;
|
||||
default: return erpt::ResultInvalidArgument();
|
||||
default: R_THROW(erpt::ResultInvalidArgument());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Context::AddContextToCategory(const ContextEntry *entry, const u8 *data, u32 data_size) {
|
||||
@@ -77,7 +77,7 @@ namespace ams::erpt::srv {
|
||||
R_TRY(record->Initialize(entry, data, data_size));
|
||||
|
||||
this->AddContextRecordToCategory(std::move(record));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Context::AddContextRecordToCategory(std::unique_ptr<ContextRecord> record) {
|
||||
@@ -91,7 +91,7 @@ namespace ams::erpt::srv {
|
||||
delete back;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Context::SubmitContext(const ContextEntry *entry, const u8 *data, u32 data_size) {
|
||||
@@ -123,7 +123,7 @@ namespace ams::erpt::srv {
|
||||
Cipher::End(report);
|
||||
report->Close();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Context::ClearContext(CategoryId cat) {
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
ManagerImpl::NotifyAll();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::CreateReportV0(ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &data_buffer, const ams::sf::InBuffer &meta_buffer) {
|
||||
@@ -63,22 +63,22 @@ namespace ams::erpt::srv {
|
||||
|
||||
Result ContextImpl::SetInitialLaunchSettingsCompletionTime(const time::SteadyClockTimePoint &time_point) {
|
||||
Reporter::SetInitialLaunchSettingsCompletionTime(time_point);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::ClearInitialLaunchSettingsCompletionTime() {
|
||||
Reporter::ClearInitialLaunchSettingsCompletionTime();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::UpdatePowerOnTime() {
|
||||
/* NOTE: Prior to 12.0.0, this set the power on time, but now erpt does it during initialization. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::UpdateAwakeTime() {
|
||||
/* NOTE: Prior to 12.0.0, this set the power on time, but now erpt does it during initialization. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::SubmitMultipleCategoryContext(const MultipleCategoryContextEntry &ctx_entry, const ams::sf::InBuffer &str_buffer) {
|
||||
@@ -107,17 +107,17 @@ namespace ams::erpt::srv {
|
||||
total_arr_count += ctx_entry.array_buf_counts[i];
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::UpdateApplicationLaunchTime() {
|
||||
Reporter::UpdateApplicationLaunchTime();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::ClearApplicationLaunchTime() {
|
||||
Reporter::ClearApplicationLaunchTime();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::SubmitAttachment(ams::sf::Out<AttachmentId> out, const ams::sf::InBuffer &attachment_name, const ams::sf::InBuffer &attachment_data) {
|
||||
@@ -154,7 +154,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
ManagerImpl::NotifyAll();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextImpl::CreateReportWithAttachmentsDeprecated(ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &data_buffer, const ams::sf::InBuffer &attachment_ids_buffer) {
|
||||
@@ -176,7 +176,7 @@ namespace ams::erpt::srv {
|
||||
Result ContextImpl::InvalidateForcedShutdownDetection() {
|
||||
/* NOTE: Nintendo does not check the result here. */
|
||||
erpt::srv::InvalidateForcedShutdownDetection();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace ams::erpt::srv {
|
||||
guard.Cancel();
|
||||
s_record_count += m_ctx.field_count;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextRecord::Add(FieldId field_id, bool value_bool) {
|
||||
@@ -120,7 +120,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
field.value_bool = value_bool;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextRecord::Add(FieldId field_id, u32 value_u32) {
|
||||
@@ -134,7 +134,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
field.value_u32 = value_u32;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextRecord::Add(FieldId field_id, u64 value_u64) {
|
||||
@@ -148,7 +148,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
field.value_u64 = value_u64;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextRecord::Add(FieldId field_id, s32 value_i32) {
|
||||
@@ -162,7 +162,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
field.value_i32 = value_i32;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextRecord::Add(FieldId field_id, s64 value_i64) {
|
||||
@@ -176,7 +176,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
field.value_i64 = value_i64;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextRecord::Add(FieldId field_id, const void *arr, u32 size, FieldType type) {
|
||||
@@ -198,7 +198,7 @@ namespace ams::erpt::srv {
|
||||
};
|
||||
|
||||
std::memcpy(m_ctx.array_buffer + start_idx, arr, size);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ContextRecord::Add(FieldId field_id, const char *str, u32 str_size) {
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace ams::erpt::srv {
|
||||
/* Commit the context. */
|
||||
R_TRY(Stream::CommitStream());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CreateReportForForcedShutdown() {
|
||||
@@ -88,7 +88,7 @@ namespace ams::erpt::srv {
|
||||
/* Create report. */
|
||||
R_TRY(Reporter::CreateReport(ReportType_Invisible, ResultSuccess(), std::move(record), nullptr, nullptr, 0));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LoadForcedShutdownContext() {
|
||||
@@ -162,7 +162,7 @@ namespace ams::erpt::srv {
|
||||
R_TRY(Context::SubmitContextRecord(std::move(record)));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
u32 GetForcedShutdownContextCount() {
|
||||
@@ -215,7 +215,7 @@ namespace ams::erpt::srv {
|
||||
/* Commit the context. */
|
||||
R_TRY(Stream::CommitStream());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -324,7 +324,7 @@ namespace ams::erpt::srv {
|
||||
/* Commit the deletion. */
|
||||
R_TRY(Stream::CommitStream());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
R_TRY(report->Write(str, str_len));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
static Result AddId(Report *report, FieldId field_id) {
|
||||
@@ -64,7 +64,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
R_TRY(AddStringValue(report, FieldString[field_id], strnlen(FieldString[field_id], MaxFieldStringSize)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -77,7 +77,7 @@ namespace ams::erpt::srv {
|
||||
R_TRY(report->Write(tag));
|
||||
R_TRY(report->Write(reinterpret_cast<u8 *>(std::addressof(big_endian_value)), sizeof(big_endian_value)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -98,21 +98,21 @@ namespace ams::erpt::srv {
|
||||
R_TRY(AddValue(report, arr[i]));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static Result AddIdValuePair(Report *report, FieldId field_id, T value) {
|
||||
R_TRY(AddId(report, field_id));
|
||||
R_TRY(AddValue(report, value));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static Result AddIdValueArray(Report *report, FieldId field_id, T *arr, u32 arr_size) {
|
||||
R_TRY(AddId(report, field_id));
|
||||
R_TRY(AddValueArray(report, arr, arr_size));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
public:
|
||||
static Result Begin(Report *report, u32 record_count) {
|
||||
@@ -128,12 +128,12 @@ namespace ams::erpt::srv {
|
||||
R_TRY(report->Write(be_count));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
static Result End(Report *report) {
|
||||
AMS_UNUSED(report);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -149,7 +149,7 @@ namespace ams::erpt::srv {
|
||||
static Result AddField(Report *report, FieldId field_id, bool value) {
|
||||
R_TRY(AddId(report, field_id));
|
||||
R_TRY(report->Write(static_cast<u8>(value ? ValueTypeTag::True : ValueTypeTag::False)));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
static Result AddField(Report *report, FieldId field_id, char *str, u32 len) {
|
||||
@@ -157,7 +157,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
R_TRY(AddStringValue(report, str, len));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
static Result AddField(Report *report, FieldId field_id, u8 *bin, u32 len) {
|
||||
@@ -177,7 +177,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
R_TRY(report->Write(bin, len));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace ams::erpt::srv {
|
||||
stream.CloseStream();
|
||||
stream.CommitStream();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Journal::Delete(ReportId report_id) {
|
||||
@@ -97,7 +97,7 @@ namespace ams::erpt::srv {
|
||||
/* Restore the attachments. */
|
||||
R_TRY(JournalForAttachments::RestoreJournal(std::addressof(stream)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
JournalRecord<ReportInfo> *Journal::Retrieve(ReportId report_id) {
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace ams::erpt::srv {
|
||||
for (auto it = s_attachment_list.crbegin(); it != s_attachment_list.crend(); it++) {
|
||||
R_TRY(stream->WriteStream(reinterpret_cast<const u8 *>(std::addressof(it->m_info)), sizeof(it->m_info)));
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result JournalForAttachments::DeleteAttachments(ReportId report_id) {
|
||||
@@ -74,7 +74,7 @@ namespace ams::erpt::srv {
|
||||
it++;
|
||||
}
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result JournalForAttachments::GetAttachmentList(AttachmentList *out, ReportId report_id) {
|
||||
@@ -85,7 +85,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
}
|
||||
out->attachment_count = count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
u32 JournalForAttachments::GetUsedStorage() {
|
||||
@@ -133,7 +133,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
|
||||
cleanup_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
JournalRecord<AttachmentInfo> *JournalForAttachments::RetrieveRecord(AttachmentId attachment_id) {
|
||||
@@ -153,10 +153,10 @@ namespace ams::erpt::srv {
|
||||
|
||||
record->m_info.owner_report_id = report_id;
|
||||
record->m_info.flags.Set<AttachmentFlag::HasOwner>();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return erpt::ResultInvalidArgument();
|
||||
R_THROW(erpt::ResultInvalidArgument());
|
||||
}
|
||||
|
||||
Result JournalForAttachments::StoreRecord(JournalRecord<AttachmentInfo> *record) {
|
||||
@@ -173,7 +173,7 @@ namespace ams::erpt::srv {
|
||||
s_attachment_count++;
|
||||
s_used_storage += static_cast<u32>(record->m_info.attachment_size);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result JournalForAttachments::SubmitAttachment(AttachmentId *out, char *name, const u8 *data, u32 data_size) {
|
||||
@@ -217,7 +217,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
*out = info.attachment_id;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace ams::erpt::srv {
|
||||
if (R_FAILED(stream->ReadStream(std::addressof(size), reinterpret_cast<u8 *>(std::addressof(s_journal_meta)), sizeof(s_journal_meta))) || size != sizeof(s_journal_meta)) {
|
||||
InitializeJournal();
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
u32 JournalForMeta::GetTransmittedCount(ReportType type) {
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace ams::erpt::srv {
|
||||
for (auto it = s_record_list.crbegin(); it != s_record_list.crend(); it++) {
|
||||
R_TRY(stream->WriteStream(reinterpret_cast<const u8 *>(std::addressof(it->m_info)), sizeof(it->m_info)));
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void JournalForReports::EraseReportImpl(JournalRecord<ReportInfo> *record, bool increment_count, bool force_delete_attachments) {
|
||||
@@ -80,10 +80,10 @@ namespace ams::erpt::srv {
|
||||
auto *record = std::addressof(*it);
|
||||
if (record->m_info.id == report_id) {
|
||||
EraseReportImpl(record, false, false);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return erpt::ResultInvalidArgument();
|
||||
R_THROW(erpt::ResultInvalidArgument());
|
||||
}
|
||||
|
||||
Result JournalForReports::DeleteReportWithAttachments() {
|
||||
@@ -91,10 +91,10 @@ namespace ams::erpt::srv {
|
||||
auto *record = std::addressof(*it);
|
||||
if (record->m_info.flags.Test<ReportFlag::HasAttachment>()) {
|
||||
EraseReportImpl(record, true, true);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return erpt::ResultNotFound();
|
||||
R_THROW(erpt::ResultNotFound());
|
||||
}
|
||||
|
||||
s64 JournalForReports::GetMaxReportSize() {
|
||||
@@ -113,7 +113,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
}
|
||||
out->report_count = count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
u32 JournalForReports::GetStoredReportCount(ReportType type) {
|
||||
@@ -169,7 +169,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
|
||||
cleanup_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
JournalRecord<ReportInfo> *JournalForReports::RetrieveRecord(ReportId report_id) {
|
||||
@@ -222,7 +222,7 @@ namespace ams::erpt::srv {
|
||||
s_record_count_by_type[record->m_info.type]++;
|
||||
s_used_storage += static_cast<u32>(record->m_info.report_size);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result MountSystemSaveData() {
|
||||
@@ -66,7 +66,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -115,7 +115,7 @@ namespace ams::erpt::srv {
|
||||
Reporter::UpdatePowerOnTime();
|
||||
Reporter::UpdateAwakeTime();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result InitializeAndStartService() {
|
||||
@@ -138,7 +138,7 @@ namespace ams::erpt::srv {
|
||||
R_TRY(record->Add(FieldId_ProductModel, model, model_len));
|
||||
R_TRY(Context::SubmitContextRecord(std::move(record)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetRegionSetting(const char *region, u32 region_len) {
|
||||
@@ -149,17 +149,17 @@ namespace ams::erpt::srv {
|
||||
R_TRY(record->Add(FieldId_RegionSetting, region, region_len));
|
||||
R_TRY(Context::SubmitContextRecord(std::move(record)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetRedirectNewReportsToSdCard(bool redirect) {
|
||||
Reporter::SetRedirectNewReportsToSdCard(redirect);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetEnabledAutomaticReportCleanup(bool en) {
|
||||
g_automatic_report_cleanup_enabled = en;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void Wait() {
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace ams::erpt::srv {
|
||||
for (auto &manager : g_manager_list) {
|
||||
manager.NotifyOne();
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ManagerImpl::GetReportList(const ams::sf::OutBuffer &out_list, ReportType type_filter) {
|
||||
@@ -54,7 +54,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
Result ManagerImpl::GetEvent(ams::sf::OutCopyHandle out) {
|
||||
out.SetValue(m_system_event.GetReadableHandle(), false);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ManagerImpl::CleanupReports() {
|
||||
@@ -83,7 +83,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
|
||||
out.SetValue(stats);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ManagerImpl::GetAttachmentList(const ams::sf::OutBuffer &out_list, const ReportId &report_id) {
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace ams::erpt::srv {
|
||||
switch (type) {
|
||||
case ReportOpenType_Create: return this->OpenStream(this->FileName().name, StreamMode_Write, ReportStreamBufferSize);
|
||||
case ReportOpenType_Read: return this->OpenStream(this->FileName().name, StreamMode_Read, ReportStreamBufferSize);
|
||||
default: return erpt::ResultInvalidArgument();
|
||||
default: R_THROW(erpt::ResultInvalidArgument());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
Result Report::GetFlags(ReportFlagSet *out) const {
|
||||
*out = m_record->m_info.flags;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Report::SetFlags(ReportFlagSet flags) {
|
||||
@@ -80,7 +80,7 @@ namespace ams::erpt::srv {
|
||||
m_record->m_info.flags |= flags;
|
||||
return Journal::Commit();
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Report::GetSize(s64 *out) const {
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace ams::erpt::srv {
|
||||
R_TRY(m_report->Open(ReportOpenType_Read));
|
||||
report_guard.Cancel();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ReportImpl::Read(ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer) {
|
||||
@@ -67,7 +67,7 @@ namespace ams::erpt::srv {
|
||||
delete m_report;
|
||||
m_report = nullptr;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ReportImpl::GetSize(ams::sf::Out<s64> out) {
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
*out_total_size = total_size;
|
||||
*out_size = size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void SubmitErrorContext(ContextRecord *record, Result result) {
|
||||
@@ -238,7 +238,7 @@ namespace ams::erpt::srv {
|
||||
});
|
||||
R_UNLESS(found_error_code, erpt::ResultRequiredFieldMissing());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SubmitReportDefaults(const ContextEntry *ctx) {
|
||||
@@ -270,7 +270,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
R_TRY(Context::SubmitContextRecord(std::move(record)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void SaveSyslogReportIfRequired(const ContextEntry *ctx, const ReportId &report_id) {
|
||||
@@ -342,7 +342,7 @@ namespace ams::erpt::srv {
|
||||
for (u32 i = 0; i < num_attachments; i++) {
|
||||
R_TRY(JournalForAttachments::SetOwner(attachments[i], report_id));
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CreateReportFile(const ReportId &report_id, ReportType type, const ReportMetaData *meta, u32 num_attachments, const time::PosixTime ×tamp_user, const time::PosixTime ×tamp_network, bool redirect_new_reports) {
|
||||
@@ -393,24 +393,24 @@ namespace ams::erpt::srv {
|
||||
R_TRY(Journal::Commit());
|
||||
|
||||
report_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Result Reporter::RegisterRunningApplet(ncm::ProgramId program_id) {
|
||||
g_applet_active_time_info_list.Register(program_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Reporter::UnregisterRunningApplet(ncm::ProgramId program_id) {
|
||||
g_applet_active_time_info_list.Unregister(program_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Reporter::UpdateAppletSuspendedDuration(ncm::ProgramId program_id, TimeSpan duration) {
|
||||
g_applet_active_time_info_list.UpdateSuspendedDuration(program_id, duration);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Reporter::CreateReport(ReportType type, Result ctx_result, const ContextEntry *ctx, const u8 *data, u32 data_size, const ReportMetaData *meta, const AttachmentId *attachments, u32 num_attachments) {
|
||||
@@ -465,7 +465,7 @@ namespace ams::erpt::srv {
|
||||
/* Create the report file. */
|
||||
R_TRY(CreateReportFile(report_id, type, meta, num_attachments, timestamp_user, timestamp_network, s_redirect_new_reports));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Reporter::SubmitReportContexts(const ReportId &report_id, ReportType type, Result ctx_result, std::unique_ptr<ContextRecord> record, const time::PosixTime ×tamp_user, const time::PosixTime ×tamp_network) {
|
||||
@@ -530,7 +530,7 @@ namespace ams::erpt::srv {
|
||||
SubmitResourceLimitContexts();
|
||||
#endif
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace ams::erpt::srv {
|
||||
std::memcpy(s_serial_number, sn, sn_len);
|
||||
std::memcpy(s_os_version, os, os_len);
|
||||
std::memcpy(s_private_os_version, os_priv, os_priv_len);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
static Result RegisterRunningApplet(ncm::ProgramId program_id);
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace ams::erpt::srv {
|
||||
case PortIndex_Context:
|
||||
return AcceptImpl(server, m_context_session_object.GetShared());
|
||||
default:
|
||||
return erpt::ResultNotSupported();
|
||||
R_THROW(erpt::ResultNotSupported());
|
||||
}
|
||||
}
|
||||
public:
|
||||
@@ -86,7 +86,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
os::StartThread(std::addressof(m_thread));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void Wait() {
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
/* Return it. */
|
||||
out.SetValue(intf);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace ams::erpt::srv {
|
||||
std::scoped_lock lk(s_fs_commit_mutex);
|
||||
|
||||
fs::CommitSaveData(ReportStoragePath);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Stream::GetStreamSize(s64 *out, const char *path) {
|
||||
@@ -109,7 +109,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
file_guard.Cancel();
|
||||
lock_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Stream::ReadStream(u32 *out, u8 *dst, u32 dst_size) {
|
||||
@@ -153,7 +153,7 @@ namespace ams::erpt::srv {
|
||||
read_count = static_cast<u32>(fs_read_size);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Stream::WriteStream(const u8 *src, u32 src_size) {
|
||||
@@ -180,7 +180,7 @@ namespace ams::erpt::srv {
|
||||
m_file_position += src_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void Stream::CloseStream() {
|
||||
@@ -217,7 +217,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
m_file_position += m_buffer_count;
|
||||
m_buffer_count = 0;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user