aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/basewrapper.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/basewrapper.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/basewrapper.cpp')
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index 6d7bd0c24..1762a969f 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -86,13 +86,12 @@ static PyGetSetDef SbkObjectType_Type_getsetlist[] = {
};
static PyType_Slot SbkObjectType_Type_slots[] = {
- {Py_tp_dealloc, (void *)SbkObjectTypeDealloc},
- {Py_tp_setattro, (void *)PyObject_GenericSetAttr},
- {Py_tp_base, (void *)&PyType_Type},
- {Py_tp_alloc, (void *)PyType_GenericAlloc},
- {Py_tp_getset, (void *)SbkObjectType_Type_getsetlist},
- {Py_tp_new, (void *)SbkObjectTypeTpNew},
- {Py_tp_free, (void *)PyObject_GC_Del},
+ {Py_tp_dealloc, reinterpret_cast<void *>(SbkObjectTypeDealloc)},
+ {Py_tp_setattro, reinterpret_cast<void *>(PyObject_GenericSetAttr)},
+ {Py_tp_base, static_cast<void *>(&PyType_Type)},
+ {Py_tp_alloc, reinterpret_cast<void *>(PyType_GenericAlloc)},
+ {Py_tp_new, reinterpret_cast<void *>(SbkObjectTypeTpNew)},
+ {Py_tp_free, reinterpret_cast<void *>(PyObject_GC_Del)},
{0, nullptr}
};
static PyType_Spec SbkObjectType_Type_spec = {
@@ -261,11 +260,11 @@ static int SbkObject_clear(PyObject *self)
}
static PyType_Slot SbkObject_Type_slots[] = {
- {Py_tp_dealloc, (void *)SbkDeallocWrapperWithPrivateDtor},
- {Py_tp_traverse, (void *)SbkObject_traverse},
- {Py_tp_clear, (void *)SbkObject_clear},
+ {Py_tp_dealloc, reinterpret_cast<void *>(SbkDeallocWrapperWithPrivateDtor)},
+ {Py_tp_traverse, reinterpret_cast<void *>(SbkObject_traverse)},
+ {Py_tp_clear, reinterpret_cast<void *>(SbkObject_clear)},
// unsupported: {Py_tp_weaklistoffset, (void *)offsetof(SbkObject, weakreflist)},
- {Py_tp_getset, (void *)SbkObjectGetSetList},
+ {Py_tp_getset, reinterpret_cast<void *>(SbkObjectGetSetList)},
// unsupported: {Py_tp_dictoffset, (void *)offsetof(SbkObject, ob_dict)},
{0, nullptr}
};
@@ -427,7 +426,7 @@ PyObject *SbkObjectTypeTpNew(PyTypeObject *metatype, PyObject *args, PyObject *k
PyObject *dict;
static const char *kwlist[] = { "name", "bases", "dict", nullptr};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "sO!O!:sbktype", (char **)kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "sO!O!:sbktype", const_cast<char **>(kwlist),
&name,
&PyTuple_Type, &pyBases,
&PyDict_Type, &dict))