Fix some warnings

This commit is contained in:
Georg Hagen
2025-05-13 19:31:46 +02:00
parent 28bf76b792
commit 378f4923b7
2 changed files with 468 additions and 467 deletions

View File

@@ -459,7 +459,7 @@ namespace OpenVulkano
return (Parent::HeadId() + 1 + Capacity() - Parent::Count()) % Capacity();
}
[[nodiscard]] size_t IncrementHead()
size_t IncrementHead()
{
if (Parent::IsEmpty()) [[unlikely]] return Parent::head;
return (Parent::head = (Parent::HeadId() + 1) % Capacity());
@@ -504,7 +504,7 @@ namespace OpenVulkano
return (Parent::HeadId() + 1 + Capacity() - Parent::Count()) % Capacity();
}
[[nodiscard]] size_t IncrementHead()
size_t IncrementHead()
{
if (Parent::IsEmpty()) [[unlikely]] return Parent::head;
if constexpr (POW2)

View File

@@ -470,7 +470,8 @@ TEST_CASE("RingBuffer with complex types", "[RingBuffer][Complex]") {
REQUIRE(buf.Back()[0] == 1);
REQUIRE(buf.Back()[2] == 3);
buf.PushFront(std::vector<int>{7, 8, 9});
const auto ret = buf.PushFront(std::vector<int>{7, 8, 9});
REQUIRE(!ret.has_value());
REQUIRE(buf.Front()[0] == 7);
buf.Clear();