aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/arch/cpu/interrupts.cpp7
-rw-r--r--arch/x86_64/arch/memory/region_allocator.cpp3
-rw-r--r--arch/x86_64/kapi/memory.cpp2
-rw-r--r--libs/kstd/kstd/bits/basic_string.hpp16
-rw-r--r--libs/kstd/kstd/bits/format/error.hpp6
-rw-r--r--libs/kstd/kstd/bits/format/formatter.hpp6
-rw-r--r--libs/kstd/kstd/vector.hpp12
7 files changed, 29 insertions, 23 deletions
diff --git a/arch/x86_64/arch/cpu/interrupts.cpp b/arch/x86_64/arch/cpu/interrupts.cpp
index c825e8ab..2fdc4671 100644
--- a/arch/x86_64/arch/cpu/interrupts.cpp
+++ b/arch/x86_64/arch/cpu/interrupts.cpp
@@ -50,7 +50,7 @@ namespace arch::cpu
constexpr auto pic_master_irq_end = pic_master_irq_start + 8;
constexpr auto pic_slave_irq_start = pic_master_irq_end;
- constexpr auto to_exception_type(exception e)
+ constexpr auto to_exception_type(exception e) -> enum kapi::cpu::exception::type
{
switch (e)
{
@@ -75,7 +75,7 @@ namespace arch::cpu
}
}
- constexpr auto has_error_code(exception e)
+ constexpr auto has_error_code(exception e) -> bool
{
switch (e)
{
@@ -155,8 +155,7 @@ namespace arch::cpu
if (kapi::interrupts::dispatch(irq_number) == kapi::interrupts::status::unhandled)
{
- kstd::println(kstd::print_sink::stderr, "[ARCH:CPU] Unhandled interrupt {:#04x} (IRQ{})", number,
- irq_number);
+ kstd::println(kstd::print_sink::stderr, "[ARCH:CPU] Unhandled interrupt {:#04x} (IRQ{})", number, irq_number);
}
acknowledge_pic_interrupt(frame);
diff --git a/arch/x86_64/arch/memory/region_allocator.cpp b/arch/x86_64/arch/memory/region_allocator.cpp
index ece492f3..b78924d8 100644
--- a/arch/x86_64/arch/memory/region_allocator.cpp
+++ b/arch/x86_64/arch/memory/region_allocator.cpp
@@ -15,12 +15,13 @@ namespace arch::memory
{
namespace
{
- constexpr auto last_frame(multiboot2::memory_map::region const & region)
+ constexpr auto last_frame(multiboot2::memory_map::region const & region) -> kapi::memory::frame
{
return kapi::memory::frame::containing(kapi::memory::physical_address{region.base + region.size_in_B - 1});
}
constexpr auto falls_within(kapi::memory::frame candidate, kapi::memory::frame start, kapi::memory::frame end)
+ -> bool
{
return candidate >= start && candidate <= end;
}
diff --git a/arch/x86_64/kapi/memory.cpp b/arch/x86_64/kapi/memory.cpp
index 9cf955e5..03c5107c 100644
--- a/arch/x86_64/kapi/memory.cpp
+++ b/arch/x86_64/kapi/memory.cpp
@@ -40,7 +40,7 @@ namespace kapi::memory
auto constinit higher_half_mapper = std::optional<arch::memory::higher_half_mapper>{};
//! Instantiate a basic, memory region based, early frame allocator for remapping.
- auto collect_memory_information()
+ auto collect_memory_information() -> arch::memory::region_allocator::memory_information
{
auto memory_map = boot::bootstrap_information.mbi->maybe_memory_map();
if (!memory_map)
diff --git a/libs/kstd/kstd/bits/basic_string.hpp b/libs/kstd/kstd/bits/basic_string.hpp
index 1f8b60af..a2dd7f15 100644
--- a/libs/kstd/kstd/bits/basic_string.hpp
+++ b/libs/kstd/kstd/bits/basic_string.hpp
@@ -8,7 +8,6 @@
#include <algorithm>
#include <array>
-#include <compare>
#include <cstddef>
#include <functional>
#include <initializer_list>
@@ -1329,23 +1328,27 @@ namespace kstd
}
[[nodiscard]] constexpr friend auto operator<=>(basic_string const & lhs, basic_string const & rhs) noexcept
+ -> traits_type::comparison_category
{
return std::lexicographical_compare_three_way(std::cbegin(lhs), std::cend(lhs), std::cbegin(rhs), std::cend(rhs));
}
[[nodiscard]] constexpr friend auto
operator<=>(basic_string const & lhs, std::basic_string_view<value_type, traits_type> const & rhs) noexcept
+ -> traits_type::comparison_category
{
return std::lexicographical_compare_three_way(std::cbegin(lhs), std::cend(lhs), std::cbegin(rhs), std::cend(rhs));
}
[[nodiscard]] constexpr friend auto operator<=>(std::basic_string_view<value_type, traits_type> const & lhs,
- basic_string const & rhs) noexcept -> std::strong_ordering
+ basic_string const & rhs) noexcept
+ -> traits_type::comparison_category
{
return std::lexicographical_compare_three_way(std::cbegin(lhs), std::cend(lhs), std::cbegin(rhs), std::cend(rhs));
}
[[nodiscard]] constexpr friend auto operator<=>(basic_string const & lhs, const_pointer rhs) noexcept
+ -> traits_type::comparison_category
{
if (rhs == nullptr)
{
@@ -1356,6 +1359,7 @@ namespace kstd
}
[[nodiscard]] constexpr friend auto operator<=>(const_pointer lhs, basic_string const & rhs) noexcept
+ -> traits_type::comparison_category
{
if (rhs == nullptr)
{
@@ -1443,7 +1447,7 @@ namespace kstd
}
[[nodiscard]] constexpr auto static do_compare(std::basic_string_view<value_type, traits_type> lhs,
- std::basic_string_view<value_type, traits_type> rhs) noexcept
+ std::basic_string_view<value_type, traits_type> rhs) noexcept -> int
{
// clang-tidy is not smart enough to see that whe are, in essence, passing the correct length.
// NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
@@ -1466,7 +1470,7 @@ namespace kstd
//! Copy elements from a range described by an input iterator pair.
//!
//! @param first An iterator pointing to the first element to copy.
- //! @param last An iterator pointing beyond the last elemento copy.
+ //! @param last An iterator pointing beyond the last element to copy.
template<typename InputIterator, typename Sentinel>
requires std::input_iterator<std::remove_cvref_t<InputIterator>>
constexpr auto forward_from(InputIterator && first, Sentinel last) -> void
@@ -1496,7 +1500,7 @@ namespace kstd
//! Copy elements from a range described by a forward iterator pair.
//!
//! @param first An iterator pointing to the first element to copy.
- //! @param last An iterator pointing beyond the last elemento copy.
+ //! @param last An iterator pointing beyond the last element to copy.
template<typename ForwardIterator, typename Sentinel>
requires std::forward_iterator<std::remove_cvref_t<ForwardIterator>>
constexpr auto forward_from(ForwardIterator && first, Sentinel last) -> void
@@ -1551,7 +1555,7 @@ namespace kstd
//! Release the current buffer of this string.
//!
//! This function can be called even if this string is currently in tis SSO state.
- [[nodiscard]] constexpr auto release_buffer()
+ constexpr auto release_buffer() -> void
{
if (!in_sso_state())
{
diff --git a/libs/kstd/kstd/bits/format/error.hpp b/libs/kstd/kstd/bits/format/error.hpp
index 30cb7523..1442d2be 100644
--- a/libs/kstd/kstd/bits/format/error.hpp
+++ b/libs/kstd/kstd/bits/format/error.hpp
@@ -3,14 +3,16 @@
#include <kstd/os/error.hpp>
+#include <string_view>
+
namespace kstd::bits::format
{
- constexpr auto error(char const * message) -> void
+ constexpr auto error(std::string_view message) -> void
{
if consteval
{
- extern void compile_time_format_error_triggered(char const *);
+ extern auto compile_time_format_error_triggered(std::string_view)->void;
compile_time_format_error_triggered(message);
}
else
diff --git a/libs/kstd/kstd/bits/format/formatter.hpp b/libs/kstd/kstd/bits/format/formatter.hpp
index c26907b2..5f1d89c6 100644
--- a/libs/kstd/kstd/bits/format/formatter.hpp
+++ b/libs/kstd/kstd/bits/format/formatter.hpp
@@ -30,13 +30,13 @@ namespace kstd
m_separator = sep;
}
- constexpr auto set_brackets(std::string_view opening, std::string_view closing)
+ constexpr auto set_brackets(std::string_view opening, std::string_view closing) -> void
{
m_prefix = opening;
m_suffix = closing;
}
- constexpr auto parse(format_parse_context & context)
+ constexpr auto parse(format_parse_context & context) -> format_parse_context::iterator
{
auto it = context.begin();
auto const end = context.end();
@@ -63,7 +63,7 @@ namespace kstd
}
template<typename Range>
- auto format(Range const & range, format_context & context)
+ auto format(Range const & range, format_context & context) -> void
{
context.push(m_prefix);
diff --git a/libs/kstd/kstd/vector.hpp b/libs/kstd/kstd/vector.hpp
index 5a56381b..fc3020c7 100644
--- a/libs/kstd/kstd/vector.hpp
+++ b/libs/kstd/kstd/vector.hpp
@@ -898,7 +898,7 @@ namespace kstd
}
//! Release the memory of this vector.
- constexpr auto deallocate()
+ constexpr auto deallocate() -> void
{
if (m_data)
{
@@ -914,7 +914,7 @@ namespace kstd
//! @param position The position to insert the element at.
//! @param value The value to insert.
template<typename U>
- constexpr auto do_insert(const_iterator position, U && value)
+ constexpr auto do_insert(const_iterator position, U && value) -> iterator
{
auto prefix_size = std::ranges::distance(cbegin(), position);
if (position == cend())
@@ -969,7 +969,7 @@ namespace kstd
//! @param to The start of the target range inside this vector.
//! @param count The number of elements to copy
template<typename SourceIterator>
- constexpr auto uninitialized_copy_with_allocator(SourceIterator from, iterator to, size_type count)
+ constexpr auto uninitialized_copy_with_allocator(SourceIterator from, iterator to, size_type count) -> void
{
for (auto i = 0uz; i < count; ++i)
{
@@ -983,7 +983,7 @@ namespace kstd
//! @param to The start of the target range inside this vector.
//! @param count The number of elements to copy
template<typename SourceIterator>
- constexpr auto uninitialized_move_with_allocator(SourceIterator from, iterator to, size_type count)
+ constexpr auto uninitialized_move_with_allocator(SourceIterator from, iterator to, size_type count) -> void
{
for (auto i = 0uz; i < count; ++i)
{
@@ -1004,7 +1004,7 @@ namespace kstd
}
//! Shift all elements, starting the given position, one position back inside the vector.
- constexpr auto shift_back(iterator starting_at)
+ constexpr auto shift_back(iterator starting_at) -> void
{
std::allocator_traits<allocator_type>::construct(m_allocator, end(), std::move(*(end() - 1)));
std::ranges::move_backward(starting_at, end() - 1, end());
@@ -1015,7 +1015,7 @@ namespace kstd
//! @param position The position to insert the element at.
//! @param args The constructor arguments for the inserted element.
template<typename... Args>
- constexpr auto reallocate_and_insert(iterator position, Args &&... args)
+ constexpr auto reallocate_and_insert(iterator position, Args &&... args) -> void
{
auto prefix_size = std::ranges::distance(begin(), position);
auto suffix_size = std::ranges::distance(position, end());