2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

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())}, {"result_description", fmt::format("{:08X}", result.description.Value())},
{"timestamp", timestamp}, {"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]); out["user_id"] = fmt::format("{:016X}{:016X}", (*user_id)[1], (*user_id)[0]);
}
return out; 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, 31>& registers,
const std::array<u64, 32>& backtrace, u32 backtrace_size, const std::array<u64, 32>& backtrace, u32 backtrace_size,
const std::string& arch, u32 unk10) const { const std::string& arch, u32 unk10) const {
if (!IsReportingEnabled()) if (!IsReportingEnabled()) {
return; return;
}
const auto timestamp = GetTimestamp(); const auto timestamp = GetTimestamp();
json out; 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, void Reporter::SaveSvcBreakReport(u32 type, bool signal_debugger, u64 info1, u64 info2,
std::optional<std::vector<u8>> resolved_buffer) const { std::optional<std::vector<u8>> resolved_buffer) const {
if (!IsReportingEnabled()) if (!IsReportingEnabled()) {
return; return;
}
const auto timestamp = GetTimestamp(); const auto timestamp = GetTimestamp();
const auto title_id = system.CurrentProcess()->GetTitleID(); 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, void Reporter::SaveUnimplementedFunctionReport(Kernel::HLERequestContext& ctx, u32 command_id,
const std::string& name, const std::string& name,
const std::string& service_name) const { const std::string& service_name) const {
if (!IsReportingEnabled()) if (!IsReportingEnabled()) {
return; return;
}
const auto timestamp = GetTimestamp(); const auto timestamp = GetTimestamp();
const auto title_id = system.CurrentProcess()->GetTitleID(); 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, 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, bool startup_sound, u64 system_tick, std::vector<std::vector<u8>> normal_channel,
std::vector<std::vector<u8>> interactive_channel) const { std::vector<std::vector<u8>> interactive_channel) const {
if (!IsReportingEnabled()) if (!IsReportingEnabled()) {
return; return;
}
const auto timestamp = GetTimestamp(); const auto timestamp = GetTimestamp();
const auto title_id = system.CurrentProcess()->GetTitleID(); 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, void Reporter::SavePlayReport(u64 title_id, u64 process_id, std::vector<std::vector<u8>> data,
std::optional<u128> user_id) const { std::optional<u128> user_id) const {
if (!IsReportingEnabled()) if (!IsReportingEnabled()) {
return; return;
}
const auto timestamp = GetTimestamp(); const auto timestamp = GetTimestamp();
json out; 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, void Reporter::SaveErrorReport(u64 title_id, ResultCode result,
std::optional<std::string> custom_text_main, std::optional<std::string> custom_text_main,
std::optional<std::string> custom_text_detail) const { std::optional<std::string> custom_text_detail) const {
if (!IsReportingEnabled()) if (!IsReportingEnabled()) {
return; return;
}
const auto timestamp = GetTimestamp(); const auto timestamp = GetTimestamp();
json out; json out;
@ -338,8 +347,9 @@ void Reporter::SaveErrorReport(u64 title_id, ResultCode result,
} }
void Reporter::SaveUserReport() const { void Reporter::SaveUserReport() const {
if (!IsReportingEnabled()) if (!IsReportingEnabled()) {
return; return;
}
const auto timestamp = GetTimestamp(); const auto timestamp = GetTimestamp();
const auto title_id = system.CurrentProcess()->GetTitleID(); const auto title_id = system.CurrentProcess()->GetTitleID();