avoid compiler warning on unsigned/signed comparison

This commit is contained in:
Dane Springmeyer 2012-06-26 11:23:26 -07:00
parent eb686c6582
commit d9880efd6e
3 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ typedef boost::ptr_vector<geometry_type> path_type;
geometry_type const& getitem_impl(path_type & p, int key)
{
if (key >=0 && key < p.size())
if (key >=0 && key < static_cast<int>(p.size()))
return p[key];
PyErr_SetString(PyExc_IndexError, "Index is out of range");
throw boost::python::error_already_set();

View File

@ -41,7 +41,7 @@ bool painted(mapnik::grid const& grid)
int get_pixel(mapnik::grid const& grid, int x, int y)
{
if (x < grid.width() && y < grid.height())
if (x < static_cast<int>(grid.width()) && y < static_cast<int>(grid.height()))
{
mapnik::grid::value_type const * row = grid.getRow(y);
mapnik::grid::value_type const pixel = row[x];

View File

@ -230,16 +230,16 @@ struct ListNodeWrap: formatting::list_node, wrapper<formatting::list_node>
formatting::node_ptr get_item(int i)
{
if (i<0) i+= children_.size();
if (i<children_.size()) return children_[i];
if (i < 0) i+= children_.size();
if (i < static_cast<int>(children_.size())) return children_[i];
IndexError();
return formatting::node_ptr(); //Avoid compiler warning
}
void set_item(int i, formatting::node_ptr ptr)
{
if (i<0) i+= children_.size();
if (i<children_.size()) children_[i] = ptr;
if (i < 0) i+= children_.size();
if (i < static_cast<int>(children_.size())) children_[i] = ptr;
IndexError();
}