1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 00:17:45 +00:00

Kernel: Resolve clang-tidy readability-make-member-function-const

... In files included from Kernel/Thread.cpp or Kernel/Process.cpp

Some places the warning is suppressed, because we do not want a const
object do have non-const access to the returned sub-object.
This commit is contained in:
Andrew Kaster 2021-10-31 15:54:39 -06:00 committed by Andreas Kling
parent a92132e44a
commit 65edc62c02
11 changed files with 18 additions and 14 deletions

View file

@ -38,8 +38,9 @@ public:
[[nodiscard]] bool is_null() const { return m_address == 0; }
// NOLINTNEXTLINE(readability-make-member-function-const) const PhysicalAddress shouldn't be allowed to modify the underlying memory
[[nodiscard]] u8* as_ptr() { return reinterpret_cast<u8*>(m_address); }
[[nodiscard]] const u8* as_ptr() const { return reinterpret_cast<const u8*>(m_address); }
[[nodiscard]] const u8* as_ptr() const { return reinterpret_cast<u8 const*>(m_address); }
[[nodiscard]] PhysicalAddress page_base() const { return PhysicalAddress(physical_page_base(m_address)); }
[[nodiscard]] PhysicalPtr offset_in_page() const { return PhysicalAddress(m_address & 0xfff).get(); }