Skip to content

Commit

Permalink
Prevent warning on comparing differently signed integers [-Wsign-comp…
Browse files Browse the repository at this point in the history
…are]
  • Loading branch information
martinmoene committed May 1, 2018
1 parent 18f22fd commit b62d14e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/span.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,15 +851,15 @@ CASE( "span<>: Allows to view and change the elements as writable bytes" )
span<type> va( a );
span<byte> vb( as_writeable_bytes(va) );

for ( size_t i = 0; i < sizeof(type); ++i )
for ( std::ptrdiff_t i = 0; i < std::ptrdiff_t( sizeof(type) ); ++i )
{
EXPECT( vb[i] == byte{0} );
}

vb[0] = byte{0x42};

EXPECT( vb[0] == byte{0x42} );
for ( size_t i = 1; i < sizeof(type); ++i )
for ( std::ptrdiff_t i = 1; i < std::ptrdiff_t( sizeof(type) ); ++i )
{
EXPECT( vb[i] == byte{0} );
}
Expand Down

0 comments on commit b62d14e

Please sign in to comment.