diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 79c4cf378..3fe426a52 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -133,7 +133,7 @@ public: args["names"] = names; args["formats"] = formats; args["offsets"] = offsets; - args["itemsize"] = int_(itemsize); + args["itemsize"] = pybind11::int_(itemsize); m_ptr = from_args(args).release().ptr(); } @@ -150,7 +150,7 @@ public: } size_t itemsize() const { - return (size_t) attr("itemsize").cast(); + return attr("itemsize").cast(); } bool has_fields() const { @@ -175,7 +175,7 @@ private: if (fields.ptr() == Py_None) return *this; - struct field_descr { PYBIND11_STR_TYPE name; object format; int_ offset; }; + struct field_descr { PYBIND11_STR_TYPE name; object format; pybind11::int_ offset; }; std::vector field_descriptors; auto items = fields.attr("items").cast(); @@ -183,7 +183,7 @@ private: auto spec = object(field, true).cast(); auto name = spec[0].cast(); auto format = spec[1].cast()[0].cast(); - auto offset = spec[1].cast()[1].cast(); + auto offset = spec[1].cast()[1].cast(); if (!len(name) && format.kind() == "V") continue; field_descriptors.push_back({(PYBIND11_STR_TYPE) name, format.strip_padding(), offset});