core, dsr: Fix clang-tidy warnings

This commit is contained in:
Eduardo Almeida
2023-05-29 15:18:41 +01:00
parent 6923de623c
commit e103d6d810
2 changed files with 10 additions and 19 deletions

View File

@@ -307,7 +307,7 @@ NamesPriv::Clear()
++i)
{
delete i->second;
i->second = 0;
i->second = nullptr;
}
m_objectMap.clear();

View File

@@ -417,14 +417,11 @@ DsrOptionRreqHeader::Deserialize(Buffer::Iterator start)
m_identification = i.ReadNtohU16();
ReadFrom(i, m_target);
uint8_t index = 0;
for (std::vector<Ipv4Address>::iterator it = m_ipv4Address.begin(); it != m_ipv4Address.end();
it++)
for (std::size_t index = 0; index < m_ipv4Address.size(); index++)
{
i.Read(buff, 4);
m_address = it->Deserialize(buff);
SetNodeAddress(index, m_address);
++index;
m_address = Ipv4Address::Deserialize(buff);
SetNodeAddress(static_cast<uint8_t>(index), m_address);
}
return GetSerializedSize();
@@ -555,14 +552,11 @@ DsrOptionRrepHeader::Deserialize(Buffer::Iterator start)
i.ReadU8();
i.ReadU8();
uint8_t index = 0;
for (std::vector<Ipv4Address>::iterator it = m_ipv4Address.begin(); it != m_ipv4Address.end();
it++)
for (std::size_t index = 0; index < m_ipv4Address.size(); index++)
{
i.Read(buff, 4);
m_address = it->Deserialize(buff);
SetNodeAddress(index, m_address);
++index;
m_address = Ipv4Address::Deserialize(buff);
SetNodeAddress(static_cast<uint8_t>(index), m_address);
}
return GetSerializedSize();
@@ -718,14 +712,11 @@ DsrOptionSRHeader::Deserialize(Buffer::Iterator start)
m_salvage = i.ReadU8();
m_segmentsLeft = i.ReadU8();
uint8_t index = 0;
for (std::vector<Ipv4Address>::iterator it = m_ipv4Address.begin(); it != m_ipv4Address.end();
it++)
for (std::size_t index = 0; index < m_ipv4Address.size(); index++)
{
i.Read(buff, 4);
m_address = it->Deserialize(buff);
SetNodeAddress(index, m_address);
++index;
m_address = Ipv4Address::Deserialize(buff);
SetNodeAddress(static_cast<uint8_t>(index), m_address);
}
return GetSerializedSize();