core/reporter: Make bracing consistent

Makes all control statements braced, regardless of their size, making
code more uniform.
This commit is contained in:
Lioncash 2019-07-05 17:05:24 -04:00
parent 7ad11e3867
commit f12eb40834

View File

@ -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<u64, 31>& registers,
const std::array<u64, 32>& 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<std::vector<u8>> 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<std::vector<u8>> normal_channel,
std::vector<std::vector<u8>> 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<std::vector<u8>> data,
std::optional<u128> 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<std::vec
void Reporter::SaveErrorReport(u64 title_id, ResultCode result,
std::optional<std::string> custom_text_main,
std::optional<std::string> 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();