From b157e2c472d8bd67ac1656404a6a6ee821260f4b Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 29 Oct 2025 15:01:43 +0100 Subject: chore: reformat source code --- kapi/include/kapi/memory/address.hpp | 18 +++++++++++------- kapi/include/kapi/memory/frame.hpp | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'kapi/include') diff --git a/kapi/include/kapi/memory/address.hpp b/kapi/include/kapi/memory/address.hpp index 585807a..63301aa 100644 --- a/kapi/include/kapi/memory/address.hpp +++ b/kapi/include/kapi/memory/address.hpp @@ -20,20 +20,24 @@ namespace teachos::memory { constexpr explicit address(std::uintptr_t value) noexcept : m_value{value} - { - } + {} explicit address(std::byte * pointer) noexcept : m_value{std::bit_cast(pointer)} + {} + + explicit operator std::byte *() const noexcept { + return std::bit_cast(m_value); } - explicit operator std::byte *() const noexcept { return std::bit_cast(m_value); } + constexpr auto operator<=>(address const &) const noexcept -> std::strong_ordering = default; + constexpr auto operator==(address const &) const noexcept -> bool = default; - auto constexpr operator<=>(address const &) const noexcept -> std::strong_ordering = default; - auto constexpr operator==(address const &) const noexcept -> bool = default; - - auto constexpr raw() const noexcept -> std::uintptr_t { return m_value; } + constexpr auto raw() const noexcept -> std::uintptr_t + { + return m_value; + } private: std::uintptr_t m_value{}; diff --git a/kapi/include/kapi/memory/frame.hpp b/kapi/include/kapi/memory/frame.hpp index 8bcf79f..a208f28 100644 --- a/kapi/include/kapi/memory/frame.hpp +++ b/kapi/include/kapi/memory/frame.hpp @@ -19,8 +19,7 @@ namespace teachos::memory explicit constexpr frame(std::size_t number) : m_number{number} - { - } + {} /** * @brief Returns the physical frame the given address is contained in. @@ -28,7 +27,7 @@ namespace teachos::memory * @param address Physical address we want to get the corresponding physical frame for. * @return Frame the given address is contained in. */ - auto constexpr static containing(physical_address address) noexcept -> frame + constexpr auto static containing(physical_address address) noexcept -> frame { return frame{address.raw() / PLATFORM_FRAME_SIZE}; } @@ -38,7 +37,7 @@ namespace teachos::memory * * @return Start address of the physical frame. */ - auto constexpr start_address() const noexcept -> physical_address + constexpr auto start_address() const noexcept -> physical_address { return physical_address{m_number * PLATFORM_FRAME_SIZE}; } @@ -49,14 +48,17 @@ namespace teachos::memory * @param offset * @return A new frame n frames after this one. */ - auto constexpr operator+(std::size_t n) const noexcept -> frame { return frame{m_number + n}; } + constexpr auto operator+(std::size_t n) const noexcept -> frame + { + return frame{m_number + n}; + } /** * @brief Increment this frame to refer to the next one, returning a copy. * * @return Copy of the incremented underlying frame number. */ - auto constexpr operator++(int) noexcept -> frame + constexpr auto operator++(int) noexcept -> frame { auto copy = *this; ++*this; @@ -68,7 +70,7 @@ namespace teachos::memory * * @return Reference to the incremented underlying frame number. */ - auto constexpr operator++() noexcept -> frame & + constexpr auto operator++() noexcept -> frame & { ++m_number; return *this; @@ -77,12 +79,12 @@ namespace teachos::memory /** * @brief Check if this frame refers to the same frame as @p other. */ - auto constexpr operator==(frame const & other) const noexcept -> bool = default; + constexpr auto operator==(frame const & other) const noexcept -> bool = default; /** * @brief Lexicographically compare this frame to @p other. */ - auto constexpr operator<=>(frame const & other) const noexcept -> std::strong_ordering = default; + constexpr auto operator<=>(frame const & other) const noexcept -> std::strong_ordering = default; private: std::size_t m_number{}; -- cgit v1.2.3