mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-19 01:15:52 +00:00
Use proper type for an int literal
This commit is contained in:
parent
223afe37fa
commit
872bd92575
@ -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");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user