Base: C++ core guidelines: init variables

This commit is contained in:
wmayer
2023-08-24 14:21:05 +02:00
committed by wwmayer
parent 53a4fb14c3
commit 010dca8303
43 changed files with 622 additions and 626 deletions

View File

@@ -41,7 +41,7 @@ std::string TypePy::representation() const
PyObject* TypePy::fromName (PyObject *args)
{
const char *name;
const char *name{};
if (!PyArg_ParseTuple(args, "s", &name))
return nullptr;
@@ -51,7 +51,7 @@ PyObject* TypePy::fromName (PyObject *args)
PyObject* TypePy::fromKey (PyObject *args)
{
unsigned int index;
unsigned int index{};
if (!PyArg_ParseTuple(args, "I", &index))
return nullptr;
@@ -100,14 +100,14 @@ PyObject* TypePy::isDerivedFrom(PyObject *args)
Base::Type type;
do {
const char *name;
const char *name{};
if (PyArg_ParseTuple(args, "s", &name)) {
type = Base::Type::fromName(name);
break;
}
PyErr_Clear();
PyObject* t;
PyObject* t{};
if (PyArg_ParseTuple(args, "O!", &TypePy::Type, &t)) {
type = *static_cast<TypePy*>(t)->getBaseTypePtr();
break;
@@ -127,14 +127,14 @@ PyObject* TypePy::getAllDerivedFrom(PyObject *args)
Base::Type type;
do {
const char *name;
const char *name{};
if (PyArg_ParseTuple(args, "s", &name)) {
type = Base::Type::fromName(name);
break;
}
PyErr_Clear();
PyObject* t;
PyObject* t{};
if (PyArg_ParseTuple(args, "O!", &TypePy::Type, &t)) {
type = *static_cast<TypePy*>(t)->getBaseTypePtr();
break;
@@ -224,8 +224,8 @@ PyObject* TypePy::createInstance (PyObject *args)
PyObject* TypePy::createInstanceByName (PyObject *args)
{
const char* name;
PyObject* load = Py_False;
const char* name{};
PyObject* load = Py_False; //NOLINT
if (!PyArg_ParseTuple(args, "s|O!", &name, &PyBool_Type, &load))
return nullptr;