Upgrade codebase to C++ 20 + fix warnings + update submodules (#6115)

This commit is contained in:
GPUCode 2022-09-21 19:36:12 +03:00 committed by GitHub
parent 90b418fd1a
commit cbd5d1c15c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
67 changed files with 6837 additions and 7475 deletions

View file

@ -94,7 +94,7 @@ u64 Handler::GetSystemTime() const {
epoch_tm.tm_mon = 0;
epoch_tm.tm_year = 100;
epoch_tm.tm_isdst = 0;
u64 epoch = std::mktime(&epoch_tm) * 1000;
s64 epoch = std::mktime(&epoch_tm) * 1000;
// 3DS console time uses Jan 1 1900 as internal epoch,
// so we use the milliseconds between 1900 and 2000 as base console time

View file

@ -262,8 +262,8 @@ void Module::APTInterface::GetSharedFont(Kernel::HLERequestContext& ctx) {
// kernel version and an applet with new kernel version run at the same time, and they both use
// shared font, different linear heap region would have required shared font to relocate
// according to two different addresses at the same time, which is impossible.
VAddr target_address =
apt->shared_font_mem->GetLinearHeapPhysicalOffset() + Memory::LINEAR_HEAP_VADDR;
VAddr target_address = static_cast<VAddr>(apt->shared_font_mem->GetLinearHeapPhysicalOffset()) +
Memory::LINEAR_HEAP_VADDR;
if (!apt->shared_font_relocated) {
BCFNT::RelocateSharedFont(apt->shared_font_mem, target_address);
apt->shared_font_relocated = true;

View file

@ -150,15 +150,15 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(u32* cmd_buf, const Funct
int num_params = header.normal_params_size + header.translate_params_size;
std::string function_name = info == nullptr ? fmt::format("{:#08x}", cmd_buf[0]) : info->name;
fmt::memory_buffer buf;
fmt::format_to(buf, "function '{}': port='{}' cmd_buf={{[0]={:#x}", function_name, service_name,
cmd_buf[0]);
std::string result = fmt::format("function '{}': port='{}' cmd_buf={{[0]={:#x}", function_name,
service_name, cmd_buf[0]);
for (int i = 1; i <= num_params; ++i) {
fmt::format_to(buf, ", [{}]={:#x}", i, cmd_buf[i]);
result += fmt::format(", [{}]={:#x}", i, cmd_buf[i]);
}
buf.push_back('}');
LOG_ERROR(Service, "unknown / unimplemented {}", fmt::to_string(buf));
result.push_back('}');
LOG_ERROR(Service, "unknown / unimplemented {}", result);
// TODO(bunnei): Hack - ignore error
header.normal_params_size.Assign(1);
header.translate_params_size.Assign(0);