From 872bd92575299cb701823dfe098479915d4e854a Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Sat, 2 Jul 2016 16:14:57 +0100 Subject: [PATCH] Use proper type for an int literal --- include/pybind11/numpy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 393c887e8..6375e160d 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -135,7 +135,7 @@ public: auto buf_info = info; if (!buf_info.ptr) // 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) pybind11_fail("NumPy: failed to allocate memory for buffer");