diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-10-29 17:01:22 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-10-29 17:01:22 +0100 |
| commit | 7b9df8bec5038e0316540d2397df632fb14c9169 (patch) | |
| tree | 3b5959510cbfd336479b97413427a35972e6e305 /kapi | |
| parent | b157e2c472d8bd67ac1656404a6a6ee821260f4b (diff) | |
| download | teachos-7b9df8bec5038e0316540d2397df632fb14c9169.tar.xz teachos-7b9df8bec5038e0316540d2397df632fb14c9169.zip | |
chore: configure clang-tidy
Diffstat (limited to 'kapi')
| -rw-r--r-- | kapi/include/kapi/cio.hpp | 3 | ||||
| -rw-r--r-- | kapi/include/kapi/memory/address.hpp | 2 | ||||
| -rw-r--r-- | kapi/include/kapi/memory/frame.hpp | 4 | ||||
| -rw-r--r-- | kapi/include/kapi/memory/frame_allocator.hpp | 2 | ||||
| -rw-r--r-- | kapi/src/cio.cpp | 3 |
5 files changed, 9 insertions, 5 deletions
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 <bit> #include <compare> #include <cstddef> -#include <cstdint> 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<frame> = 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<output_device *> |
