Browse Source

Fix other instances

pull/15/head
Aaron Gokaslan 4 years ago
parent
commit
8809a25aa6
  1. 4
      src/python/corrade/containers.cpp
  2. 2
      src/python/magnum/math.matrix.h

4
src/python/corrade/containers.cpp

@ -100,7 +100,7 @@ template<class T> void arrayView(py::class_<Containers::ArrayView<T>, Containers
.def(py::init(), "Default constructor")
/* Buffer protocol */
.def(py::init([](py::buffer other) {
.def(py::init([](const py::buffer& other) {
/* GCC 4.8 otherwise loudly complains about missing initializers */
Py_buffer buffer{nullptr, nullptr, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr};
if(PyObject_GetBuffer(other.ptr(), &buffer, (std::is_const<T>::value ? 0 : PyBUF_WRITABLE)) != 0)
@ -316,7 +316,7 @@ template<unsigned dimensions, class T> void stridedArrayView(py::class_<Containe
.def(py::init(), "Default constructor")
/* Buffer protocol */
.def(py::init([](py::buffer other) {
.def(py::init([](const py::buffer& other) {
/* GCC 4.8 otherwise loudly complains about missing initializers */
Py_buffer buffer{nullptr, nullptr, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr};
if(PyObject_GetBuffer(other.ptr(), &buffer, PyBUF_STRIDES|(std::is_const<T>::value ? 0 : PyBUF_WRITABLE)) != 0)

2
src/python/magnum/math.matrix.h

@ -105,7 +105,7 @@ template<class T, class ...Args> void everyRectangularMatrixBuffer(py::class_<T,
/* Buffer protocol, needed in order to properly detect row-major
layouts. Has to be defined *before* the from-tuple constructor so it
gets precedence for types that implement the buffer protocol. */
.def(py::init([](py::buffer other) {
.def(py::init([](const py::buffer& other) {
/* GCC 4.8 otherwise loudly complains about missing initializers */
Py_buffer buffer{nullptr, nullptr, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr};
if(PyObject_GetBuffer(other.ptr(), &buffer, PyBUF_FORMAT|PyBUF_STRIDES) != 0)

Loading…
Cancel
Save