From 5e2635e3456f2a4251f8194b3115382e63fdb49b Mon Sep 17 00:00:00 2001 From: Mate Barany Date: Fri, 12 Jul 2024 11:25:50 +0200 Subject: [PATCH] Use NSDMI to initialize the member variables of QIpPacketHeader While adding senderPort to the initializer list of the constructor we have decided that NSDMI would be a better approach for the member variables. Task-number: QTBUG-125026 Pick-to: 6.8 6.7 6.5 Change-Id: Ibc65251f99a66f1d7ee0c3570e608c2b534aa8b3 Reviewed-by: Thiago Macieira Reviewed-by: Marc Mutz --- src/network/kernel/qnetworkdatagram_p.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/network/kernel/qnetworkdatagram_p.h b/src/network/kernel/qnetworkdatagram_p.h index aae01f5c81e..496d48f58c9 100644 --- a/src/network/kernel/qnetworkdatagram_p.h +++ b/src/network/kernel/qnetworkdatagram_p.h @@ -24,9 +24,7 @@ class QIpPacketHeader { public: QIpPacketHeader(const QHostAddress &dstAddr = QHostAddress(), quint16 port = 0) - : destinationAddress(dstAddr), ifindex(0), hopLimit(-1), streamNumber(-1), - senderPort(0), - destinationPort(port), endOfRecord(false) + : destinationAddress(dstAddr), destinationPort(port) {} void clear() @@ -42,12 +40,12 @@ public: QHostAddress senderAddress; QHostAddress destinationAddress; - uint ifindex; - int hopLimit; - int streamNumber; - quint16 senderPort; + uint ifindex = 0; + int hopLimit = -1; + int streamNumber = -1; + quint16 senderPort = 0; quint16 destinationPort; - bool endOfRecord; + bool endOfRecord = false; }; class QNetworkDatagramPrivate