aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken2/libshiboken/bindingmanager.cpp3
-rw-r--r--sources/shiboken2/libshiboken/sbkenum.cpp4
-rw-r--r--sources/shiboken2/libshiboken/sbkstring.cpp5
-rw-r--r--sources/shiboken2/libshiboken/shibokenbuffer.cpp6
4 files changed, 8 insertions, 10 deletions
diff --git a/sources/shiboken2/libshiboken/bindingmanager.cpp b/sources/shiboken2/libshiboken/bindingmanager.cpp
index 5978f3a37..83ea6244f 100644
--- a/sources/shiboken2/libshiboken/bindingmanager.cpp
+++ b/sources/shiboken2/libshiboken/bindingmanager.cpp
@@ -113,9 +113,8 @@ public:
if (typeFound != type)
*cptr = typeFound;
return type;
- } else {
- return nullptr;
}
+ return nullptr;
}
};
diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp
index fb55267d1..d563c765d 100644
--- a/sources/shiboken2/libshiboken/sbkenum.cpp
+++ b/sources/shiboken2/libshiboken/sbkenum.cpp
@@ -373,7 +373,9 @@ PyObject* getEnumItemFromValue(PyTypeObject* enumType, long itemValue)
return 0;
}
-static PyTypeObject* createEnum(const char* fullName, const char* cppName, const char* shortName, PyTypeObject* flagsType)
+static PyTypeObject* createEnum(const char* fullName, const char* cppName,
+ const char* /* shortName */,
+ PyTypeObject* flagsType)
{
PyTypeObject* enumType = newTypeWithName(fullName, cppName, flagsType);
if (PyType_Ready(enumType) < 0)
diff --git a/sources/shiboken2/libshiboken/sbkstring.cpp b/sources/shiboken2/libshiboken/sbkstring.cpp
index 6ca35f12e..a3ffcdabb 100644
--- a/sources/shiboken2/libshiboken/sbkstring.cpp
+++ b/sources/shiboken2/libshiboken/sbkstring.cpp
@@ -66,10 +66,7 @@ bool check(PyObject* obj)
bool checkChar(PyObject* pyobj)
{
- if (check(pyobj) && (len(pyobj) == 1))
- return true;
-
- return false;
+ return check(pyobj) && (len(pyobj) == 1);
}
bool isConvertible(PyObject* obj)
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