[mac] clean up extended address usage (#2413)

- Replace `memcmp` with `==` and `!=` operators.
- Replace `memcpy` with `=` assignment.
- Change pointers to reference where applicable.
This commit is contained in:
Jonathan Hui
2017-12-13 07:12:23 +00:00
committed by GitHub
parent 3364688218
commit 0606b0aefa
19 changed files with 104 additions and 74 deletions
+1 -2
View File
@@ -357,8 +357,7 @@ otError otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo)
VerifyOrExit(aParentInfo != NULL, error = OT_ERROR_INVALID_ARGS);
parent = instance.GetThreadNetif().GetMle().GetParent();
memcpy(aParentInfo->mExtAddress.m8, &parent->GetExtAddress(), sizeof(aParentInfo->mExtAddress));
aParentInfo->mExtAddress = parent->GetExtAddress();
aParentInfo->mRloc16 = parent->GetRloc16();
aParentInfo->mRouterId = Mle::Mle::GetRouterId(parent->GetRloc16());
aParentInfo->mNextHop = parent->GetNextHop();