aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/class_property.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-09-18 10:11:13 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-09-20 13:44:47 +0200
commitb8f5e535dab255af228830c6d548ce730a7603d5 (patch)
tree82fe89344b91a4bf82180efff9734dc3429ef4cc /sources/pyside6/libpyside/class_property.cpp
parent2cc7ded80caa506263ba2c9fd87db76dae71956a (diff)
libshiboken/libpyside: Fix some static analysis warnings
- nullptr - narrowing integer conversions - else after return - Use auto - Missing move special functions Pick-to: 6.6 6.5 Change-Id: Ib872481a46c8bb17592cdc1778ab3c4d9598c753 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/class_property.cpp')
-rw-r--r--sources/pyside6/libpyside/class_property.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/sources/pyside6/libpyside/class_property.cpp b/sources/pyside6/libpyside/class_property.cpp
index 82c2197d9..02e061277 100644
--- a/sources/pyside6/libpyside/class_property.cpp
+++ b/sources/pyside6/libpyside/class_property.cpp
@@ -51,7 +51,7 @@ static PyType_Slot PyClassProperty_slots[] = {
{Py_tp_descr_get, reinterpret_cast<void *>(PyClassProperty_descr_get)},
{Py_tp_descr_set, reinterpret_cast<void *>(PyClassProperty_descr_set)},
{Py_tp_init, reinterpret_cast<void *>(PyClassProperty_tp_init)},
- {0, 0}
+ {0, nullptr}
};
static PyType_Spec PyClassProperty_spec = {
@@ -97,10 +97,8 @@ static int SbkObjectType_meta_setattro(PyObject *obj, PyObject *name, PyObject *
if (call_descr_set) {
// Call `class_property.__set__()` instead of replacing the `class_property`.
return Py_TYPE(descr)->tp_descr_set(descr, obj, value);
- } else {
- // Replace existing attribute.
- return PyType_Type.tp_setattro(obj, name, value);
- }
+ } // Replace existing attribute.
+ return PyType_Type.tp_setattro(obj, name, value);
}
} // extern "C"