PC-Lint warnings fixed:
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Tue, 3 Jan 2012 09:49:52 +0000 (07:49 -0200)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Tue, 3 Jan 2012 09:49:52 +0000 (07:49 -0200)
- 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.

src/tcp/tcpheader.cpp
src/tcp/tcppinger.cpp

index 55aae2b..361b327 100644 (file)
@@ -26,7 +26,6 @@ on this file might be covered by the GNU General Public License.
 #include <algorithm>
 
 #include <boost/assert.hpp>
-#include <boost/static_assert.hpp>
 
 #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_t>( size );
 
-    BOOST_STATIC_ASSERT( (sizeof(current_size) / 2) >= sizeof(size) );
+    BOOST_ASSERT( (sizeof(current_size) / 2) >= sizeof(size) );
 
     while ( current_size > 1 )
     {
index d51defa..388a762 100644 (file)
@@ -32,7 +32,6 @@ on this file might be covered by the GNU General Public License.
 #include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/static_assert.hpp>
 #include <boost/uuid/uuid.hpp>
 #include <boost/uuid/uuid_generators.hpp>
 
@@ -145,7 +144,7 @@ address TcpPinger::get_destination_address() const
 
 uint16_t TcpPinger::get_source_port() const
 {
-    uint16_t source_port = static_cast<uint16_t>( ( random() % 16383 ) + 49152 ); // same as random() % 65536;
+    uint16_t source_port = static_cast<uint16_t>( ( 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<uint16_t>::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<uint16_t>( destination_port );