diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-21 15:41:58 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-21 18:04:29 +0100 |
| commit | 948bb445b09870f2100ab61d912e3a2f1769c06e (patch) | |
| tree | 260ae9bc5cbd2c476b298447673ab2c54d6bec59 /sources/pyside6/libpyside | |
| parent | 123e27090e0ec4f8d32f301700c9ff9d1b49ba2a (diff) | |
Clean up some warnings produced by Qt Creator's clang/clazy code checkers
- Remove unused variables
- Remove assignments that do not have any effect
- Fix mixing const/non-const iterators
- Fix for loops, use const ref and/or qAsConst()
Change-Id: I4b52f11030493c440026b194f18ec0151a3ea710
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside')
| -rw-r--r-- | sources/pyside6/libpyside/feature_select.cpp | 5 | ||||
| -rw-r--r-- | sources/pyside6/libpyside/pysideproperty.cpp | 2 | ||||
| -rw-r--r-- | sources/pyside6/libpyside/pysidesignal.cpp | 6 |
3 files changed, 4 insertions, 9 deletions
diff --git a/sources/pyside6/libpyside/feature_select.cpp b/sources/pyside6/libpyside/feature_select.cpp index b87751271..060c0d2ec 100644 --- a/sources/pyside6/libpyside/feature_select.cpp +++ b/sources/pyside6/libpyside/feature_select.cpp @@ -584,9 +584,8 @@ static PyObject *modifyStaticToClassMethod(PyTypeObject *type, PyObject *sm) new_func->ml_meth = func->m_ml->ml_meth; new_func->ml_flags = (func->m_ml->ml_flags & ~METH_STATIC) | METH_CLASS; new_func->ml_doc = func->m_ml->ml_doc; - auto cfunc = PyCFunction_NewEx(new_func, nullptr, nullptr); - cfunc = PyDescr_NewClassMethod(type, new_func); - return cfunc; + PyCFunction_NewEx(new_func, nullptr, nullptr); + return PyDescr_NewClassMethod(type, new_func); } static PyObject *createProperty(PyTypeObject *type, PyObject *getter, PyObject *setter) diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp index 857041ea0..c00d90c2d 100644 --- a/sources/pyside6/libpyside/pysideproperty.cpp +++ b/sources/pyside6/libpyside/pysideproperty.cpp @@ -128,8 +128,6 @@ static void qpropertyMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::C Shiboken::Conversions::SpecificConverter converter(pp->d->typeName); Q_ASSERT(converter); - QByteArray type(pp->d->typeName); - switch(call) { case QMetaObject::ReadProperty: { diff --git a/sources/pyside6/libpyside/pysidesignal.cpp b/sources/pyside6/libpyside/pysidesignal.cpp index 8533c2a48..63d5b0228 100644 --- a/sources/pyside6/libpyside/pysidesignal.cpp +++ b/sources/pyside6/libpyside/pysidesignal.cpp @@ -352,7 +352,6 @@ static PyObject *signalInstanceConnect(PyObject *self, PyObject *args, PyObject bool isFunction = PyFunction_Check(slot); bool matchedSlot = false; - QByteArray functionName; PySideSignalInstance *it = source; if (isMethod || isFunction) { @@ -896,9 +895,8 @@ void registerSignals(SbkObjectType *pyObj, const QMetaObject *metaObject) // Empty signatures comes first! So they will be the default signal signature std::stable_sort(it.value().begin(), it.value().end(), &compareSignals); - SignalSigMap::mapped_type::const_iterator j = it.value().begin(); - SignalSigMap::mapped_type::const_iterator endJ = it.value().end(); - for (; j != endJ; ++j) { + const auto endJ = it.value().cend(); + for (auto j = it.value().cbegin(); j != endJ; ++j) { const SignalSignature &sig = *j; appendSignature(self, sig); } |
