From 3c9cebea6e4a449f24b54acac1b20baf72a800e2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 25 Feb 2021 11:32:35 +0100 Subject: [PATCH] Kernel: Fix some clang-tidy whines in CoreDump --- Kernel/CoreDump.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/CoreDump.cpp b/Kernel/CoreDump.cpp index c1fd3f55d10..56312a1bc08 100644 --- a/Kernel/CoreDump.cpp +++ b/Kernel/CoreDump.cpp @@ -69,7 +69,7 @@ CoreDump::~CoreDump() RefPtr CoreDump::create_target_file(const Process& process, const String& output_path) { LexicalPath lexical_path(output_path); - auto output_directory = lexical_path.dirname(); + const auto& output_directory = lexical_path.dirname(); auto dump_directory = VFS::the().open_directory(output_directory, VFS::the().root_custody()); if (dump_directory.is_error()) { dbgln("Can't find directory '{}' for core dump", output_directory); @@ -141,7 +141,7 @@ KResult CoreDump::write_program_headers(size_t notes_size) phdr.p_type = PT_LOAD; phdr.p_offset = offset; - phdr.p_vaddr = reinterpret_cast(region.vaddr().as_ptr()); + phdr.p_vaddr = region.vaddr().get(); phdr.p_paddr = 0; phdr.p_filesz = region.page_count() * PAGE_SIZE; @@ -264,8 +264,8 @@ ByteBuffer CoreDump::create_notes_regions_data() const info.header.type = ELF::Core::NotesEntryHeader::Type::MemoryRegionInfo; auto& region = m_process->space().regions()[region_index]; - info.region_start = reinterpret_cast(region.vaddr().as_ptr()); - info.region_end = reinterpret_cast(region.vaddr().as_ptr() + region.size()); + info.region_start = region.vaddr().get(); + info.region_end = region.vaddr().offset(region.size()).get(); info.program_header_index = region_index; memory_region_info_buffer.append((void*)&info, sizeof(info));