Changed old-style C casts by C++ style casts.
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Mon, 21 Nov 2011 22:49:51 +0000 (20:49 -0200)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Mon, 21 Nov 2011 22:49:51 +0000 (20:49 -0200)
src/ip/pseudoipv4header.h
src/tcp/tcpheader.cpp

index d71a0b9..0538343 100644 (file)
@@ -27,7 +27,7 @@ on this file might be covered by the GNU General Public License.
 
 /**
  * @brief This class represents a Pseudo IP header used to compute checksum of
- * transport level protocols.
+ * transport layer protocols.
  *
  * When TCP runs over IPv4, the method used to compute the checksum is defined
  * in RFC 793.
index fb9ef07..5f743ad 100644 (file)
@@ -141,7 +141,7 @@ uint16_t TcpHeader::calculate_tcp_checksum(
     pseudo_header.protocol = IPPROTO_TCP;
     pseudo_header.header_length = htons( tcp_segment_size_in_bytes );
 
-    uint8_t *pseudo_header_data = (uint8_t *) &pseudo_header;
+    uint8_t *pseudo_header_data = reinterpret_cast<uint8_t *>( &pseudo_header );
     size_t pseudo_header_size_in_bytes = sizeof(pseudo_header);
 
     uint8_t *tcp_header_data = Payload.get();
@@ -159,7 +159,7 @@ uint16_t TcpHeader::calculate_tcp_checksum(
           tcp_buffer + pseudo_header_size_in_bytes + tcp_header_size_in_bytes );
 
     uint16_t cksum = calculate_checksum(
-            (uint16_t *) tcp_buffer,
+            reinterpret_cast<uint16_t *>( tcp_buffer ),
             pseudo_header_size_in_bytes + TcpHeaderSizeInBytes + tcp_payload_size_in_bytes
     );