diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-18 13:10:15 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-24 10:36:15 +0200 |
| commit | d326e40e8c52c9f74b6baa0d6f7f9a54ded0172a (patch) | |
| tree | a459a06eafb612cd51fbff447f63b4e1b9772422 /sources/pyside6/libpysideqml/pysideqmlattached.cpp | |
| parent | 1a4593f940b0eca4d0756092ed34c2b6a6962bd6 (diff) | |
libpysideqml: Fix static analysis warnings
- Initialize variables
- Use auto *
- Use nullptr
- Remove repeated return types
- Minor cleanups
Change-Id: I26cacce81a4c8ebc885f8c34d59fdac5d0026af9
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/libpysideqml/pysideqmlattached.cpp')
| -rw-r--r-- | sources/pyside6/libpysideqml/pysideqmlattached.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/pyside6/libpysideqml/pysideqmlattached.cpp b/sources/pyside6/libpysideqml/pysideqmlattached.cpp index d484257e2..da0a2afd4 100644 --- a/sources/pyside6/libpysideqml/pysideqmlattached.cpp +++ b/sources/pyside6/libpysideqml/pysideqmlattached.cpp @@ -50,7 +50,7 @@ const char *PySideQmlAttachedPrivate::name() const extern "C" { -static PyTypeObject *createPySideQmlAttachedType(void) +static PyTypeObject *createPySideQmlAttachedType() { auto typeSlots = PySide::ClassDecorator::Methods<PySideQmlAttachedPrivate>::typeSlots(); @@ -92,7 +92,7 @@ static QObject *attachedFactoryHelper(PyTypeObject *attachingType, QObject *o) static const char methodName[] = "qmlAttachedProperties"; static PyObject *const pyMethodName = Shiboken::String::createStaticString(methodName); - PyObject *attachingTypeObj = reinterpret_cast<PyObject *>(attachingType); + auto *attachingTypeObj = reinterpret_cast<PyObject *>(attachingType); Shiboken::AutoDecRef pyResult(PyObject_CallMethodObjArgs(attachingTypeObj, pyMethodName, attachingTypeObj /* self */, converter.toPython(&o), @@ -178,7 +178,7 @@ PySide::Qml::QmlExtensionInfo qmlAttachedInfo(PyTypeObject *t, if (!info || info->attachedType == nullptr) return result; - auto *name = reinterpret_cast<PyTypeObject *>(t)->tp_name; + const auto *name = reinterpret_cast<PyTypeObject *>(t)->tp_name; if (nextAttachingType >= MAX_ATTACHING_TYPES) { qWarning("Unable to initialize attached type \"%s\": " "The limit %d of attached types has been reached.", |
