Skip to content

Commit 8b4b026

Browse files
committed
_tri.cpp: Add explicit narrowing casts, to avoid C++11 compiler error.
1 parent 4e6b2c0 commit 8b4b026

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/tri/_tri.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ void Triangulation::calculate_edges()
277277
}
278278

279279
// Convert to python _edges array.
280-
npy_intp dims[2] = {edge_set.size(), 2};
280+
npy_intp dims[2] = {static_cast<npy_intp>(edge_set.size()), 2};
281281
_edges = (PyArrayObject*)PyArray_SimpleNew(2, dims, PyArray_INT);
282282
int* edges_ptr = (int*)PyArray_DATA(_edges);
283283
for (EdgeSet::const_iterator it = edge_set.begin(); it != edge_set.end(); ++it) {
@@ -571,7 +571,7 @@ Py::Object TriContourGenerator::contour_to_segs(const Contour& contour)
571571
Py::List segs(contour.size());
572572
for (Contour::size_type i = 0; i < contour.size(); ++i) {
573573
const ContourLine& line = contour[i];
574-
npy_intp dims[2] = {line.size(),2};
574+
npy_intp dims[2] = {static_cast<npy_intp>(line.size()),2};
575575
PyArrayObject* py_line = (PyArrayObject*)PyArray_SimpleNew(
576576
2, dims, PyArray_DOUBLE);
577577
double* p = (double*)PyArray_DATA(py_line);

0 commit comments

Comments
 (0)