From: Guilherme Maciel Ferreira Date: Mon, 21 Nov 2011 22:49:51 +0000 (-0200) Subject: Changed old-style C casts by C++ style casts. X-Git-Tag: v1.2~3 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=6fbd0d9859d54098fb004cf5e145a730d755018f;p=pingcheck Changed old-style C casts by C++ style casts. --- diff --git a/src/ip/pseudoipv4header.h b/src/ip/pseudoipv4header.h index d71a0b9..0538343 100644 --- a/src/ip/pseudoipv4header.h +++ b/src/ip/pseudoipv4header.h @@ -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. diff --git a/src/tcp/tcpheader.cpp b/src/tcp/tcpheader.cpp index fb9ef07..5f743ad 100644 --- a/src/tcp/tcpheader.cpp +++ b/src/tcp/tcpheader.cpp @@ -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( &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( tcp_buffer ), pseudo_header_size_in_bytes + TcpHeaderSizeInBytes + tcp_payload_size_in_bytes );