mirror of
https://github.com/espressif/openthread.git
synced 2026-07-26 22:09:05 +00:00
[dns-client] remove memset(zero) from constructor (#4195)
This commit is contained in:
committed by
Jonathan Hui
parent
726d8e96e3
commit
26743fae04
@@ -49,6 +49,30 @@ using ot::Encoding::BigEndian::HostSwap16;
|
||||
namespace ot {
|
||||
namespace Dns {
|
||||
|
||||
QueryMetadata::QueryMetadata(void)
|
||||
: mHostname(NULL)
|
||||
, mResponseHandler(NULL)
|
||||
, mResponseContext(NULL)
|
||||
, mTransmissionTime()
|
||||
, mDestinationPort(0)
|
||||
, mRetransmissionCount(0)
|
||||
{
|
||||
mSourceAddress.Clear();
|
||||
mDestinationAddress.Clear();
|
||||
}
|
||||
|
||||
QueryMetadata::QueryMetadata(otDnsResponseHandler aHandler, void *aContext)
|
||||
: mHostname(NULL)
|
||||
, mResponseHandler(aHandler)
|
||||
, mResponseContext(aContext)
|
||||
, mTransmissionTime()
|
||||
, mDestinationPort(0)
|
||||
, mRetransmissionCount(0)
|
||||
{
|
||||
mSourceAddress.Clear();
|
||||
mDestinationAddress.Clear();
|
||||
}
|
||||
|
||||
Client::Client(Ip6::Netif &aNetif)
|
||||
: mSocket(aNetif.Get<Ip6::Udp>())
|
||||
, mMessageId(0)
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
* Default constructor for the object.
|
||||
*
|
||||
*/
|
||||
QueryMetadata(void) { memset(this, 0, sizeof(*this)); }
|
||||
QueryMetadata(void);
|
||||
|
||||
/**
|
||||
* This constructor initializes the object with specific values.
|
||||
@@ -69,12 +69,7 @@ public:
|
||||
* @param[in] aContext Context for the handler function.
|
||||
*
|
||||
*/
|
||||
QueryMetadata(otDnsResponseHandler aHandler, void *aContext)
|
||||
{
|
||||
memset(this, 0, sizeof(*this));
|
||||
mResponseHandler = aHandler;
|
||||
mResponseContext = aContext;
|
||||
}
|
||||
QueryMetadata(otDnsResponseHandler aHandler, void *aContext);
|
||||
|
||||
/**
|
||||
* This method appends request data to the message.
|
||||
|
||||
Reference in New Issue
Block a user