aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/shibokenbuffer.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-30 16:44:52 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-30 16:37:26 +0000
commite95e2b74f109eaf167782cb916f76d72eaac9ed6 (patch)
treef9a34fd09d16df405456805d9ce6a32b55b0435f /sources/shiboken2/libshiboken/shibokenbuffer.cpp
parent83f09c51f76f17255b34e72a5a3c9b7b325e7aae (diff)
libshiboken: Fix remaining clang-tidy warnings
- Remove else after return/continue/break; unindent code or simplify return conditions - Fix C-style casts - Comment out unused parameter Change-Id: Iea1106023829658cd1ce005fa02d0c8940504dfd Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/libshiboken/shibokenbuffer.cpp')
-rw-r--r--sources/shiboken2/libshiboken/shibokenbuffer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/shiboken2/libshiboken/shibokenbuffer.cpp b/sources/shiboken2/libshiboken/shibokenbuffer.cpp
index 05b68dade..70341c6d8 100644
--- a/sources/shiboken2/libshiboken/shibokenbuffer.cpp
+++ b/sources/shiboken2/libshiboken/shibokenbuffer.cpp
@@ -55,9 +55,8 @@ void* Shiboken::Buffer::getPointer(PyObject* pyObj, Py_ssize_t* size)
if (size)
*size = view.len;
return view.buf;
- } else {
- return 0;
}
+ return nullptr;
#else
const void* buffer = 0;
Py_ssize_t bufferSize = 0;
@@ -86,7 +85,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