From f12eb408344b992ac71ded87903510263dc51836 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 5 Jul 2019 17:05:24 -0400 Subject: core/reporter: Make bracing consistent Makes all control statements braced, regardless of their size, making code more uniform. --- src/core/reporter.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp index 79af28314..be471131f 100644 --- a/src/core/reporter.cpp +++ b/src/core/reporter.cpp @@ -63,8 +63,11 @@ json GetReportCommonData(u64 title_id, ResultCode result, const std::string& tim {"result_description", fmt::format("{:08X}", result.description.Value())}, {"timestamp", timestamp}, }; - if (user_id.has_value()) + + if (user_id.has_value()) { out["user_id"] = fmt::format("{:016X}{:016X}", (*user_id)[1], (*user_id)[0]); + } + return out; } @@ -189,8 +192,9 @@ void Reporter::SaveCrashReport(u64 title_id, ResultCode result, u64 set_flags, u const std::array& registers, const std::array& backtrace, u32 backtrace_size, const std::string& arch, u32 unk10) const { - if (!IsReportingEnabled()) + if (!IsReportingEnabled()) { return; + } const auto timestamp = GetTimestamp(); json out; @@ -214,8 +218,9 @@ void Reporter::SaveCrashReport(u64 title_id, ResultCode result, u64 set_flags, u void Reporter::SaveSvcBreakReport(u32 type, bool signal_debugger, u64 info1, u64 info2, std::optional> resolved_buffer) const { - if (!IsReportingEnabled()) + if (!IsReportingEnabled()) { return; + } const auto timestamp = GetTimestamp(); const auto title_id = system.CurrentProcess()->GetTitleID(); @@ -240,8 +245,9 @@ void Reporter::SaveSvcBreakReport(u32 type, bool signal_debugger, u64 info1, u64 void Reporter::SaveUnimplementedFunctionReport(Kernel::HLERequestContext& ctx, u32 command_id, const std::string& name, const std::string& service_name) const { - if (!IsReportingEnabled()) + if (!IsReportingEnabled()) { return; + } const auto timestamp = GetTimestamp(); const auto title_id = system.CurrentProcess()->GetTitleID(); @@ -261,8 +267,9 @@ void Reporter::SaveUnimplementedAppletReport( u32 applet_id, u32 common_args_version, u32 library_version, u32 theme_color, bool startup_sound, u64 system_tick, std::vector> normal_channel, std::vector> interactive_channel) const { - if (!IsReportingEnabled()) + if (!IsReportingEnabled()) { return; + } const auto timestamp = GetTimestamp(); const auto title_id = system.CurrentProcess()->GetTitleID(); @@ -295,8 +302,9 @@ void Reporter::SaveUnimplementedAppletReport( void Reporter::SavePlayReport(u64 title_id, u64 process_id, std::vector> data, std::optional user_id) const { - if (!IsReportingEnabled()) + if (!IsReportingEnabled()) { return; + } const auto timestamp = GetTimestamp(); json out; @@ -318,8 +326,9 @@ void Reporter::SavePlayReport(u64 title_id, u64 process_id, std::vector custom_text_main, std::optional custom_text_detail) const { - if (!IsReportingEnabled()) + if (!IsReportingEnabled()) { return; + } const auto timestamp = GetTimestamp(); json out; @@ -338,8 +347,9 @@ void Reporter::SaveErrorReport(u64 title_id, ResultCode result, } void Reporter::SaveUserReport() const { - if (!IsReportingEnabled()) + if (!IsReportingEnabled()) { return; + } const auto timestamp = GetTimestamp(); const auto title_id = system.CurrentProcess()->GetTitleID(); -- cgit v1.2.3