Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21008d57 authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Const-ify deserializing raw address

Bug: 187830698
Tag: #refactor
Test: gd/cert/run

Change-Id: I91d884e91cce827031805e18d0204f2693a1003d
parent 373cef9e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -88,6 +88,12 @@ inline void BDADDR_TO_STREAM(uint8_t*& p, const RawAddress& a) {
    *(p)++ = (uint8_t)(a.address)[BD_ADDR_LEN - 1 - ijk];
}

inline void STREAM_TO_BDADDR(RawAddress& a, const uint8_t*& p) {
  uint8_t* pbda = (uint8_t*)(a.address) + BD_ADDR_LEN - 1;
  for (int ijk = 0; ijk < BD_ADDR_LEN; ijk++) *pbda-- = *(p)++;
}

// DEPRECATED
inline void STREAM_TO_BDADDR(RawAddress& a, uint8_t*& p) {
  uint8_t* pbda = (uint8_t*)(a.address) + BD_ADDR_LEN - 1;
  for (int ijk = 0; ijk < BD_ADDR_LEN; ijk++) *pbda-- = *(p)++;