diff options
Diffstat (limited to 'sources/shiboken2/libshiboken/shibokenbuffer.cpp')
-rw-r--r-- | sources/shiboken2/libshiboken/shibokenbuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken2/libshiboken/shibokenbuffer.cpp b/sources/shiboken2/libshiboken/shibokenbuffer.cpp index dc29b40a7..a691a31ee 100644 --- a/sources/shiboken2/libshiboken/shibokenbuffer.cpp +++ b/sources/shiboken2/libshiboken/shibokenbuffer.cpp @@ -58,6 +58,7 @@ void* Shiboken::Buffer::getPointer(PyObject* pyObj, Py_ssize_t* size) PyBuffer_Release(&view); return view.buf; } + return nullptr; #else Py_ssize_t bufferSize = 0; @@ -85,7 +86,8 @@ PyObject* Shiboken::Buffer::newObject(void* memory, Py_ssize_t size, Type type) view.shape = shape; // Pep384: This is way too complicated and impossible with the limited api: //return PyMemoryView_FromBuffer(&view); - return PyMemoryView_FromMemory((char *)view.buf, size, type == ReadOnly ? PyBUF_READ : PyBUF_WRITE); + return PyMemoryView_FromMemory(reinterpret_cast<char *>(view.buf), + size, type == ReadOnly ? PyBUF_READ : PyBUF_WRITE); #else return type == ReadOnly ? PyBuffer_FromMemory(memory, size) : PyBuffer_FromReadWriteMemory(memory, size); #endif |