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

Unified Diff: src/internet/model/ipv6-extension-header.cc

Issue 337950043: Eliminate Visual Studio compiler warnings (Closed)
Patch Set: Update patch for 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/internet/model/ipv6-extension.cc ('k') | src/internet/model/ipv6-header.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/internet/model/ipv6-extension-header.cc
===================================================================
--- a/src/internet/model/ipv6-extension-header.cc
+++ b/src/internet/model/ipv6-extension-header.cc
@@ -21,6 +21,7 @@
#include "ns3/assert.h"
#include "ns3/log.h"
#include "ns3/header.h"
+#include "ns3/unused.h"
#include "ipv6-extension-header.h"
namespace ns3
@@ -72,7 +73,7 @@
NS_ASSERT_MSG (length > 0, "Invalid Ipv6ExtensionHeader Length, must be greater than 0.");
NS_ASSERT_MSG (length < 2048, "Invalid Ipv6ExtensionHeader Length, must be a lower than 2048.");
- m_length = (length >> 3) - 1;
+ m_length = static_cast<uint8_t> (length >> 3) - 1;
}
uint16_t Ipv6ExtensionHeader::GetLength () const
@@ -138,13 +139,19 @@
uint32_t OptionField::GetSerializedSize () const
{
- return m_optionData.GetSize () + CalculatePad ((Ipv6OptionHeader::Alignment) { 8,0});
+ Ipv6OptionHeader::Alignment alignment;
+ alignment.factor = 8;
+ alignment.offset = 0;
+ return m_optionData.GetSize () + CalculatePad (alignment);
}
void OptionField::Serialize (Buffer::Iterator start) const
{
start.Write (m_optionData.Begin (), m_optionData.End ());
- uint32_t fill = CalculatePad ((Ipv6OptionHeader::Alignment) { 8,0});
+ Ipv6OptionHeader::Alignment alignment;
+ alignment.factor = 8;
+ alignment.offset = 0;
+ uint32_t fill = CalculatePad (alignment);
NS_LOG_LOGIC ("fill with " << fill << " bytes padding");
switch (fill)
{
@@ -245,7 +252,7 @@
Buffer::Iterator i = start;
i.WriteU8 (GetNextHeader ());
- i.WriteU8 ((GetSerializedSize () >> 3) - 1);
+ i.WriteU8 (static_cast<uint8_t> (GetSerializedSize () >> 3) - 1);
OptionField::Serialize (i);
}
@@ -301,7 +308,7 @@
Buffer::Iterator i = start;
i.WriteU8 (GetNextHeader ());
- i.WriteU8 ((GetSerializedSize () >> 3) - 1);
+ i.WriteU8 (static_cast<uint8_t> (GetSerializedSize () >> 3) - 1);
OptionField::Serialize (i);
}
@@ -558,7 +565,7 @@
uint32_t Ipv6ExtensionLooseRoutingHeader::GetSerializedSize () const
{
- return 8 + m_routersAddress.size () * 16;
+ return static_cast<uint32_t> (8 + m_routersAddress.size () * 16);
}
void Ipv6ExtensionLooseRoutingHeader::Serialize (Buffer::Iterator start) const
@@ -566,7 +573,7 @@
Buffer::Iterator i = start;
uint8_t buff[16];
- uint8_t addressNum = m_routersAddress.size ();
+ uint8_t addressNum = static_cast<uint8_t> (m_routersAddress.size ());
i.WriteU8 (GetNextHeader ());
i.WriteU8 (addressNum*2);
@@ -631,6 +638,7 @@
void Ipv6ExtensionESPHeader::Print (std::ostream &os) const
{
/** \todo */
+ NS_UNUSED (os);
}
uint32_t Ipv6ExtensionESPHeader::GetSerializedSize () const
@@ -642,11 +650,13 @@
void Ipv6ExtensionESPHeader::Serialize (Buffer::Iterator start) const
{
/** \todo */
+ NS_UNUSED (start);
}
uint32_t Ipv6ExtensionESPHeader::Deserialize (Buffer::Iterator start)
{
/** \todo */
+ NS_UNUSED (start);
return 0;
}
@@ -678,6 +688,7 @@
void Ipv6ExtensionAHHeader::Print (std::ostream &os) const
{
/** \todo */
+ NS_UNUSED (os);
}
uint32_t Ipv6ExtensionAHHeader::GetSerializedSize () const
@@ -689,11 +700,13 @@
void Ipv6ExtensionAHHeader::Serialize (Buffer::Iterator start) const
{
/** \todo */
+ NS_UNUSED (start);
}
uint32_t Ipv6ExtensionAHHeader::Deserialize (Buffer::Iterator start)
{
/** \todo */
+ NS_UNUSED (start);
return 0;
}
« no previous file with comments | « src/internet/model/ipv6-extension.cc ('k') | src/internet/model/ipv6-header.h » ('j') | no next file with comments »

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