mirror of
https://github.com/espressif/openthread.git
synced 2026-08-01 08:37:47 +00:00
[core] replace memcpy with assignment (#5280)
Also remove few unncessary uses of `this` pointer.
This commit is contained in:
@@ -252,7 +252,7 @@ otError otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageI
|
||||
|
||||
netifAddr = instance.Get<Ip6::Ip6>().SelectSourceAddress(*static_cast<Ip6::MessageInfo *>(aMessageInfo));
|
||||
VerifyOrExit(netifAddr != nullptr, error = OT_ERROR_NOT_FOUND);
|
||||
memcpy(&aMessageInfo->mSockAddr, &netifAddr->mAddress, sizeof(aMessageInfo->mSockAddr));
|
||||
aMessageInfo->mSockAddr = netifAddr->GetAddress();
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -306,7 +306,7 @@ Message *Message::Clone(uint16_t aLength) const
|
||||
|
||||
VerifyOrExit(message != nullptr, OT_NOOP);
|
||||
|
||||
memcpy(&message->GetHelpData(), &GetHelpData(), sizeof(GetHelpData()));
|
||||
message->GetHelpData() = GetHelpData();
|
||||
|
||||
exit:
|
||||
return message;
|
||||
|
||||
@@ -284,8 +284,8 @@ public:
|
||||
*/
|
||||
bool IsTokenEqual(const Message &aMessage) const
|
||||
{
|
||||
return ((this->GetTokenLength() == aMessage.GetTokenLength()) &&
|
||||
(memcmp(this->GetToken(), aMessage.GetToken(), this->GetTokenLength()) == 0));
|
||||
return ((GetTokenLength() == aMessage.GetTokenLength()) &&
|
||||
(memcmp(GetToken(), aMessage.GetToken(), GetTokenLength()) == 0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1522,7 +1522,7 @@ void Mle::HandleNotifierEvents(Events aEvents)
|
||||
Get<BackboneRouter::Leader>().Update();
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
|
||||
this->UpdateServiceAlocs();
|
||||
UpdateServiceAlocs();
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user