Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2735)

Unified Diff: src/network/utils/packetbb.cc

Issue 339780043: Eliminate Visual Studio compiler warnings (Closed)
Patch Set: Update patch with latest module changes Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/network/utils/packet-socket-address.cc ('k') | src/network/utils/pcap-file-wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/network/utils/packetbb.cc
===================================================================
--- a/src/network/utils/packetbb.cc
+++ b/src/network/utils/packetbb.cc
@@ -104,7 +104,7 @@
PbbTlvBlock::Size (void) const
{
NS_LOG_FUNCTION (this);
- return m_tlvList.size ();
+ return static_cast<int> (m_tlvList.size ());
}
bool
@@ -220,7 +220,7 @@
(*iter)->Serialize (start);
}
/* - 2 to not include the size field */
- uint16_t size = start.GetDistanceFrom (tlvsize) - 2;
+ uint16_t size = static_cast<uint16_t> (start.GetDistanceFrom (tlvsize) - 2);
tlvsize.WriteHtonU16 (size);
}
@@ -345,7 +345,7 @@
PbbAddressTlvBlock::Size (void) const
{
NS_LOG_FUNCTION (this);
- return m_tlvList.size ();
+ return static_cast<int> (m_tlvList.size ());
}
bool
@@ -461,7 +461,7 @@
(*iter)->Serialize (start);
}
/* - 2 to not include the size field */
- uint16_t size = start.GetDistanceFrom (tlvsize) - 2;
+ uint16_t size = static_cast<uint16_t> (start.GetDistanceFrom (tlvsize) - 2);
tlvsize.WriteHtonU16 (size);
}
@@ -741,7 +741,7 @@
PbbPacket::MessageSize (void) const
{
NS_LOG_FUNCTION (this);
- return m_messageList.size ();
+ return static_cast<int> (m_messageList.size ());
}
bool
@@ -1307,7 +1307,7 @@
PbbMessage::AddressBlockSize (void) const
{
NS_LOG_FUNCTION (this);
- return m_addressBlockList.size ();
+ return static_cast<int> (m_addressBlockList.size ());
}
bool
@@ -1452,9 +1452,7 @@
Buffer::Iterator bufref = start;
start.Next (1);
- uint8_t flags = 0;
-
- flags = GetAddressLength ();
+ uint8_t flags = static_cast<uint8_t> (GetAddressLength ());
Buffer::Iterator sizeref = start;
start.Next (2);
@@ -1494,7 +1492,7 @@
(*iter)->Serialize (start);
}
- sizeref.WriteHtonU16 (front.GetDistanceFrom (start));
+ sizeref.WriteHtonU16 (static_cast<uint16_t> (front.GetDistanceFrom (start)));
}
Ptr<PbbMessage>
@@ -1879,7 +1877,7 @@
PbbAddressBlock::AddressSize (void) const
{
NS_LOG_FUNCTION (this);
- return m_addressList.size ();
+ return static_cast<int> (m_addressList.size ());
}
bool
@@ -1987,7 +1985,7 @@
PbbAddressBlock::PrefixSize (void) const
{
NS_LOG_FUNCTION (this);
- return m_prefixList.size ();
+ return static_cast<int> (m_prefixList.size ());
}
bool
@@ -2240,7 +2238,7 @@
PbbAddressBlock::Serialize (Buffer::Iterator &start) const
{
NS_LOG_FUNCTION (this << &start);
- start.WriteU8 (AddressSize ());
+ start.WriteU8 (static_cast<uint8_t> (AddressSize ()));
Buffer::Iterator bufref = start;
uint8_t flags = 0;
start.Next ();
@@ -2506,7 +2504,7 @@
{
SerializeAddress (bufcur, iter);
- int i;
+ uint8_t i = 0;
for (i = 0; i < headlen; i++)
{
if (buflast[i] != bufcur[i])
@@ -2867,11 +2865,11 @@
if (size > 255)
{
flags |= THAS_EXT_LEN;
- start.WriteHtonU16 (size);
+ start.WriteHtonU16 (static_cast<uint16_t> (size));
}
else
{
- start.WriteU8 (size);
+ start.WriteU8 (static_cast<uint8_t> (size));
}
if (IsMultivalue ())
« no previous file with comments | « src/network/utils/packet-socket-address.cc ('k') | src/network/utils/pcap-file-wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b