10000 C++11 narrowing conversions by mgiuca-google · Pull Request #1434 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

C++11 narrowing conversions #1434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 4, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
_tri.cpp: Add explicit narrowing casts, to avoid C++11 compiler error.
  • Loading branch information
mgiuca-google committed Oct 29, 2012
commit 8b4b026ec168fc3cf902020cb432887dd3e7d59d
4 changes: 2 additions & 2 deletions lib/matplotlib/tri/_tri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void Triangulation::calculate_edges()
}

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