diff --git a/src/audio_core/hle/mixers.cpp b/src/audio_core/hle/mixers.cpp index 533df2be2..727d64fde 100644 --- a/src/audio_core/hle/mixers.cpp +++ b/src/audio_core/hle/mixers.cpp @@ -132,7 +132,7 @@ void Mixers::DownmixAndMixIntoCurrentFrame(float gain, const QuadFrame32& sample return; } - UNREACHABLE_MSG("Invalid output_format %zu", static_cast(state.output_format)); + UNREACHABLE_MSG("Invalid output_format {}", static_cast(state.output_format)); } void Mixers::AuxReturn(const IntermediateMixSamples& read_samples) { diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp index 20fd1944d..0ac746906 100644 --- a/src/citra_qt/debugger/graphics/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp @@ -708,7 +708,7 @@ unsigned int GraphicsSurfaceWidget::NibblesPerPixel(GraphicsSurfaceWidget::Forma default: UNREACHABLE_MSG("GraphicsSurfaceWidget::BytesPerPixel: this should not be reached as this " "function should be given a format which is in " - "GraphicsSurfaceWidget::Format. Instead got %i", + "GraphicsSurfaceWidget::Format. Instead got {}", static_cast(format)); return 0; } diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index eaa8d81ed..277dfb697 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -198,7 +198,7 @@ public: for (int i = 0; i < size; i++) { DEBUG_ASSERT_MSG( ((u8*)data)[i] == (*ptr)[i], - "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", + "Savestate verification failure: {} ({:#X}) (at {}) != {} ({:#X}) (at {}).\n", ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], (*ptr)[i], (*ptr)[i], &(*ptr)[i]); } @@ -224,7 +224,7 @@ public: for (int i = 0; i < size; i++) { DEBUG_ASSERT_MSG( ((u8*)data)[i] == (*ptr)[i], - "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", + "Savestate verification failure: {} ({#:X}) (at {}) != {} ({:#X}) (at {}).\n", ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], (*ptr)[i], (*ptr)[i], &(*ptr)[i]); } @@ -486,8 +486,8 @@ public: break; case MODE_VERIFY: DEBUG_ASSERT_MSG((x == (char*)*ptr), - "Savestate verification failure: \"%s\" != \"%s\" (at %p).\n", - x.c_str(), (char*)*ptr, ptr); + "Savestate verification failure: \"{}\" != \"{}\" (at {}).\n", x, + (char*)*ptr, ptr); break; } (*ptr) += stringLen; @@ -508,8 +508,8 @@ public: break; case MODE_VERIFY: DEBUG_ASSERT_MSG((x == (wchar_t*)*ptr), - "Savestate verification failure: \"%ls\" != \"%ls\" (at %p).\n", - x.c_str(), (wchar_t*)*ptr, ptr); + "Savestate verification failure: \"{}\" != \"{}\" (at {}).\n", x, + (wchar_t*)*ptr, ptr); break; } (*ptr) += stringLen; diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 5879ebe3b..554a0ee95 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -651,12 +651,12 @@ static const std::string GetUserDirectory(const std::string& envvar) { else if (envvar == "XDG_CACHE_HOME") subdirectory = DIR_SEP ".cache"; else - ASSERT_MSG(false, "Unknown XDG variable %s.", envvar.c_str()); + ASSERT_MSG(false, "Unknown XDG variable {}.", envvar); user_dir = GetHomeDirectory() + subdirectory; } - ASSERT_MSG(!user_dir.empty(), "User directory %s musn’t be empty.", envvar.c_str()); - ASSERT_MSG(user_dir[0] == '/', "User directory %s must be absolute.", envvar.c_str()); + ASSERT_MSG(!user_dir.empty(), "User directory {} musn’t be empty.", envvar); + ASSERT_MSG(user_dir[0] == '/', "User directory {} must be absolute.", envvar); return user_dir; } diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index f62cac155..62c439739 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -74,9 +74,9 @@ EventType* RegisterEvent(const std::string& name, TimedCallback callback) { // check for existing type with same name. // we want event type names to remain unique so that we can use them for serialization. ASSERT_MSG(event_types.find(name) == event_types.end(), - "CoreTiming Event \"%s\" is already registered. Events should only be registered " + "CoreTiming Event \"{}\" is already registered. Events should only be registered " "during Init to avoid breaking save states.", - name.c_str()); + name); auto info = event_types.emplace(name, EventType{callback, nullptr}); EventType* event_type = &info.first->second; diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index 3e115f113..d644a43d3 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -82,7 +82,7 @@ std::shared_ptr Applet::Get(Service::APT::AppletId id) { static void AppletUpdateEvent(u64 applet_id, int cycles_late) { Service::APT::AppletId id = static_cast(applet_id); std::shared_ptr applet = Applet::Get(id); - ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", static_cast(id)); + ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id={:#X}", static_cast(id)); applet->Update(); diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index dc6c7bf7d..bbe97b7f9 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -32,7 +32,7 @@ public: } void ValidateHeader() { - DEBUG_ASSERT_MSG(index == TotalSize(), "Operations do not match the header (cmd 0x%x)", + DEBUG_ASSERT_MSG(index == TotalSize(), "Operations do not match the header (cmd {:#x})", header.raw); } diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 8240324bd..5f5885ad1 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -154,7 +154,7 @@ ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(const u32_le* sr break; } default: - UNIMPLEMENTED_MSG("Unsupported handle translation: 0x%08X", descriptor); + UNIMPLEMENTED_MSG("Unsupported handle translation: {:#X}", descriptor); } } @@ -218,7 +218,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf, P break; } default: - UNIMPLEMENTED_MSG("Unsupported handle translation: 0x%08X", descriptor); + UNIMPLEMENTED_MSG("Unsupported handle translation: {:#X}", descriptor); } } diff --git a/src/core/hle/kernel/ipc.cpp b/src/core/hle/kernel/ipc.cpp index 0907b105c..fe3943c66 100644 --- a/src/core/hle/kernel/ipc.cpp +++ b/src/core/hle/kernel/ipc.cpp @@ -199,7 +199,7 @@ ResultCode TranslateCommandBuffer(SharedPtr src_thread, SharedPtr process = thread->owner_process; - ASSERT_MSG(process != nullptr, "Invalid parent process for thread=0x%08X", thread_handle); + ASSERT_MSG(process != nullptr, "Invalid parent process for thread={:#X}", thread_handle); *process_id = process->process_id; return RESULT_SUCCESS; diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index b86ca6cf8..674eb5b42 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -242,11 +242,11 @@ void Thread::ResumeFromWait() { return; case THREADSTATUS_RUNNING: - DEBUG_ASSERT_MSG(false, "Thread with object id %u has already resumed.", GetObjectId()); + DEBUG_ASSERT_MSG(false, "Thread with object id {} has already resumed.", GetObjectId()); return; case THREADSTATUS_DEAD: // This should never happen, as threads must complete before being stopped. - DEBUG_ASSERT_MSG(false, "Thread with object id %u cannot be resumed because it's DEAD.", + DEBUG_ASSERT_MSG(false, "Thread with object id {} cannot be resumed because it's DEAD.", GetObjectId()); return; } diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index c886d4f61..a3c62b174 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -276,8 +276,8 @@ VMManager::VMAIter VMManager::StripIterConstness(const VMAHandle& iter) { } ResultVal VMManager::CarveVMA(VAddr base, u32 size) { - ASSERT_MSG((size & Memory::PAGE_MASK) == 0, "non-page aligned size: 0x%8X", size); - ASSERT_MSG((base & Memory::PAGE_MASK) == 0, "non-page aligned base: 0x%08X", base); + ASSERT_MSG((size & Memory::PAGE_MASK) == 0, "non-page aligned size: {:#8X}", size); + ASSERT_MSG((base & Memory::PAGE_MASK) == 0, "non-page aligned base: {:#010X}", base); VMAIter vma_handle = StripIterConstness(FindVMA(base)); if (vma_handle == vma_map.end()) { @@ -312,8 +312,8 @@ ResultVal VMManager::CarveVMA(VAddr base, u32 size) { } ResultVal VMManager::CarveVMARange(VAddr target, u32 size) { - ASSERT_MSG((size & Memory::PAGE_MASK) == 0, "non-page aligned size: 0x%8X", size); - ASSERT_MSG((target & Memory::PAGE_MASK) == 0, "non-page aligned base: 0x%08X", target); + ASSERT_MSG((size & Memory::PAGE_MASK) == 0, "non-page aligned size: {:#8X}", size); + ASSERT_MSG((target & Memory::PAGE_MASK) == 0, "non-page aligned base: {:#010X}", target); VAddr target_end = target + size; ASSERT(target_end >= target); diff --git a/src/core/hle/service/apt/applet_manager.cpp b/src/core/hle/service/apt/applet_manager.cpp index fafd73bb4..c31b49d8b 100644 --- a/src/core/hle/service/apt/applet_manager.cpp +++ b/src/core/hle/service/apt/applet_manager.cpp @@ -77,7 +77,7 @@ static u64 GetTitleIdForApplet(AppletId id) { return data.applet_ids[0] == id || data.applet_ids[1] == id; }); - ASSERT_MSG(itr != applet_titleids.end(), "Unknown applet id 0x%03X", static_cast(id)); + ASSERT_MSG(itr != applet_titleids.end(), "Unknown applet id 0x{:#05X}", static_cast(id)); return itr->title_ids[CFG::GetCurrentModule()->GetRegionValue()]; } diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 28f358b4b..a7a7513c0 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -653,7 +653,7 @@ void Module::Interface::Wrap(Kernel::HLERequestContext& ctx) { // Note: real 3DS still returns SUCCESS when the sizes don't match. It seems that it doesn't // check the buffer size and writes data with potential overflow. ASSERT_MSG(output_size == input_size + HW::AES::CCM_MAC_SIZE, - "input_size (%d) doesn't match to output_size (%d)", input_size, output_size); + "input_size ({}) doesn't match to output_size ({})", input_size, output_size); LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u", output_size, input_size, nonce_offset, nonce_size); @@ -698,7 +698,7 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { // Note: real 3DS still returns SUCCESS when the sizes don't match. It seems that it doesn't // check the buffer size and writes data with potential overflow. ASSERT_MSG(output_size == input_size - HW::AES::CCM_MAC_SIZE, - "input_size (%d) doesn't match to output_size (%d)", input_size, output_size); + "input_size ({}) doesn't match to output_size ({})", input_size, output_size); LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u", output_size, input_size, nonce_offset, nonce_size); diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index d5ea97986..bab845ce4 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -51,7 +51,7 @@ public: } } - UNREACHABLE_MSG("Invalid interrupt type = %zu", static_cast(type)); + UNREACHABLE_MSG("Invalid interrupt type = {}", static_cast(type)); } bool HasTooManyEventsRegistered() const { @@ -219,7 +219,7 @@ static void RegisterInterruptEvents(Service::Interface* self) { u32 event_handle = cmd_buff[4]; ASSERT_MSG(type_index < NUM_INTERRUPT_TYPE && pipe_index < AudioCore::num_dsp_pipe, - "Invalid type or pipe: type = %u, pipe = %u", type_index, pipe_index); + "Invalid type or pipe: type = {}, pipe = {}", type_index, pipe_index); InterruptType type = static_cast(cmd_buff[1]); DspPipe pipe = static_cast(cmd_buff[2]); @@ -305,7 +305,7 @@ static void WriteProcessPipe(Service::Interface* self) { } ASSERT_MSG(Memory::IsValidVirtualAddress(buffer), - "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe_index, size, buffer); + "Invalid Buffer: pipe={}, size={:#X}, buffer={:#010X}", pipe_index, size, buffer); std::vector message(size); for (u32 i = 0; i < size; i++) { @@ -363,8 +363,8 @@ static void ReadPipeIfPossible(Service::Interface* self) { AudioCore::DspPipe pipe = static_cast(pipe_index); ASSERT_MSG(Memory::IsValidVirtualAddress(addr), - "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe_index, - unknown, size, addr); + "Invalid addr: pipe={:#010X}, unknown={:#010X}, size={:#X}, buffer={:#010X}", + pipe_index, unknown, size, addr); cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2); cmd_buff[1] = RESULT_SUCCESS.raw; // No error @@ -407,8 +407,8 @@ static void ReadPipe(Service::Interface* self) { AudioCore::DspPipe pipe = static_cast(pipe_index); ASSERT_MSG(Memory::IsValidVirtualAddress(addr), - "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe_index, - unknown, size, addr); + "Invalid addr: pipe={:#010X}, unknown={:#010X}, size={:#X}, buffer={:#010X}", + pipe_index, unknown, size, addr); if (Core::DSP().GetPipeReadableSize(pipe) >= size) { std::vector response = Core::DSP().PipeRead(pipe, size); @@ -508,7 +508,7 @@ static void RecvData(Service::Interface* self) { u32 register_number = cmd_buff[1]; - ASSERT_MSG(register_number == 0, "Unknown register_number %u", register_number); + ASSERT_MSG(register_number == 0, "Unknown register_number {}", register_number); // Application reads this after requesting DSP shutdown, to verify the DSP has indeed shutdown // or slept. @@ -547,7 +547,7 @@ static void RecvDataIsReady(Service::Interface* self) { u32 register_number = cmd_buff[1]; - ASSERT_MSG(register_number == 0, "Unknown register_number %u", register_number); + ASSERT_MSG(register_number == 0, "Unknown register_number {}", register_number); cmd_buff[0] = IPC::MakeHeader(0x2, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; diff --git a/src/core/hle/service/sm/srv.cpp b/src/core/hle/service/sm/srv.cpp index b669aa8a9..4a440c55e 100644 --- a/src/core/hle/service/sm/srv.cpp +++ b/src/core/hle/service/sm/srv.cpp @@ -118,7 +118,7 @@ void SRV::GetServiceHandle(Kernel::HLERequestContext& ctx) { } else if (session.Code() == Kernel::ERR_MAX_CONNECTIONS_REACHED && wait_until_available) { LOG_WARNING(Service_SRV, "called service=%s -> ERR_MAX_CONNECTIONS_REACHED", name.c_str()); // TODO(Subv): Put the caller guest thread to sleep until this port becomes available again. - UNIMPLEMENTED_MSG("Unimplemented wait until port %s is available.", name.c_str()); + UNIMPLEMENTED_MSG("Unimplemented wait until port {} is available.", name); } else { LOG_ERROR(Service_SRV, "called service=%s -> error 0x%08X", name.c_str(), session.Code().raw); diff --git a/src/core/memory.cpp b/src/core/memory.cpp index ca917307a..64e6fbb93 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -46,7 +46,7 @@ static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, Page u32 end = base + size; while (base != end) { - ASSERT_MSG(base < PAGE_TABLE_NUM_ENTRIES, "out of range mapping at %08X", base); + ASSERT_MSG(base < PAGE_TABLE_NUM_ENTRIES, "out of range mapping at {:#010X}", base); page_table.attributes[base] = type; page_table.pointers[base] = memory; @@ -58,22 +58,22 @@ static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, Page } void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target) { - ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size); - ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base); + ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:#010X}", size); + ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:#010X}", base); MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, PageType::Memory); } void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer mmio_handler) { - ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size); - ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base); + ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:#010X}", size); + ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:#010X}", base); MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Special); page_table.special_regions.emplace_back(SpecialRegion{base, size, mmio_handler}); } void UnmapRegion(PageTable& page_table, VAddr base, u32 size) { - ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size); - ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base); + ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:#010X}", size); + ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:#010X}", base); MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Unmapped); } @@ -123,7 +123,7 @@ static MMIORegionPointer GetMMIOHandler(const PageTable& page_table, VAddr vaddr return region.handler; } } - ASSERT_MSG(false, "Mapped IO page without a handler @ %08X", vaddr); + ASSERT_MSG(false, "Mapped IO page without a handler @ {:08X}", vaddr); return nullptr; // Should never happen } @@ -154,7 +154,7 @@ T Read(const VAddr vaddr) { LOG_ERROR(HW_Memory, "unmapped Read%lu @ 0x%08X", sizeof(T) * 8, vaddr); return 0; case PageType::Memory: - ASSERT_MSG(false, "Mapped memory page without a pointer @ %08X", vaddr); + ASSERT_MSG(false, "Mapped memory page without a pointer @ {:08X}", vaddr); break; case PageType::RasterizerCachedMemory: { RasterizerFlushVirtualRegion(vaddr, sizeof(T), FlushMode::Flush); @@ -192,7 +192,7 @@ void Write(const VAddr vaddr, const T data) { vaddr); return; case PageType::Memory: - ASSERT_MSG(false, "Mapped memory page without a pointer @ %08X", vaddr); + ASSERT_MSG(false, "Mapped memory page without a pointer @ {:08X}", vaddr); break; case PageType::RasterizerCachedMemory: { RasterizerFlushVirtualRegion(vaddr, sizeof(T), FlushMode::Invalidate); diff --git a/src/video_core/regs_framebuffer.h b/src/video_core/regs_framebuffer.h index 8020faee8..cfddd629c 100644 --- a/src/video_core/regs_framebuffer.h +++ b/src/video_core/regs_framebuffer.h @@ -258,7 +258,7 @@ struct FramebufferRegs { return 4; } - ASSERT_MSG(false, "Unknown depth format %u", static_cast(format)); + ASSERT_MSG(false, "Unknown depth format {}", static_cast(format)); } // Returns the number of bits per depth component of the specified depth format @@ -271,7 +271,7 @@ struct FramebufferRegs { return 24; } - ASSERT_MSG(false, "Unknown depth format %u", static_cast(format)); + ASSERT_MSG(false, "Unknown depth format {}", static_cast(format)); } INSERT_PADDING_WORDS(0x20); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 612540d25..521e07641 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1281,7 +1281,7 @@ void RasterizerOpenGL::SetShader() { glGetActiveUniformBlockiv(current_shader->shader.handle, block_index, GL_UNIFORM_BLOCK_DATA_SIZE, &block_size); ASSERT_MSG(block_size == sizeof(UniformData), - "Uniform block size did not match! Got %d, expected %zu", + "Uniform block size did not match! Got {}, expected {}", static_cast(block_size), sizeof(UniformData)); glUniformBlockBinding(current_shader->shader.handle, block_index, 0); diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 443923eae..54331b453 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -30,7 +30,7 @@ void OutputVertex::ValidateSemantics(const RasterizerRegs& regs) { for (size_t comp = 0; comp < 4; ++comp) { u32 semantic = (output_register_map >> (8 * comp)) & 0x1F; ASSERT_MSG(semantic < 24 || semantic == RasterizerRegs::VSOutputAttributes::INVALID, - "Invalid/unknown semantic id: %" PRIu32, semantic); + "Invalid/unknown semantic id: {}", semantic); } } }