From: Guilherme Maciel Ferreira Date: Tue, 3 Jan 2012 09:49:52 +0000 (-0200) Subject: PC-Lint warnings fixed: X-Git-Tag: v1.3~17 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=619a2293156064271f22777039ac2fcbbd2a0c1b;p=pingcheck PC-Lint warnings fixed: - Info 731: Boolean argument to equal/not equal; - Info 866: Unusual use of '?' in argument to sizeof; - Info 751: local typedef 'boost_static_assert_typedef_x' (line x) not referenced. --- diff --git a/src/tcp/tcpheader.cpp b/src/tcp/tcpheader.cpp index 55aae2b..361b327 100644 --- a/src/tcp/tcpheader.cpp +++ b/src/tcp/tcpheader.cpp @@ -26,7 +26,6 @@ on this file might be covered by the GNU General Public License. #include #include -#include #include "ip/pseudoipv4header.h" #include "ip/pseudoipv6header.h" @@ -323,7 +322,7 @@ uint16_t TcpHeader::calculate_checksum( uint64_t cksum = 0; int64_t current_size = static_cast( size ); - BOOST_STATIC_ASSERT( (sizeof(current_size) / 2) >= sizeof(size) ); + BOOST_ASSERT( (sizeof(current_size) / 2) >= sizeof(size) ); while ( current_size > 1 ) { diff --git a/src/tcp/tcppinger.cpp b/src/tcp/tcppinger.cpp index d51defa..388a762 100644 --- a/src/tcp/tcppinger.cpp +++ b/src/tcp/tcppinger.cpp @@ -32,7 +32,6 @@ on this file might be covered by the GNU General Public License. #include #include #include -#include #include #include @@ -145,7 +144,7 @@ address TcpPinger::get_destination_address() const uint16_t TcpPinger::get_source_port() const { - uint16_t source_port = static_cast( ( random() % 16383 ) + 49152 ); // same as random() % 65536; + uint16_t source_port = static_cast( ( random() % 16383u ) + 49152u ); // same as random() % 65536; return source_port; } @@ -162,7 +161,7 @@ void TcpPinger::set_destination_endpoint( { BOOST_ASSERT( !destination_ip.empty() ); BOOST_ASSERT( ( 0 < destination_port ) && ( destination_port < numeric_limits::max() ) ); - BOOST_STATIC_ASSERT( sizeof(uint16_t) <= sizeof(destination_port) ); + BOOST_ASSERT( sizeof(uint16_t) <= sizeof(destination_port) ); address destination_address = address::from_string( destination_ip ); uint16_t port = static_cast( destination_port );