Everywhere: Fix incorrect uses of String::format and StringBuilder::appendf

These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
This commit is contained in:
Sahan Fernando 2021-01-12 01:35:55 +11:00 committed by Andreas Kling
parent fe2b8906d4
commit 9bf76a85c8
Notes: sideshowbarker 2024-07-18 23:55:51 +09:00
5 changed files with 6 additions and 6 deletions

View file

@ -280,7 +280,7 @@ void Parser::initialize_main_system_description_table()
#endif
for (u32 i = 0; i < ((length - sizeof(Structures::SDTHeader)) / sizeof(u64)); i++) {
#ifdef ACPI_DEBUG
dbg() << "ACPI: Found new table [" << i << "], @ V 0x" << String::format("%x", &xsdt.table_ptrs[i]) << " - P 0x" << String::format("%x", xsdt.table_ptrs[i]);
dbg() << "ACPI: Found new table [" << i << "], @ V " << String::format("%p", &xsdt.table_ptrs[i]) << " - P 0x" << String::format("%llx", xsdt.table_ptrs[i]);
#endif
m_sdt_pointers.append(PhysicalAddress(xsdt.table_ptrs[i]));
}
@ -293,7 +293,7 @@ void Parser::initialize_main_system_description_table()
#endif
for (u32 i = 0; i < ((length - sizeof(Structures::SDTHeader)) / sizeof(u32)); i++) {
#ifdef ACPI_DEBUG
dbg() << "ACPI: Found new table [" << i << "], @ V 0x" << String::format("%x", &rsdt.table_ptrs[i]) << " - P 0x" << String::format("%x", rsdt.table_ptrs[i]);
dbg() << "ACPI: Found new table [" << i << "], @ V " << String::format("%p", &rsdt.table_ptrs[i]) << " - P 0x" << String::format("%x", rsdt.table_ptrs[i]);
#endif
m_sdt_pointers.append(PhysicalAddress(rsdt.table_ptrs[i]));
}

View file

@ -805,7 +805,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
u32 ret_eflags = state.eflags;
#ifdef SIGNAL_DEBUG
klog() << "signal: setting up user stack to return to eip: " << String::format("%p", ret_eip) << " esp: " << String::format("%p", old_esp);
klog() << "signal: setting up user stack to return to eip: " << String::format("%p", (void*)ret_eip) << " esp: " << String::format("%p", (void*)old_esp);
#endif
// Align the stack to 16 bytes.

View file

@ -160,7 +160,7 @@ void MemoryManager::parse_memory_map()
}
#ifdef MM_DEBUG
klog() << "MM: considering memory at " << String::format("%p", (FlatPtr)mmap->addr) << " - " << String::format("%p", (FlatPtr)(mmap->addr + mmap->len));
klog() << "MM: considering memory at " << String::format("%p", (void*)mmap->addr) << " - " << String::format("%p", (void*)(mmap->addr + mmap->len));
#endif
for (size_t page_base = mmap->addr; page_base <= (mmap->addr + mmap->len); page_base += PAGE_SIZE) {

View file

@ -384,7 +384,7 @@ void Region::unmap(ShouldDeallocateVirtualMemoryRange deallocate_range)
MM.release_pte(*m_page_directory, vaddr, i == count - 1);
#ifdef MM_DEBUG
auto* page = physical_page(i);
dbg() << "MM: >> Unmapped " << vaddr << " => P" << String::format("%p", page ? page->paddr().get() : 0) << " <<";
dbg() << "MM: >> Unmapped " << vaddr << " => P" << String::format("%p", (void*)(page ? page->paddr().get() : 0)) << " <<";
#endif
}
MM.flush_tlb(m_page_directory, vaddr(), page_count());

View file

@ -232,7 +232,7 @@ static Optional<size_t> read_huffman_bits(HuffmanStreamState& hstream, size_t co
{
if (count > (8 * sizeof(size_t))) {
#ifdef JPG_DEBUG
dbg() << String::format("Can't read %i bits at once!", count);
dbg() << String::format("Can't read %zu bits at once!", count);
#endif
return {};
}