libstrat: fix bugs/compiler warnings
This commit is contained in:
@@ -98,7 +98,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
|
||||
s64 JournalForReports::GetMaxReportSize() {
|
||||
s64 max_size;
|
||||
s64 max_size = 0;
|
||||
for (auto it = s_record_list.begin(); it != s_record_list.end(); it++) {
|
||||
max_size = std::max(max_size, it->info.report_size);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace ams::erpt::srv {
|
||||
auto file_guard = SCOPE_GUARD { if (mode == StreamMode_Write) { fs::CloseFile(this->file_handle); } };
|
||||
|
||||
std::strncpy(this->file_name, path, sizeof(this->file_name));
|
||||
this->file_name[sizeof(this->file_name) - 1] = '\x00';
|
||||
|
||||
this->buffer = reinterpret_cast<u8 *>(Allocate(buffer_size));
|
||||
R_UNLESS(this->buffer != nullptr, erpt::ResultOutOfMemory());
|
||||
|
||||
@@ -183,8 +183,8 @@ namespace ams::fs::impl {
|
||||
return g_access_log_manager_printer_callback_manager;
|
||||
}
|
||||
|
||||
const char *GetPriorityRawName() {
|
||||
return fs::impl::IdString().ToString(fs::GetPriorityRawOnCurrentThreadInternal());
|
||||
const char *GetPriorityRawName(fs::impl::IdString &id_string) {
|
||||
return id_string.ToString(fs::GetPriorityRawOnCurrentThreadInternal());
|
||||
}
|
||||
|
||||
Result OutputAccessLogToSdCardImpl(const char *log, size_t size) {
|
||||
@@ -405,28 +405,32 @@ namespace ams::fs::impl {
|
||||
void OutputAccessLog(Result result, os::Tick start, os::Tick end, const char *name, fs::FileHandle handle, const char *fmt, ...) {
|
||||
std::va_list vl;
|
||||
va_start(vl, fmt);
|
||||
OutputAccessLog(result, GetPriorityRawName(), start, end, name, handle.handle, fmt, vl);
|
||||
fs::impl::IdString id_string;
|
||||
OutputAccessLog(result, GetPriorityRawName(id_string), start, end, name, handle.handle, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
void OutputAccessLog(Result result, os::Tick start, os::Tick end, const char *name, fs::DirectoryHandle handle, const char *fmt, ...) {
|
||||
std::va_list vl;
|
||||
va_start(vl, fmt);
|
||||
OutputAccessLog(result, GetPriorityRawName(), start, end, name, handle.handle, fmt, vl);
|
||||
fs::impl::IdString id_string;
|
||||
OutputAccessLog(result, GetPriorityRawName(id_string), start, end, name, handle.handle, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
void OutputAccessLog(Result result, os::Tick start, os::Tick end, const char *name, fs::impl::IdentifyAccessLogHandle handle, const char *fmt, ...) {
|
||||
std::va_list vl;
|
||||
va_start(vl, fmt);
|
||||
OutputAccessLog(result, GetPriorityRawName(), start, end, name, handle.handle, fmt, vl);
|
||||
fs::impl::IdString id_string;
|
||||
OutputAccessLog(result, GetPriorityRawName(id_string), start, end, name, handle.handle, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
void OutputAccessLog(Result result, os::Tick start, os::Tick end, const char *name, const void *handle, const char *fmt, ...) {
|
||||
std::va_list vl;
|
||||
va_start(vl, fmt);
|
||||
OutputAccessLog(result, GetPriorityRawName(), start, end, name, handle, fmt, vl);
|
||||
fs::impl::IdString id_string;
|
||||
OutputAccessLog(result, GetPriorityRawName(id_string), start, end, name, handle, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
@@ -441,7 +445,8 @@ namespace ams::fs::impl {
|
||||
if (R_FAILED(result)) {
|
||||
std::va_list vl;
|
||||
va_start(vl, fmt);
|
||||
OutputAccessLog(result, GetPriorityRawName(), start, end, name, handle.handle, fmt, vl);
|
||||
fs::impl::IdString id_string;
|
||||
OutputAccessLog(result, GetPriorityRawName(id_string), start, end, name, handle.handle, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
}
|
||||
@@ -450,7 +455,8 @@ namespace ams::fs::impl {
|
||||
if (R_FAILED(result)) {
|
||||
std::va_list vl;
|
||||
va_start(vl, fmt);
|
||||
OutputAccessLog(result, GetPriorityRawName(), start, end, name, handle.handle, fmt, vl);
|
||||
fs::impl::IdString id_string;
|
||||
OutputAccessLog(result, GetPriorityRawName(id_string), start, end, name, handle.handle, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
}
|
||||
@@ -459,7 +465,8 @@ namespace ams::fs::impl {
|
||||
if (R_FAILED(result)) {
|
||||
std::va_list vl;
|
||||
va_start(vl, fmt);
|
||||
OutputAccessLog(result, GetPriorityRawName(), start, end, name, handle, fmt, vl);
|
||||
fs::impl::IdString id_string;
|
||||
OutputAccessLog(result, GetPriorityRawName(id_string), start, end, name, handle, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace ams::fs {
|
||||
|
||||
PriorityRaw GetPriorityRawOnCurrentThreadInternal() {
|
||||
fs::PriorityRaw priority_raw;
|
||||
AMS_FS_R_ABORT_UNLESS(GetPriorityRawImpl(std::addressof(priority_raw), os::GetCurrentThread()));
|
||||
R_ABORT_UNLESS(GetPriorityRawImpl(std::addressof(priority_raw), os::GetCurrentThread()));
|
||||
return priority_raw;
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@ namespace ams::fssystem {
|
||||
core_size = (size < buffer_round_up_difference) ? 0 : util::AlignDown(size - buffer_round_up_difference, data_alignment);
|
||||
buffer_gap = buffer_round_up_difference;
|
||||
offset_gap = GetRoundDownDifference(offset, data_alignment);
|
||||
|
||||
covered_offset = offset;
|
||||
}
|
||||
|
||||
/* Read the core portion. */
|
||||
|
||||
Reference in New Issue
Block a user