mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	Merge pull request #3580 from daniellimws/common-fmt
common: Migrate logging macros
This commit is contained in:
		
						commit
						a9544ca015
					
				
					 24 changed files with 132 additions and 134 deletions
				
			
		|  | @ -82,7 +82,7 @@ std::shared_ptr<Applet> Applet::Get(Service::APT::AppletId id) { | |||
| static void AppletUpdateEvent(u64 applet_id, int cycles_late) { | ||||
|     Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id); | ||||
|     std::shared_ptr<Applet> applet = Applet::Get(id); | ||||
|     ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", static_cast<u32>(id)); | ||||
|     ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id={:08X}", static_cast<u32>(id)); | ||||
| 
 | ||||
|     applet->Update(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -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); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -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: {:#010X}", 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: {:#010X}", descriptor); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -199,7 +199,7 @@ ResultCode TranslateCommandBuffer(SharedPtr<Thread> src_thread, SharedPtr<Thread | |||
|             break; | ||||
|         } | ||||
|         default: | ||||
|             UNIMPLEMENTED_MSG("Unsupported handle translation: 0x%08X", descriptor); | ||||
|             UNIMPLEMENTED_MSG("Unsupported handle translation: {:#010X}", descriptor); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -751,7 +751,7 @@ static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point | |||
|         break; | ||||
|     default: | ||||
|         // TODO(bunnei): Implement support for other processor IDs
 | ||||
|         ASSERT_MSG(false, "Unsupported thread processor ID: %d", processor_id); | ||||
|         ASSERT_MSG(false, "Unsupported thread processor ID: {}", processor_id); | ||||
|         break; | ||||
|     } | ||||
| 
 | ||||
|  | @ -865,7 +865,7 @@ static ResultCode GetProcessIdOfThread(u32* process_id, Handle thread_handle) { | |||
| 
 | ||||
|     const SharedPtr<Process> 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={:#010X}", thread_handle); | ||||
| 
 | ||||
|     *process_id = process->process_id; | ||||
|     return RESULT_SUCCESS; | ||||
|  |  | |||
|  | @ -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; | ||||
|     } | ||||
|  |  | |||
|  | @ -276,8 +276,8 @@ VMManager::VMAIter VMManager::StripIterConstness(const VMAHandle& iter) { | |||
| } | ||||
| 
 | ||||
| ResultVal<VMManager::VMAIter> 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: {:#10X}", 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::VMAIter> VMManager::CarveVMA(VAddr base, u32 size) { | |||
| } | ||||
| 
 | ||||
| ResultVal<VMManager::VMAIter> 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: {:#10X}", size); | ||||
|     ASSERT_MSG((target & Memory::PAGE_MASK) == 0, "non-page aligned base: {:#010X}", target); | ||||
| 
 | ||||
|     VAddr target_end = target + size; | ||||
|     ASSERT(target_end >= target); | ||||
|  |  | |||
|  | @ -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<u32>(id)); | ||||
|     ASSERT_MSG(itr != applet_titleids.end(), "Unknown applet id 0x{:#05X}", static_cast<u32>(id)); | ||||
| 
 | ||||
|     return itr->title_ids[CFG::GetCurrentModule()->GetRegionValue()]; | ||||
| } | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
|  | @ -51,7 +51,7 @@ public: | |||
|         } | ||||
|         } | ||||
| 
 | ||||
|         UNREACHABLE_MSG("Invalid interrupt type = %zu", static_cast<size_t>(type)); | ||||
|         UNREACHABLE_MSG("Invalid interrupt type = {}", static_cast<size_t>(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<InterruptType>(cmd_buff[1]); | ||||
|     DspPipe pipe = static_cast<DspPipe>(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<u8> message(size); | ||||
|     for (u32 i = 0; i < size; i++) { | ||||
|  | @ -363,8 +363,8 @@ static void ReadPipeIfPossible(Service::Interface* self) { | |||
|     AudioCore::DspPipe pipe = static_cast<AudioCore::DspPipe>(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<AudioCore::DspPipe>(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<u8> 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; | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue