aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/pyside.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-11 10:42:36 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-11 15:19:42 +0100
commit146b3cb79c3f0927df3d7c5d9fdc9c67b976051d (patch)
treec2debab92f118f1da0fd4af05a3e72dc254c938a /sources/pyside6/libpyside/pyside.cpp
parent7d602dc46163be603e87b1ef4f8db7b1ab87c1f6 (diff)
libpyside: Fix some clang analzyer warnings
- Use nullptr - Initialize variables - Remove else after return - Remove C-style casts - Avoid constructing QString from const char * - Use emit for signals Change-Id: I6ba8cad51f4b2a22f94996d1a9d8c3ae87c35099 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/libpyside/pyside.cpp')
-rw-r--r--sources/pyside6/libpyside/pyside.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp
index 22230703e..80f0e1b7e 100644
--- a/sources/pyside6/libpyside/pyside.cpp
+++ b/sources/pyside6/libpyside/pyside.cpp
@@ -85,7 +85,7 @@ namespace PySide
void init(PyObject *module)
{
- qobjectNextAddr = 0;
+ qobjectNextAddr = nullptr;
ClassInfo::init(module);
Signal::init(module);
Slot::init(module);
@@ -323,7 +323,7 @@ PyObject *getMetaDataFromQObject(QObject *cppSelf, PyObject *self, PyObject *nam
PyObject *value = Property::getValue(reinterpret_cast<PySideProperty *>(attr), self);
Py_DECREF(attr);
if (!value)
- return 0;
+ return nullptr;
attr = value;
}
@@ -376,7 +376,7 @@ bool inherits(PyTypeObject *objType, const char *class_name)
return true;
PyTypeObject *base = objType->tp_base;
- if (base == 0)
+ if (base == nullptr)
return false;
return inherits(base, class_name);
@@ -408,7 +408,7 @@ static void invalidatePtr(any_t *object)
Shiboken::GilState state;
SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(object);
- if (wrapper != NULL)
+ if (wrapper != nullptr)
Shiboken::BindingManager::instance().releaseWrapper(wrapper);
}
@@ -548,7 +548,7 @@ bool registerInternalQtConf()
// because tests are executed before the package is installed, and thus the Prefix specified
// in qt.conf would point to a not yet existing location.
bool disableInternalQtConf =
- qEnvironmentVariableIntValue("PYSIDE_DISABLE_INTERNAL_QT_CONF") > 0 ? true : false;
+ qEnvironmentVariableIntValue("PYSIDE_DISABLE_INTERNAL_QT_CONF") > 0;
if (disableInternalQtConf || executableQtConfAvailable) {
registrationAttempted = true;
return false;