diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-09-10 11:30:50 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-09-11 10:02:03 +0200 |
| commit | 69fe90716f0142e95fa43243500c4970e078d12b (patch) | |
| tree | edf1754b8ea74b81ba2d0bfdf9024bb6dd91f4e5 /sources/pyside6 | |
| parent | 46e0d095def5742540babd3854d582f32c4f2e48 (diff) | |
shiboken6: Fix some clang-tidy warnings in generated code
- Remove inline from inlined functions, fixing [readability-redundant-inline-specifier]
- Do not call parameterless base constructors, fixing [readability-redundant-member-init]
- Use nullptr [modernize-use-nullptr]
- Remove unneeded reinterpret_cast<>()
- Fix some warnings about uninitialized variables [cppcoreguidelines-init-variables]
Change-Id: I38e9ddc192556cf0d5770bd858b240f013c97c79
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtcore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp index 4c138305a..6378c5eda 100644 --- a/sources/pyside6/PySide6/glue/qtcore.cpp +++ b/sources/pyside6/PySide6/glue/qtcore.cpp @@ -231,8 +231,8 @@ static QVariant QVariant_convertToVariantMap(PyObject *map) Shiboken::AutoDecRef keys(PyDict_Keys(map)); if (!QVariant_isStringList(keys)) return {}; - PyObject *key; - PyObject *value; + PyObject *key{}; + PyObject *value{}; QMap<QString,QVariant> ret; while (PyDict_Next(map, &pos, &key, &value)) { QString cppKey = %CONVERTTOCPP[QString](key); @@ -1330,7 +1330,7 @@ Py_END_ALLOW_THREADS PyObject *shutDownFunc = PyObject_GetAttrString(module, "__moduleShutdown"); Shiboken::AutoDecRef args(PyTuple_New(1)); PyTuple_SET_ITEM(args, 0, shutDownFunc); - Shiboken::AutoDecRef retval(PyObject_Call(regFunc, args, 0)); + Shiboken::AutoDecRef retval(PyObject_Call(regFunc, args, nullptr)); Q_ASSERT(!retval.isNull()); } } @@ -1670,7 +1670,7 @@ if (converterO.has_value()) return converterO.value().toPython(cppInRef.data()); PyErr_Format(PyExc_RuntimeError, "Can't find converter for '%s'.", %in.typeName()); -return 0; +return nullptr; // @snippet return-qvariant // @snippet return-qjsonobject |
