Skip to content

Commit

Permalink
Fixed a few more Wsign-conversion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
OleErikPeistorpet committed Jun 2, 2024
1 parent e74567a commit d31ce68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dynarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ is_trivially_relocatable<Alloc> specify_trivial_relocate(dynarray<T, Alloc>);

//! Overloads generic unordered_erase(RandomAccessContainer &, Integral) (in range_algo.h)
template< typename T, typename A > inline
void unordered_erase(dynarray<T, A> & d, size_t index) { d.unordered_erase(d.begin() + index); }
void unordered_erase(dynarray<T, A> & d, ptrdiff_t index) { d.unordered_erase(d.begin() + index); }

#if OEL_MEM_BOUND_DEBUG_LVL
inline namespace debug
Expand Down
8 changes: 4 additions & 4 deletions unit_test/dynarray_mutate_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,10 @@ TEST_F(dynarrayTest, insertRTrivial)

TEST_F(dynarrayTest, insertR)
{
size_t const initSize = 2;
constexpr size_t initSize{2};
std::array<TrivialRelocat, 2> const toInsert{TrivialRelocat{-1}, TrivialRelocat{-2}};
for (auto nReserve : {initSize, initSize + toInsert.size()})
for (size_t insertOffset = 0; insertOffset <= initSize; ++insertOffset)
for (ptrdiff_t insertOffset = 0; insertOffset <= oel::as_signed(initSize); ++insertOffset)
for (unsigned countThrow = 0; countThrow <= toInsert.size(); ++countThrow)
{ {
dynarray<TrivialRelocat> dest(oel::reserve, nReserve);
Expand All @@ -465,8 +465,8 @@ TEST_F(dynarrayTest, insertR)
}
if (dest.size() > initSize)
{
for (unsigned i = 0; i < countThrow; ++i)
EXPECT_TRUE( *toInsert[i] == *dest[i + insertOffset] );
for (size_t i{}; i < countThrow; ++i)
EXPECT_TRUE( *toInsert[i] == *dest[i + oel::as_unsigned(insertOffset)] );
}
if (insertOffset == 0)
{
Expand Down

0 comments on commit d31ce68

Please sign in to comment.