summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2023-09-13 11:48:02 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2023-09-14 11:50:18 +0200
commite4eabbf3e4e1791010df45c590f5e7c4fe6da159 (patch)
tree266f20583103cb99084cf28ec518bbb2f7c799cf /src/dbus
parentb2aeac9891feb1e862d3f847a0695698efff8bbc (diff)
QDBusArgumentPrivate: Initialize member variables inline
For better readability and ease of modification. Do the same for derived classes. Change-Id: I9601f0b280feb5e3d0e71ed4a3405fdd9cca8dd2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusargument_p.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/dbus/qdbusargument_p.h b/src/dbus/qdbusargument_p.h
index 719da7472f..a4e121cdfa 100644
--- a/src/dbus/qdbusargument_p.h
+++ b/src/dbus/qdbusargument_p.h
@@ -34,9 +34,7 @@ class QDBusDemarshaller;
class QDBusArgumentPrivate
{
public:
- inline QDBusArgumentPrivate(int flags = 0)
- : message(nullptr), ref(1), capabilities(flags)
- { }
+ inline QDBusArgumentPrivate(int flags = 0) : capabilities(flags) { }
virtual ~QDBusArgumentPrivate();
static bool checkRead(QDBusArgumentPrivate *d);
@@ -55,8 +53,8 @@ public:
static inline QDBusArgumentPrivate *d(QDBusArgument &q)
{ return q.d; }
- DBusMessage *message;
- QAtomicInt ref;
+ DBusMessage *message = nullptr;
+ QAtomicInt ref = 1;
int capabilities;
enum Direction {
Marshalling,
@@ -67,8 +65,7 @@ public:
class QDBusMarshaller: public QDBusArgumentPrivate
{
public:
- QDBusMarshaller(int flags) : QDBusArgumentPrivate(flags), parent(nullptr), ba(nullptr), closeCode(0), ok(true), skipSignature(false)
- { direction = Marshalling; }
+ QDBusMarshaller(int flags) : QDBusArgumentPrivate(flags) { direction = Marshalling; }
~QDBusMarshaller();
QString currentSignature();
@@ -109,12 +106,12 @@ public:
bool appendCrossMarshalling(QDBusDemarshaller *arg);
DBusMessageIter iterator;
- QDBusMarshaller *parent;
- QByteArray *ba;
+ QDBusMarshaller *parent = nullptr;
+ QByteArray *ba = nullptr;
QString errorString;
- char closeCode;
- bool ok;
- bool skipSignature;
+ char closeCode = 0;
+ bool ok = true;
+ bool skipSignature = false;
private:
Q_DECL_COLD_FUNCTION void unregisteredTypeError(QMetaType t);
@@ -124,8 +121,7 @@ private:
class QDBusDemarshaller: public QDBusArgumentPrivate
{
public:
- inline QDBusDemarshaller(int flags) : QDBusArgumentPrivate(flags), parent(nullptr)
- { direction = Demarshalling; }
+ inline QDBusDemarshaller(int flags) : QDBusArgumentPrivate(flags) { direction = Demarshalling; }
~QDBusDemarshaller();
QString currentSignature();
@@ -167,7 +163,7 @@ public:
bool isCurrentTypeStringLike();
DBusMessageIter iterator;
- QDBusDemarshaller *parent;
+ QDBusDemarshaller *parent = nullptr;
private:
Q_DISABLE_COPY_MOVE(QDBusDemarshaller)