Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b7a21e

Browse files
authored
Merge pull request #10736 from anntzer/narrowing
Avoid narrowing conversion in image_wrapper on 32-bit.
2 parents 583d005 + 7111817 commit 5b7a21e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/_image_wrapper.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,12 @@ static PyObject *image_pcolor(PyObject *self, PyObject *args, PyObject *kwds)
352352
numpy::array_view<const float, 1> x;
353353
numpy::array_view<const float, 1> y;
354354
numpy::array_view<const agg::int8u, 3> d;
355-
unsigned int rows;
356-
unsigned int cols;
355+
npy_intp rows, cols;
357356
float bounds[4];
358357
int interpolation;
359358

360359
if (!PyArg_ParseTuple(args,
361-
"O&O&O&II(ffff)i:pcolor",
360+
"O&O&O&nn(ffff)i:pcolor",
362361
&x.converter,
363362
&x,
364363
&y.converter,
@@ -396,13 +395,12 @@ static PyObject *image_pcolor2(PyObject *self, PyObject *args, PyObject *kwds)
396395
numpy::array_view<const double, 1> x;
397396
numpy::array_view<const double, 1> y;
398397
numpy::array_view<const agg::int8u, 3> d;
399-
unsigned int rows;
400-
unsigned int cols;
398+
npy_intp rows, cols;
401399
float bounds[4];
402400
numpy::array_view<const agg::int8u, 1> bg;
403401

404402
if (!PyArg_ParseTuple(args,
405-
"O&O&O&II(ffff)O&:pcolor2",
403+
"O&O&O&nn(ffff)O&:pcolor2",
406404
&x.converter_contiguous,
407405
&x,
408406
&y.converter_contiguous,

0 commit comments

Comments
 (0)