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

Unified Diff: src/internet/model/udp-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/udp-header.h ('k') | src/internet/model/udp-socket-impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/internet/model/udp-header.cc
===================================================================
--- a/src/internet/model/udp-header.cc
+++ b/src/internet/model/udp-header.cc
@@ -132,6 +132,12 @@
return ~(it.CalculateIpChecksum (hdrSize));
}
+uint16_t
+UdpHeader::CalculateHeaderChecksum(uint32_t size) const
+{
+ return CalculateHeaderChecksum(static_cast<uint16_t> (size));
+}
+
bool
UdpHeader::IsChecksumOk (void) const
{
@@ -189,7 +195,7 @@
i.WriteHtonU16 (m_destinationPort);
if (m_payloadSize == 0)
{
- i.WriteHtonU16 (start.GetSize ());
+ i.WriteHtonU16 (static_cast<uint16_t> (start.GetSize ()));
}
else
{
@@ -222,7 +228,7 @@
Buffer::Iterator i = start;
m_sourcePort = i.ReadNtohU16 ();
m_destinationPort = i.ReadNtohU16 ();
- m_payloadSize = i.ReadNtohU16 () - GetSerializedSize ();
+ m_payloadSize = i.ReadNtohU16 () - static_cast<uint16_t> (GetSerializedSize ());
m_checksum = i.ReadU16 ();
if (m_calcChecksum)
« no previous file with comments | « src/internet/model/udp-header.h ('k') | src/internet/model/udp-socket-impl.cc » ('j') | no next file with comments »

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