aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/voidptr.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-07 15:05:32 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-25 10:44:14 +0200
commit3680a489521e4c13488b4f3f462b8e34cebd0e47 (patch)
tree82b18a72a18c2db7e4d046af0f6c5d3dd3f80f68 /sources/shiboken2/libshiboken/voidptr.cpp
parent7be4e64b4bac6e6b5a90eec74b9f2b661c60db3a (diff)
shiboken: Replace C-style casts by C++ casts
Also change some reinterpret_cast<> to static_cast<> and use standard types for pointer arithmetics. Change-Id: Iafeeab5abffbca87d6f9767da9836bac342058c2 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/libshiboken/voidptr.cpp')
-rw-r--r--sources/shiboken2/libshiboken/voidptr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken2/libshiboken/voidptr.cpp b/sources/shiboken2/libshiboken/voidptr.cpp
index 2728b24c8..1bba9b4f7 100644
--- a/sources/shiboken2/libshiboken/voidptr.cpp
+++ b/sources/shiboken2/libshiboken/voidptr.cpp
@@ -275,7 +275,7 @@ static int SbkVoidPtrObject_getbuffer(PyObject *obj, Py_buffer *view, int flags)
view->itemsize = 1;
view->format = nullptr;
if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT)
- view->format = "B";
+ view->format = const_cast<char *>("B");
view->ndim = 1;
view->shape = nullptr;
if ((flags & PyBUF_ND) == PyBUF_ND)
@@ -354,7 +354,7 @@ PyTypeObject *SbkVoidPtrTypeF(void)
{
static PyTypeObject *type = nullptr;
if (!type)
- type = (PyTypeObject *)PyType_FromSpec(&SbkVoidPtrType_spec);
+ type = reinterpret_cast<PyTypeObject *>(PyType_FromSpec(&SbkVoidPtrType_spec));
#if PY_VERSION_HEX < 0x03000000
type->tp_as_buffer = &SbkVoidPtrObjectBufferProc;