[clang-tidy] readability-redundant-member-init (#5781)

This commit is contained in:
Jonathan Hui
2020-11-07 19:45:28 -08:00
committed by GitHub
parent 753089865b
commit 451d8827ad
20 changed files with 4 additions and 50 deletions
+1
View File
@@ -125,6 +125,7 @@ modernize-use-equals-delete,\
modernize-use-nullptr,\
readability-avoid-const-params-in-decls,\
readability-make-member-function-const,\
readability-redundant-member-init,\
readability-simplify-boolean-expr,\
readability-static-accessed-through-instance,\
"
+1 -4
View File
@@ -48,10 +48,8 @@ namespace Coap {
CoapBase::CoapBase(Instance &aInstance, Sender aSender)
: InstanceLocator(aInstance)
, mPendingRequests()
, mMessageId(Random::NonCrypto::GetUint16())
, mRetransmissionTimer(aInstance, Coap::HandleRetransmissionTimer, this)
, mResources()
, mContext(nullptr)
, mInterceptor(nullptr)
, mResponsesQueue(aInstance)
@@ -764,8 +762,7 @@ void CoapBase::Metadata::UpdateIn(Message &aMessage) const
}
ResponsesQueue::ResponsesQueue(Instance &aInstance)
: mQueue()
, mTimer(aInstance, ResponsesQueue::HandleTimer, this)
: mTimer(aInstance, ResponsesQueue::HandleTimer, this)
{
}
+1 -4
View File
@@ -902,10 +902,7 @@ public:
* This constructor initializes the message queue.
*
*/
MessageQueue(void)
: ot::MessageQueue()
{
}
MessageQueue(void) = default;
/**
* This method returns a pointer to the first message.
-1
View File
@@ -50,7 +50,6 @@ CoapSecure::CoapSecure(Instance &aInstance, bool aLayerTwoSecurity)
, mDtls(aInstance, aLayerTwoSecurity)
, mConnectedCallback(nullptr)
, mConnectedContext(nullptr)
, mTransmitQueue()
, mTransmitTask(aInstance, CoapSecure::HandleTransmit, this)
{
}
+1 -9
View File
@@ -59,18 +59,10 @@ otHeapCAllocFn ot::Instance::mCAlloc = nullptr;
#endif // OPENTHREAD_MTD || OPENTHREAD_FTD
Instance::Instance(void)
: mTaskletScheduler()
, mTimerMilliScheduler(*this)
: mTimerMilliScheduler(*this)
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
, mTimerMicroScheduler(*this)
#endif
#if OPENTHREAD_MTD || OPENTHREAD_FTD
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && !OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
, mHeap()
#endif
, mMbedTls()
#endif // #if OPENTHREAD_MTD || OPENTHREAD_FTD
, mRandomManager()
, mRadio(*this)
#if OPENTHREAD_MTD || OPENTHREAD_FTD
, mNotifier(*this)
-1
View File
@@ -47,7 +47,6 @@ MessagePool::MessagePool(Instance &aInstance)
: InstanceLocator(aInstance)
#if !OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT
, mNumFreeBuffers(kNumBuffers)
, mBufferPool()
#endif
{
#if OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT
-2
View File
@@ -42,8 +42,6 @@ namespace ot {
Notifier::Notifier(Instance &aInstance)
: InstanceLocator(aInstance)
, mEventsToSignal()
, mSignaledEvents()
, mTask(aInstance, Notifier::EmitEvents, this)
{
for (ExternalCallback &callback : mExternalCallbacks)
-1
View File
@@ -276,7 +276,6 @@ protected:
*/
explicit TimerScheduler(Instance &aInstance)
: InstanceLocator(aInstance)
, mTimerList()
{
}
-8
View File
@@ -102,13 +102,8 @@ Mac::Mac(Instance &aInstance)
, mPanChannel(OPENTHREAD_CONFIG_DEFAULT_CHANNEL)
, mRadioChannel(OPENTHREAD_CONFIG_DEFAULT_CHANNEL)
, mSupportedChannelMask(Get<Radio>().GetSupportedChannelMask())
, mNetworkName()
#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
, mDomainName()
#endif
, mScanChannel(Radio::kChannelMin)
, mScanDuration(0)
, mScanChannelMask()
, mMaxFrameRetriesDirect(kDefaultMaxFrameRetriesDirect)
#if OPENTHREAD_FTD
, mMaxFrameRetriesIndirect(kDefaultMaxFrameRetriesIndirect)
@@ -124,9 +119,6 @@ Mac::Mac(Instance &aInstance)
, mOobFrame(nullptr)
, mKeyIdMode2FrameCounter(0)
, mCcaSampleCount(0)
#if OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
, mFilter()
#endif
{
ExtAddress randomExtAddress;
-1
View File
@@ -47,7 +47,6 @@ namespace Ip6 {
Icmp::Icmp(Instance &aInstance)
: InstanceLocator(aInstance)
, mHandlers()
, mEchoSequence(1)
, mEchoMode(OT_ICMP6_ECHO_HANDLER_ALL)
{
-1
View File
@@ -60,7 +60,6 @@ Ip6::Ip6(Instance &aInstance)
, mIsReceiveIp6FilterEnabled(false)
, mReceiveIp6DatagramCallback(nullptr)
, mReceiveIp6DatagramCallbackContext(nullptr)
, mSendQueue()
, mSendQueueTask(aInstance, Ip6::HandleSendQueue, this)
, mIcmp(aInstance)
, mUdp(aInstance)
-4
View File
@@ -105,13 +105,9 @@ const otNetifMulticastAddress Netif::kLinkLocalAllRoutersMulticastAddress = {
Netif::Netif(Instance &aInstance)
: InstanceLocator(aInstance)
, mUnicastAddresses()
, mMulticastAddresses()
, mMulticastPromiscuous(false)
, mAddressCallback(nullptr)
, mAddressCallbackContext(nullptr)
, mExtUnicastAddressPool()
, mExtMulticastAddressPool()
{
}
-2
View File
@@ -176,8 +176,6 @@ exit:
Udp::Udp(Instance &aInstance)
: InstanceLocator(aInstance)
, mEphemeralPort(kDynamicPortMin)
, mReceivers()
, mSockets()
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
, mPrevBackboneSockets(nullptr)
#endif
-4
View File
@@ -57,10 +57,6 @@ AddressResolver::AddressResolver(Instance &aInstance)
, mAddressQuery(UriPath::kAddressQuery, &AddressResolver::HandleAddressQuery, this)
, mAddressNotification(UriPath::kAddressNotify, &AddressResolver::HandleAddressNotification, this)
, mCacheEntryPool(aInstance)
, mCachedList()
, mSnoopedList()
, mQueryList()
, mQueryRetryList()
, mIcmpHandler(&AddressResolver::HandleIcmpReceive, this)
{
Get<Tmf::TmfAgent>().AddResource(mAddressError);
-1
View File
@@ -48,7 +48,6 @@ namespace ot {
AnnounceSenderBase::AnnounceSenderBase(Instance &aInstance, Timer::Handler aHandler)
: InstanceLocator(aInstance)
, mChannelMask()
, mPeriod(0)
, mJitter(0)
, mCount(0)
-1
View File
@@ -50,7 +50,6 @@ DiscoverScanner::DiscoverScanner(Instance &aInstance)
, mHandlerContext(nullptr)
, mTimer(aInstance, DiscoverScanner::HandleTimer, this)
, mFilterIndexes()
, mScanChannels()
, mState(kStateIdle)
, mScanChannel(0)
, mAdvDataLength(0)
-1
View File
@@ -108,7 +108,6 @@ LinkMetrics::LinkMetrics(Instance &aInstance)
: InstanceLocator(aInstance)
, mLinkMetricsReportCallback(nullptr)
, mLinkMetricsReportCallbackContext(nullptr)
, mLinkMetricsSeriesInfoPool()
{
}
-1
View File
@@ -62,7 +62,6 @@ public:
: mNcpBuffer(aNcpBuffer)
, mNumOpenStructs(0)
, mSavedNumOpenStructs(0)
, mSavedPosition()
{
}
-2
View File
@@ -197,7 +197,6 @@ NcpBase::NcpBase(Instance *aInstance)
: mInstance(aInstance)
, mTxFrameBuffer(mTxBuffer, sizeof(mTxBuffer))
, mEncoder(mTxFrameBuffer)
, mDecoder()
, mHostPowerStateInProgress(false)
, mLastStatus(SPINEL_STATUS_OK)
, mScanChannelMask(Radio::kSupportedChannels)
@@ -207,7 +206,6 @@ NcpBase::NcpBase(Instance *aInstance)
, mDiscoveryScanPanId(0xffff)
, mUpdateChangedPropsTask(*aInstance, NcpBase::UpdateChangedProps, this)
, mThreadChangedFlags(0)
, mChangedPropsSet()
, mHostPowerState(SPINEL_HOST_POWER_STATE_ONLINE)
, mHostPowerReplyFrameTag(Spinel::Buffer::kInvalidTag)
, mHostPowerStateHeader(0)
-2
View File
@@ -84,10 +84,8 @@ NcpUart::NcpUart(Instance *aInstance)
: NcpBase(aInstance)
, mFrameEncoder(mUartBuffer)
, mFrameDecoder(mRxBuffer, &NcpUart::HandleFrame, this)
, mUartBuffer()
, mState(kStartingFrame)
, mByte(0)
, mRxBuffer()
, mUartSendImmediate(false)
, mUartSendTask(*aInstance, EncodeAndSendToUart, this)
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER