aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-12-22 14:53:33 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-12-22 14:53:33 +0100
commitb4ff67c8a9bebd99eb3c06ea141fe0f1b8feb5a4 (patch)
tree3730f8ea9c880d97e3a63426fac9939976c39921 /libs
parent5c01134b95fc83b485720c3d06ef0284e4ba8568 (diff)
downloadteachos-b4ff67c8a9bebd99eb3c06ea141fe0f1b8feb5a4.tar.xz
teachos-b4ff67c8a9bebd99eb3c06ea141fe0f1b8feb5a4.zip
chore: clean up linter warnings
Diffstat (limited to 'libs')
-rw-r--r--libs/kstd/include/kstd/asm_ptr1
-rw-r--r--libs/kstd/include/kstd/bits/formatter.hpp1
-rw-r--r--libs/kstd/include/kstd/bits/shared_ptr.hpp5
-rw-r--r--libs/kstd/include/kstd/stack1
-rw-r--r--libs/kstd/include/kstd/vector17
-rw-r--r--libs/multiboot2/include/multiboot2/impl/tag.hpp3
6 files changed, 15 insertions, 13 deletions
diff --git a/libs/kstd/include/kstd/asm_ptr b/libs/kstd/include/kstd/asm_ptr
index e8636c3..c06a8b5 100644
--- a/libs/kstd/include/kstd/asm_ptr
+++ b/libs/kstd/include/kstd/asm_ptr
@@ -2,6 +2,7 @@
#define KSTD_ASM_POINTER_HPP
#include <bit>
+#include <cstddef>
namespace kstd
{
diff --git a/libs/kstd/include/kstd/bits/formatter.hpp b/libs/kstd/include/kstd/bits/formatter.hpp
index 4d983f3..eadc0ef 100644
--- a/libs/kstd/include/kstd/bits/formatter.hpp
+++ b/libs/kstd/include/kstd/bits/formatter.hpp
@@ -278,7 +278,6 @@ namespace kstd
{
if (index >= m_number_of_args)
return {.value = nullptr, .format = nullptr};
- // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
return m_args[index];
}
diff --git a/libs/kstd/include/kstd/bits/shared_ptr.hpp b/libs/kstd/include/kstd/bits/shared_ptr.hpp
index 4bcf499..8caae3b 100644
--- a/libs/kstd/include/kstd/bits/shared_ptr.hpp
+++ b/libs/kstd/include/kstd/bits/shared_ptr.hpp
@@ -2,6 +2,7 @@
#define KSTD_BITS_SHARED_PTR_HPP
#include <atomic>
+#include <cstddef>
namespace kstd
{
@@ -72,7 +73,7 @@ namespace kstd
* @return Reference to this shared pointer.
*/
[[gnu::section(".stl_text")]]
- shared_ptr & operator=(shared_ptr const & other)
+ auto operator=(shared_ptr const & other) -> shared_ptr &
{
if (this != &other)
{
@@ -97,7 +98,7 @@ namespace kstd
* @return Reference to this shared pointer.
*/
[[gnu::section(".stl_text")]]
- shared_ptr & operator=(shared_ptr && other) noexcept
+ auto operator=(shared_ptr && other) noexcept -> shared_ptr &
{
if (this != &other)
{
diff --git a/libs/kstd/include/kstd/stack b/libs/kstd/include/kstd/stack
index 8cd208a..8dc8e10 100644
--- a/libs/kstd/include/kstd/stack
+++ b/libs/kstd/include/kstd/stack
@@ -2,6 +2,7 @@
#define KSTD_STACK_HPP
#include "kstd/vector"
+#include <initializer_list>
#include <utility>
namespace kstd
diff --git a/libs/kstd/include/kstd/vector b/libs/kstd/include/kstd/vector
index 9d96eb8..bbb2287 100644
--- a/libs/kstd/include/kstd/vector
+++ b/libs/kstd/include/kstd/vector
@@ -1,9 +1,11 @@
#ifndef KSTD_VECTOR_HPP
#define KSTD_VECTOR_HPP
-#include "bits/os.hpp"
+#include <kstd/os/error.hpp>
#include <algorithm>
+#include <cstddef>
+#include <initializer_list>
namespace kstd
{
@@ -62,14 +64,14 @@ namespace kstd
/**
* @brief Construct data by copying all elements from the initializer list.
*
- * @param initalizer_list List we want to copy all elements from.
+ * @param initializer_list List we want to copy all elements from.
*/
- explicit vector(std::initializer_list<value_type> initalizer_list)
- : _size(initalizer_list.size())
- , _capacity(initalizer_list.size())
+ explicit vector(std::initializer_list<value_type> initializer_list)
+ : _size(initializer_list.size())
+ , _capacity(initializer_list.size())
, _data(new value_type[_capacity]{})
{
- std::ranges::copy(initalizer_list, _data);
+ std::ranges::copy(initializer_list, _data);
}
/**
@@ -83,9 +85,8 @@ namespace kstd
vector(vector<value_type> const & other)
: _size(other._size)
, _capacity(other._capacity)
+ , _data(new value_type[_capacity]{})
{
- delete[] _data;
- _data = new value_type[_capacity]{};
std::ranges::copy(other, _data);
}
diff --git a/libs/multiboot2/include/multiboot2/impl/tag.hpp b/libs/multiboot2/include/multiboot2/impl/tag.hpp
index 3d0cea5..708cda4 100644
--- a/libs/multiboot2/include/multiboot2/impl/tag.hpp
+++ b/libs/multiboot2/include/multiboot2/impl/tag.hpp
@@ -29,7 +29,6 @@ namespace multiboot2::impl
[[nodiscard]] auto full_size() const noexcept -> std::size_t
{
- // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
return (m_size + 7) & (~7);
}
@@ -67,7 +66,7 @@ namespace multiboot2::impl
explicit tag(tag_header const * header)
requires(sizeof(tag) > sizeof(tag_header))
: tag_header{header}
- , Data{*std::bit_cast<Data const *>(header + 1)} // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+ , Data{*std::bit_cast<Data const *>(header + 1)}
{}
explicit tag(tag_header const * header)