Fix some warnings
This commit is contained in:
@@ -459,7 +459,7 @@ namespace OpenVulkano
|
|||||||
return (Parent::HeadId() + 1 + Capacity() - Parent::Count()) % Capacity();
|
return (Parent::HeadId() + 1 + Capacity() - Parent::Count()) % Capacity();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] size_t IncrementHead()
|
size_t IncrementHead()
|
||||||
{
|
{
|
||||||
if (Parent::IsEmpty()) [[unlikely]] return Parent::head;
|
if (Parent::IsEmpty()) [[unlikely]] return Parent::head;
|
||||||
return (Parent::head = (Parent::HeadId() + 1) % Capacity());
|
return (Parent::head = (Parent::HeadId() + 1) % Capacity());
|
||||||
@@ -504,7 +504,7 @@ namespace OpenVulkano
|
|||||||
return (Parent::HeadId() + 1 + Capacity() - Parent::Count()) % Capacity();
|
return (Parent::HeadId() + 1 + Capacity() - Parent::Count()) % Capacity();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] size_t IncrementHead()
|
size_t IncrementHead()
|
||||||
{
|
{
|
||||||
if (Parent::IsEmpty()) [[unlikely]] return Parent::head;
|
if (Parent::IsEmpty()) [[unlikely]] return Parent::head;
|
||||||
if constexpr (POW2)
|
if constexpr (POW2)
|
||||||
|
|||||||
@@ -470,7 +470,8 @@ TEST_CASE("RingBuffer with complex types", "[RingBuffer][Complex]") {
|
|||||||
REQUIRE(buf.Back()[0] == 1);
|
REQUIRE(buf.Back()[0] == 1);
|
||||||
REQUIRE(buf.Back()[2] == 3);
|
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);
|
REQUIRE(buf.Front()[0] == 7);
|
||||||
|
|
||||||
buf.Clear();
|
buf.Clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user