8000 Backport PR #10736: Avoid narrowing conversion in image_wrapper on 32… · matplotlib/matplotlib@bbd559c · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bbd559c

Browse files
jklymakMeeseeksDev[bot]
authored andcommitted
Backport PR #10736: Avoid narrowing conversion in image_wrapper on 32-bit.
1 parent 8a900fc commit bbd559c

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
@@ -360,13 +360,12 @@ static PyObject *image_pcolor(PyObject *self, PyObject *args, PyObject *kwds)
360360
numpy::array_view<const float, 1> x;
361361
numpy::array_view<const float, 1> y;
362362
numpy::array_view<const agg::int8u, 3> d;
363-
unsigned int rows;
364-
unsigned int cols;
363+
npy_intp rows, cols;
365364
float bounds[4];
366365
int interpolation;
367366

368367
if (!PyArg_ParseTuple(args,
369-
"O&O&O&II(ffff)i:pcolor",
368+
"O&O&O&nn(ffff)i:pcolor",
370369
&x.converter,
371370
&x,
372371
&y.converter,
@@ -404,13 +403,12 @@ static PyObject *image_pcolor2(PyObject *self, PyObject *args, PyObject *kwds)
404403
numpy::array_view<const double, 1> x;
405404
numpy::array_view<const double, 1> y;
406405
numpy::array_view<const agg::int8u, 3> d;
407-
unsigned int rows;
408-
unsigned int cols;
406+
npy_intp rows, cols;
409407
float bounds[4];
410408
numpy::array_view<const agg::int8u, 1> bg;
411409

412410
if (!PyArg_ParseTuple(args,
413-
"O&O&O&II(ffff)O&:pcolor2",
411+
"O&O&O&nn(ffff)O&:pcolor2",
414412
&x.converter_contiguous,
415413
&x,
416414
&y.converter_contiguous,

0 commit comments

Comments
 (0)
0