8000 Be explicit with array dimension types · matplotlib/matplotlib@22a0788 · GitHub
[go: up one dir, main page]

Skip to content
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 22a0788

Browse files
committed
Be explicit with array dimension types
1 parent 2db5711 commit 22a0788

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/_image_wrapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const char* image_resample__doc__ =
5151

5252

5353
static pybind11::array_t<double> _get_transform_mesh(const pybind11::object& transform,
54-
const ssize_t *dims)
54+
const pybind11::ssize_t *dims)
5555
{
5656
/* TODO: Could we get away with float, rather than double, arrays here? */
5757

@@ -62,7 +62,8 @@ static pybind11::array_t<double> _get_transform_mesh(const pybind11::object& tra
6262
// If attribute doesn't exist, raises Python AttributeError
6363
auto inverse = transform.attr("inverted")();
6464

65-
pybind11::array_t<double> input_mesh({dims[0]*dims[1], 2L});
65+
pybind11::ssize_t mesh_dims[2] = {dims[0]*dims[2], 2};
66+
pybind11::array_t<double> input_mesh(mesh_dims);
6667
auto p = input_mesh.mutable_data();
6768

6869
for (auto y = 0; y < dims[0]; ++y) {

0 commit comments

Comments
 (0)
0