From dff4e2a0d24599aa5d607cfc873e210c4b5abb95 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Sun, 16 Sep 2018 12:53:49 +0200 Subject: [PATCH] Use nullptr in generated C++ sources Reviewers: vandenoever Reviewed By: vandenoever Differential Revision: https://phabricator.kde.org/D15553 --- demo/src/Bindings.cpp | 12 ++++++------ src/cpp.cpp | 2 +- tests/test_functions_rust.cpp | 2 +- tests/test_list_rust.cpp | 4 ++-- tests/test_list_types_rust.cpp | 2 +- tests/test_object_rust.cpp | 2 +- tests/test_object_types_rust.cpp | 2 +- tests/test_objects_rust.cpp | 6 +++--- tests/test_tree_rust.cpp | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/demo/src/Bindings.cpp b/demo/src/Bindings.cpp index 6ff92fd..2ec8098 100644 --- a/demo/src/Bindings.cpp +++ b/demo/src/Bindings.cpp @@ -1091,7 +1091,7 @@ Demo::Demo(bool /*owned*/, QObject *parent): m_fileSystemTree(new FileSystemTree(false, this)), m_processes(new Processes(false, this)), m_timeSeries(new TimeSeries(false, this)), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } @@ -1386,7 +1386,7 @@ TimeSeries* Demo::timeSeries() } Fibonacci::Fibonacci(bool /*owned*/, QObject *parent): QObject(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } @@ -1418,7 +1418,7 @@ quint64 Fibonacci::result() const } FibonacciList::FibonacciList(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData(); @@ -1485,7 +1485,7 @@ void FibonacciList::initHeaderData() { } FileSystemTree::FileSystemTree(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData(); @@ -1596,7 +1596,7 @@ void FileSystemTree::setPath(const QString& v) { } Processes::Processes(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData(); @@ -1699,7 +1699,7 @@ void Processes::setActive(bool v) { } TimeSeries::TimeSeries(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData(); diff --git a/src/cpp.cpp b/src/cpp.cpp index 3e09321..8749c8d 100644 --- a/src/cpp.cpp +++ b/src/cpp.cpp @@ -945,7 +945,7 @@ void writeCppObject(QTextStream& cpp, const Object& o, const Configuration& conf .arg(p.name, p.type.name); } } - cpp << " m_d(0),\n m_ownsPrivate(false)\n{\n"; + cpp << " m_d(nullptr),\n m_ownsPrivate(false)\n{\n"; if (o.type != ObjectType::Object) { cpp << " initHeaderData();\n"; } diff --git a/tests/test_functions_rust.cpp b/tests/test_functions_rust.cpp index 03d82e1..48429f0 100644 --- a/tests/test_functions_rust.cpp +++ b/tests/test_functions_rust.cpp @@ -37,7 +37,7 @@ extern "C" { Person::Person(bool /*owned*/, QObject *parent): QObject(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } diff --git a/tests/test_list_rust.cpp b/tests/test_list_rust.cpp index 96ce2ff..da1989b 100644 --- a/tests/test_list_rust.cpp +++ b/tests/test_list_rust.cpp @@ -397,7 +397,7 @@ extern "C" { NoRole::NoRole(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData(); @@ -462,7 +462,7 @@ void NoRole::initHeaderData() { } Persons::Persons(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData(); diff --git a/tests/test_list_types_rust.cpp b/tests/test_list_types_rust.cpp index 5c53df4..52dcb89 100644 --- a/tests/test_list_types_rust.cpp +++ b/tests/test_list_types_rust.cpp @@ -639,7 +639,7 @@ extern "C" { List::List(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData(); diff --git a/tests/test_object_rust.cpp b/tests/test_object_rust.cpp index 43e9ceb..1a553cc 100644 --- a/tests/test_object_rust.cpp +++ b/tests/test_object_rust.cpp @@ -21,7 +21,7 @@ extern "C" { Person::Person(bool /*owned*/, QObject *parent): QObject(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } diff --git a/tests/test_object_types_rust.cpp b/tests/test_object_types_rust.cpp index 91b28f6..002777b 100644 --- a/tests/test_object_types_rust.cpp +++ b/tests/test_object_types_rust.cpp @@ -163,7 +163,7 @@ extern "C" { Object::Object(bool /*owned*/, QObject *parent): QObject(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } diff --git a/tests/test_objects_rust.cpp b/tests/test_objects_rust.cpp index cde6b6a..69a7a5b 100644 --- a/tests/test_objects_rust.cpp +++ b/tests/test_objects_rust.cpp @@ -34,7 +34,7 @@ extern "C" { Group::Group(bool /*owned*/, QObject *parent): QObject(parent), m_person(new Person(false, this)), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } @@ -65,7 +65,7 @@ Person* Group::person() } InnerObject::InnerObject(bool /*owned*/, QObject *parent): QObject(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } @@ -95,7 +95,7 @@ void InnerObject::setDescription(const QString& v) { Person::Person(bool /*owned*/, QObject *parent): QObject(parent), m_object(new InnerObject(false, this)), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { } diff --git a/tests/test_tree_rust.cpp b/tests/test_tree_rust.cpp index 375aa2d..2baa0d9 100644 --- a/tests/test_tree_rust.cpp +++ b/tests/test_tree_rust.cpp @@ -248,7 +248,7 @@ extern "C" { Persons::Persons(bool /*owned*/, QObject *parent): QAbstractItemModel(parent), - m_d(0), + m_d(nullptr), m_ownsPrivate(false) { initHeaderData();