From e9e80fa69aeb3a42b64e35b9eea0a4770a777c97 Mon Sep 17 00:00:00 2001 From: Hossam Khader Date: Tue, 14 Jun 2016 22:56:28 +0200 Subject: [PATCH] sixlowpan: (fixes #2439) SixLowPan headers needs casts to int in some places --- RELEASE_NOTES | 1 + src/sixlowpan/model/sixlowpan-header.cc | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 80b12fe20..1305871d9 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -71,6 +71,7 @@ Bugs fixed - Bug 2433 - Bic does not copy private parameters - Bug 2436 - SendBlockAckAfterAmpdu is called even if the A-MPDU frame is not addressed to the station - Bug 2438 - Routing protocols should stop processing packets coming from a non-forwarding interface +- Bug 2439 - SixLowPan Compression kind need to be casted to int in the Print function Known issues ------------ diff --git a/src/sixlowpan/model/sixlowpan-header.cc b/src/sixlowpan/model/sixlowpan-header.cc index 782e59b8c..e383f50ec 100644 --- a/src/sixlowpan/model/sixlowpan-header.cc +++ b/src/sixlowpan/model/sixlowpan-header.cc @@ -128,7 +128,7 @@ void SixLowPanHc1::Print (std::ostream & os) const encoding <<= 1; encoding |= m_hc2HeaderPresent; - os << "encoding " << int(encoding) << ", hopLimit " << int(m_hopLimit); + os << "encoding " << static_cast (encoding) << ", hopLimit " << static_cast (m_hopLimit); } uint32_t SixLowPanHc1::GetSerializedSize () const @@ -655,7 +655,7 @@ TypeId SixLowPanFragN::GetInstanceTypeId (void) const void SixLowPanFragN::Print (std::ostream & os) const { - os << "datagram size " << m_datagramSize << " tag " << m_datagramTag << " offset " << int(m_datagramOffset); + os << "datagram size " << m_datagramSize << " tag " << m_datagramTag << " offset " << static_cast (m_datagramOffset); } uint32_t SixLowPanFragN::GetSerializedSize () const @@ -815,7 +815,7 @@ TypeId SixLowPanIphc::GetInstanceTypeId (void) const void SixLowPanIphc::Print (std::ostream & os) const { - os << "Compression kind: " << m_baseFormat; + os << "Compression kind: " << static_cast (m_baseFormat); } uint32_t SixLowPanIphc::GetSerializedSize () const @@ -1508,7 +1508,7 @@ TypeId SixLowPanNhcExtension::GetInstanceTypeId (void) const void SixLowPanNhcExtension::Print (std::ostream & os) const { - os << "Compression kind: " << int (m_nhcExtensionHeader) << " Size: " << int(GetSerializedSize ()); + os << "Compression kind: " << static_cast (m_nhcExtensionHeader) << " Size: " << GetSerializedSize (); } uint32_t SixLowPanNhcExtension::GetSerializedSize () const @@ -1637,7 +1637,7 @@ TypeId SixLowPanUdpNhcExtension::GetInstanceTypeId (void) const void SixLowPanUdpNhcExtension::Print (std::ostream & os) const { - os << "Compression kind: " << uint8_t (m_baseFormat); + os << "Compression kind: " << static_cast (m_baseFormat); } uint32_t SixLowPanUdpNhcExtension::GetSerializedSize () const