Use proper type for an int literal

This commit is contained in:
Ivan Smirnov 2016-07-02 16:14:57 +01:00
parent 223afe37fa
commit 872bd92575

View File

@ -135,7 +135,7 @@ public:
auto buf_info = info; auto buf_info = info;
if (!buf_info.ptr) if (!buf_info.ptr)
// always allocate at least 1 element, same way as NumPy does it // always allocate at least 1 element, same way as NumPy does it
buf_info.ptr = std::calloc(std::max(info.size, 1ul), info.itemsize); buf_info.ptr = std::calloc(std::max(info.size, (size_t) 1), info.itemsize);
if (!buf_info.ptr) if (!buf_info.ptr)
pybind11_fail("NumPy: failed to allocate memory for buffer"); pybind11_fail("NumPy: failed to allocate memory for buffer");