aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
Diffstat (limited to 'kapi')
-rw-r--r--kapi/include/kapi/cio.hpp3
-rw-r--r--kapi/include/kapi/memory/address.hpp2
-rw-r--r--kapi/include/kapi/memory/frame.hpp4
-rw-r--r--kapi/include/kapi/memory/frame_allocator.hpp2
-rw-r--r--kapi/src/cio.cpp3
5 files changed, 9 insertions, 5 deletions
diff --git a/kapi/include/kapi/cio.hpp b/kapi/include/kapi/cio.hpp
index 6b936389..a01af083 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 63301aad..359b5eca 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 a208f284..63b1e708 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 f9393eee..22102a64 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 e8490e9d..210e58e8 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 *>