[clang-tidy] apply readability-make-member-function-const (#5675)

This commit is contained in:
Jonathan Hui
2020-10-22 10:36:59 -07:00
parent 700ef9fe93
commit cf5f5ee08b
12 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ namespace ot {
const TimerScheduler::AlarmApi TimerMilliScheduler::sAlarmMilliApi = {&otPlatAlarmMilliStartAt, &otPlatAlarmMilliStop,
&otPlatAlarmMilliGetNow};
bool Timer::DoesFireBefore(const Timer &aSecondTimer, Time aNow)
bool Timer::DoesFireBefore(const Timer &aSecondTimer, Time aNow) const
{
bool retval;
bool isBeforeNow = (GetFireTime() < aNow);
+1 -1
View File
@@ -132,7 +132,7 @@ protected:
* @retval FALSE If the fire time of this timer object is the same or after aTimer's fire time.
*
*/
bool DoesFireBefore(const Timer &aSecondTimer, Time aNow);
bool DoesFireBefore(const Timer &aSecondTimer, Time aNow) const;
void Fired(void) { mHandler(*this); }
+1 -1
View File
@@ -89,7 +89,7 @@ private:
struct JoinerEntrustMetadata
{
otError AppendTo(Message &aMessage) { return aMessage.Append(*this); }
otError AppendTo(Message &aMessage) const { return aMessage.Append(*this); }
void ReadFrom(const Message &aMessage);
Ip6::MessageInfo mMessageInfo; // Message info of the message to send.
+1 -1
View File
@@ -106,7 +106,7 @@ public:
* @returns The MPL Seed Id Length value.
*
*/
SeedIdLength GetSeedIdLength(void) { return static_cast<SeedIdLength>(mControl & kSeedIdLengthMask); }
SeedIdLength GetSeedIdLength(void) const { return static_cast<SeedIdLength>(mControl & kSeedIdLengthMask); }
/**
* This method sets the MPL Seed Id Length value.
+1 -1
View File
@@ -151,7 +151,7 @@ void CslTxScheduler::RescheduleCslTx(void)
mCslTxChild = bestChild;
}
uint32_t CslTxScheduler::GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow)
uint32_t CslTxScheduler::GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow) const
{
uint32_t delay;
uint16_t period_offset = (aRadioNow / kUsPerTenSymbols) % aChild.GetCslPeriod();
+1 -1
View File
@@ -190,7 +190,7 @@ private:
void InitFrameRequestAhead(void);
void RescheduleCslTx(void);
uint32_t GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow);
uint32_t GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow) const;
// Callbacks from `Mac`
otError HandleFrameRequest(Mac::TxFrame &aFrame);
+1 -1
View File
@@ -1011,7 +1011,7 @@ exit:
return error;
}
otError Mle::AppendSourceAddress(Message &aMessage)
otError Mle::AppendSourceAddress(Message &aMessage) const
{
return Tlv::AppendUint16Tlv(aMessage, Tlv::kSourceAddress, GetRloc16());
}
+1 -1
View File
@@ -935,7 +935,7 @@ protected:
* @retval OT_ERROR_NO_BUFS Insufficient buffers available to append the Source Address TLV.
*
*/
otError AppendSourceAddress(Message &aMessage);
otError AppendSourceAddress(Message &aMessage) const;
/**
* This method appends a Mode TLV to a message.
+1 -1
View File
@@ -963,7 +963,7 @@ exit:
return error;
}
otError Leader::AllocateServiceId(uint8_t &aServiceId)
otError Leader::AllocateServiceId(uint8_t &aServiceId) const
{
otError error = OT_ERROR_NOT_FOUND;
uint8_t serviceId;
+1 -1
View File
@@ -215,7 +215,7 @@ private:
otError AddService(const ServiceTlv &aService, ChangedFlags &aChangedFlags);
otError AddServer(const ServerTlv &aServer, ServiceTlv &aDstService, ChangedFlags &aChangedFlags);
otError AllocateServiceId(uint8_t &aServiceId);
otError AllocateServiceId(uint8_t &aServiceId) const;
otError AllocateContextId(uint8_t &aConextId);
void FreeContextId(uint8_t aContextId);
+1 -1
View File
@@ -202,7 +202,7 @@ void ChannelMonitor::LogResults(void)
#endif
}
Mac::ChannelMask ChannelMonitor::FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy)
Mac::ChannelMask ChannelMonitor::FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy) const
{
uint8_t channel;
Mac::ChannelMask bestMask;
+1 -1
View File
@@ -183,7 +183,7 @@ public:
* channel with the same occupancy rate value.
*
*/
Mac::ChannelMask FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy);
Mac::ChannelMask FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy) const;
private:
enum