From 7b9df8bec5038e0316540d2397df632fb14c9169 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 29 Oct 2025 17:01:22 +0100 Subject: chore: configure clang-tidy --- kapi/include/kapi/cio.hpp | 3 +++ kapi/include/kapi/memory/address.hpp | 2 +- kapi/include/kapi/memory/frame.hpp | 4 +--- kapi/include/kapi/memory/frame_allocator.hpp | 2 ++ kapi/src/cio.cpp | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) (limited to 'kapi') diff --git a/kapi/include/kapi/cio.hpp b/kapi/include/kapi/cio.hpp index 6b93638..a01af08 100644 --- a/kapi/include/kapi/cio.hpp +++ b/kapi/include/kapi/cio.hpp @@ -6,8 +6,11 @@ namespace teachos::cio { + // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) struct output_device { + virtual ~output_device() = default; + auto virtual write(std::string_view text [[maybe_unused]]) -> void {} auto virtual writeln(std::string_view text [[maybe_unused]]) -> void {} diff --git a/kapi/include/kapi/memory/address.hpp b/kapi/include/kapi/memory/address.hpp index 63301aa..359b5ec 100644 --- a/kapi/include/kapi/memory/address.hpp +++ b/kapi/include/kapi/memory/address.hpp @@ -34,7 +34,7 @@ namespace teachos::memory constexpr auto operator<=>(address const &) const noexcept -> std::strong_ordering = default; constexpr auto operator==(address const &) const noexcept -> bool = default; - constexpr auto raw() const noexcept -> std::uintptr_t + [[nodiscard]] constexpr auto raw() const noexcept -> std::uintptr_t { return m_value; } diff --git a/kapi/include/kapi/memory/frame.hpp b/kapi/include/kapi/memory/frame.hpp index a208f28..63b1e70 100644 --- a/kapi/include/kapi/memory/frame.hpp +++ b/kapi/include/kapi/memory/frame.hpp @@ -3,10 +3,8 @@ #include "kapi/memory/address.hpp" -#include #include #include -#include namespace teachos::memory { @@ -37,7 +35,7 @@ namespace teachos::memory * * @return Start address of the physical frame. */ - constexpr auto start_address() const noexcept -> physical_address + [[nodiscard]] constexpr auto start_address() const noexcept -> physical_address { return physical_address{m_number * PLATFORM_FRAME_SIZE}; } diff --git a/kapi/include/kapi/memory/frame_allocator.hpp b/kapi/include/kapi/memory/frame_allocator.hpp index f9393ee..22102a6 100644 --- a/kapi/include/kapi/memory/frame_allocator.hpp +++ b/kapi/include/kapi/memory/frame_allocator.hpp @@ -8,8 +8,10 @@ namespace teachos::memory { + // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) struct frame_allocator { + virtual ~frame_allocator() = default; virtual auto allocate() -> std::optional = 0; virtual auto release(frame frame) -> void = 0; }; diff --git a/kapi/src/cio.cpp b/kapi/src/cio.cpp index e8490e9..210e58e 100644 --- a/kapi/src/cio.cpp +++ b/kapi/src/cio.cpp @@ -5,8 +5,9 @@ namespace teachos::cio { + // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) auto constinit null_device = output_device{}; - + // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) auto constinit active_device = &null_device; auto set_output_device(output_device & device) -> std::optional -- cgit v1.2.3