mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
avoid compiler warning on unsigned/signed comparison
This commit is contained in:
parent
eb686c6582
commit
d9880efd6e
@ -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();
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user