Skip to content

Commit c2dc64e

Browse files
committed
Fixes issue with int comparing. closes #31
1 parent 7ff16df commit c2dc64e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mapnik_image.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ object get_pixel(mapnik::image_any const& im, unsigned x, unsigned y, bool get_c
191191

192192
void set_pixel_color(mapnik::image_any & im, unsigned x, unsigned y, mapnik::color const& c)
193193
{
194-
if (x >= static_cast<int>(im.width()) && y >= static_cast<int>(im.height()))
194+
if (x >= static_cast<unsigned>(im.width()) && y >= static_cast<unsigned>(im.height()))
195195
{
196196
PyErr_SetString(PyExc_IndexError, "invalid x,y for image dimensions");
197197
boost::python::throw_error_already_set();
@@ -202,7 +202,7 @@ void set_pixel_color(mapnik::image_any & im, unsigned x, unsigned y, mapnik::col
202202

203203
void set_pixel_double(mapnik::image_any & im, unsigned x, unsigned y, double val)
204204
{
205-
if (x >= static_cast<int>(im.width()) && y >= static_cast<int>(im.height()))
205+
if (x >= static_cast<unsigned>(im.width()) && y >= static_cast<unsigned>(im.height()))
206206
{
207207
PyErr_SetString(PyExc_IndexError, "invalid x,y for image dimensions");
208208
boost::python::throw_error_already_set();
@@ -213,7 +213,7 @@ void set_pixel_double(mapnik::image_any & im, unsigned x, unsigned y, double val
213213

214214
void set_pixel_int(mapnik::image_any & im, unsigned x, unsigned y, int val)
215215
{
216-
if (x >= static_cast<int>(im.width()) && y >= static_cast<int>(im.height()))
216+
if (x >= static_cast<unsigned>(im.width()) && y >= static_cast<unsigned>(im.height()))
217217
{
218218
PyErr_SetString(PyExc_IndexError, "invalid x,y for image dimensions");
219219
boost::python::throw_error_already_set();

0 commit comments

Comments
 (0)