[buffer] Avoid warnings

This commit is contained in:
Barend Gehrels
2014-06-19 19:10:49 +02:00
parent c5de26945b
commit 3261c52976
3 changed files with 9 additions and 8 deletions

View File

@@ -297,7 +297,7 @@ struct buffered_piece_collection
{
typename buffer_occupation_info::turn_vector_type const& turns = it->second.turns;
bool blocked = false;
for (int i = 0; i < turns.size(); i++)
for (std::size_t i = 0; i < turns.size(); i++)
{
if (m_turns[turns[i].turn_index].blocked())
{
@@ -307,7 +307,7 @@ struct buffered_piece_collection
}
if (blocked)
{
for (int i = 0; i < turns.size(); i++)
for (std::size_t i = 0; i < turns.size(); i++)
{
m_turns[turns[i].turn_index].count_on_occupied++;
}
@@ -320,7 +320,7 @@ struct buffered_piece_collection
it != occupation_map.end(); ++it)
{
typename buffer_occupation_info::turn_vector_type const& turns = it->second.turns;
for (int i = 0; i < turns.size(); i++)
for (std::size_t i = 0; i < turns.size(); i++)
{
m_turns[turns[i].turn_index].selectable_start = false;
}

View File

@@ -132,8 +132,8 @@ template<typename Pieces>
inline void move_index(Pieces const& pieces, int& index, int& piece_index, int direction)
{
BOOST_ASSERT(direction == 1 || direction == -1);
BOOST_ASSERT(piece_index >= 0 && piece_index < boost::size(pieces));
BOOST_ASSERT(index >= 0 && index < boost::size(pieces[piece_index].robust_ring));
BOOST_ASSERT(piece_index >= 0 && piece_index < static_cast<int>(boost::size(pieces)) );
BOOST_ASSERT(index >= 0 && index < static_cast<int>(boost::size(pieces[piece_index].robust_ring)));
index += direction;
if (direction == -1 && index < 0)
@@ -145,10 +145,11 @@ inline void move_index(Pieces const& pieces, int& index, int& piece_index, int d
}
index = boost::size(pieces[piece_index].robust_ring) - 1;
}
if (direction == 1 && index >= boost::size(pieces[piece_index].robust_ring))
if (direction == 1
&& index >= static_cast<int>(boost::size(pieces[piece_index].robust_ring)))
{
piece_index++;
if (piece_index >= boost::size(pieces))
if (piece_index >= static_cast<int>(boost::size(pieces)))
{
piece_index = 0;
}

View File

@@ -29,7 +29,7 @@ public :
template <typename Point>
inline CoordinateType apply(Point const& , Point const& ,
buffer_side_selector side) const
buffer_side_selector ) const
{
return m_distance;
}