Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Added some static_casts to numpy.hpp. When building on OS X with -std…
Browse files Browse the repository at this point in the history
…=c++0x, the lack of static_casts caused errors (...non-constant-expression cannot be narrowed from type...).
  • Loading branch information
egpbos authored and egpbos committed Dec 9, 2013
1 parent f8e020f commit 6fb4c79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyublas/include/pyublas/numpy.hpp
Expand Up @@ -166,7 +166,7 @@ namespace pyublas

numpy_array(size_type n)
{
npy_intp dims[] = { n };
npy_intp dims[] = { static_cast<npy_intp>(n) };
m_numpy_array = boost::python::handle<>(
PyArray_SimpleNew(1, dims, get_typenum(T())));
}
Expand All @@ -193,7 +193,7 @@ namespace pyublas
{
if (n)
{
npy_intp dims[] = { n };
npy_intp dims[] = { static_cast<npy_intp>(n) };
m_numpy_array = boost::python::handle<>(
PyArray_SimpleNew(1, dims, get_typenum(T())));
std::fill(begin(), end(), v);
Expand Down Expand Up @@ -257,7 +257,7 @@ namespace pyublas

if (new_size != old_size)
{
npy_intp dims[] = { new_size };
npy_intp dims[] = { static_cast<npy_intp>(new_size) };
boost::python::handle<> new_array = boost::python::handle<>(
PyArray_SimpleNew(1, dims, get_typenum(T())));
pointer new_data = reinterpret_cast<T *>(
Expand Down

0 comments on commit 6fb4c79

Please sign in to comment.