Silence more PC-Lint warnings
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 12 Dec 2011 13:42:06 +0000 (14:42 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 12 Dec 2011 13:42:06 +0000 (14:42 +0100)
13 files changed:
pclint.lnt
src/config/configuration.cpp
src/host/messagepayload.cpp
src/host/pinger.cpp
src/host/pingerfactory.cpp
src/host/pingscheduler.cpp
src/icmp/icmpmessage.cpp
src/icmp/icmppacket.cpp
src/icmp/icmppinger.cpp
src/icmp/icmpv6packet.cpp
src/link/linkstatusanalyzer.cpp
src/tcp/tcppinger.cpp
src/tcp/tcpsegment.cpp

index cb8d458..21a34ca 100644 (file)
@@ -3,6 +3,9 @@
 // Hide "Location cited in prior message", emitted by BOOST_FOREACH
 -e830
 
+// Ignore return value of std::copy
+-esym(534, std::copy)
+
 // Set up include directories
 --isrc
 --ilib/boost-custom
index 4cf3747..f29c4f6 100644 (file)
@@ -58,7 +58,7 @@ bool Configuration::get_daemon() const
 }
 
 void Configuration::set_daemon( bool daemon )
-{
+{ //lint !e578
     Daemon = daemon;
 }
 
index 0048566..ea2f2ea 100644 (file)
@@ -93,7 +93,7 @@ MessagePayload& MessagePayload::operator=( const MessagePayload &other )
 
     BOOST_ASSERT( PayloadSizeInBytes == other.PayloadSizeInBytes );
 
-    return *this;
+    return *this;               //lint !e429
 }
 
 /**
@@ -124,7 +124,7 @@ uint8_t& MessagePayload::operator[]( size_t offset )
     BOOST_ASSERT( offset < PayloadSizeInBytes );
 
     return Payload[ offset ];
-}
+} //lint !e1762
 
 /**
  * @brief Get a pointer to the underlying array.
index 0703a9b..9de6e80 100644 (file)
@@ -50,5 +50,6 @@ Pinger::~Pinger()
  */
 Pinger& Pinger::operator=( const Pinger & )
 {
+    // TODO: Not implemented at all? Then disable it in the class definition
     return *this;
 }
index 0171e03..3463923 100644 (file)
@@ -97,8 +97,8 @@ shared_ptr<Pinger> PingerFactory::createPinger(
                     new TcpPinger( io_serv, tcp_raw_protocol::v6(), network_interface, ping_reply_timeout_in_sec )
             );
         default:
-            BOOST_ASSERT( !"Try to create a pinger from an invalid protocol" );
-            return shared_ptr<Pinger>();
+            BOOST_ASSERT( !"Try to create a pinger from an invalid protocol" );                                                 //lint !e506
+            return shared_ptr<Pinger>();                                                                                                             //lint !e527
         }
     }
     catch ( const system_error &ex )
@@ -109,5 +109,5 @@ shared_ptr<Pinger> PingerFactory::createPinger(
         exit( EXIT_FAILURE );
     }
 
-    return shared_ptr<Pinger>();
+    return shared_ptr<Pinger>();                                                                                                                        //lint !527
 }
index 93bfb93..9f52a98 100644 (file)
@@ -122,7 +122,7 @@ bool PingScheduler::start_pinging()
     setup_next_ping();
 
     // event processing loop, it is a blocking call!
-    IoService.run();
+    IoService.run();                                                                                    //lint !e534
 
     return true;
 }
index b55af24..82e3079 100644 (file)
@@ -36,6 +36,7 @@ IcmpMessage::~IcmpMessage()
  */
 IcmpMessage& IcmpMessage::operator=( const IcmpMessage & )
 {
+    // TODO: Not implemented at all. Fix it or disable it
     return *this;
 }
 
index 8905454..4372765 100644 (file)
@@ -50,5 +50,6 @@ IcmpPacket::~IcmpPacket()
  */
 IcmpPacket& IcmpPacket::operator=( const IcmpPacket & )
 {
+    // TODO: Not implemented at all. Fix it or disable it
     return *this;
 }
index d2bb4db..f326385 100644 (file)
@@ -262,7 +262,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred )
 
             set_ping_status( PingStatus_SuccessReply );
 
-            IcmpPacketReceiveTimer.cancel();
+            IcmpPacketReceiveTimer.cancel();                                                                                                    //lint !e534
         }
         else if ( icmp_packet->match_destination_unreachable(
                                      Identifier, SequenceNumber,
@@ -274,7 +274,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred )
 
             set_ping_status( PingStatus_FailureDestinationUnreachable );
 
-            IcmpPacketReceiveTimer.cancel();
+            IcmpPacketReceiveTimer.cancel();                                                                                                    //lint !e534
         }
         // Unknown ICMP reply, start another receive till timeout
         else
index 71f0f6f..119d0e8 100644 (file)
@@ -151,6 +151,9 @@ bool Icmpv6Packet::match(
 
     return ( type_match && identifier_match && seq_num_match && address_match );
 #else
+    // Silence compiler warning
+    (void)source_address;
+
     return ( type_match && identifier_match && seq_num_match );
 #endif
 }
index 78c6864..81e4880 100644 (file)
@@ -100,7 +100,7 @@ void LinkStatusAnalyzer::notify_host_up( const string &host_address )
 
     // removed from the list?
     BOOST_ASSERT( HostsDownList.count( host_address ) == 0 );
-}
+} //lint !e1788
 
 /**
  * @brief Notify the system that a given host is down. The object takes an
@@ -127,7 +127,7 @@ void LinkStatusAnalyzer::notify_host_down( const string &host_address )
 
     // inserted in the list?
     BOOST_ASSERT( HostsDownList.count( host_address ) == 1 );
-}
+} //lint !e1788
 
 void LinkStatusAnalyzer::add_host_up( const string &host_address )
 {
index 74499f9..cde82a6 100644 (file)
@@ -294,7 +294,7 @@ void TcpPinger::handle_receive_tcp_segment( const size_t &bytes_transferred )
 
             set_ping_status( PingStatus_SuccessReply );
 
-            TcpSegmentReceiveTimer.cancel();
+            TcpSegmentReceiveTimer.cancel();                                                                                                                //lint !e534
         }
         // Unknown TCP reply, start another receive till timeout
         else
index 97839b1..43790f3 100644 (file)
@@ -50,6 +50,6 @@ TcpSegment::~TcpSegment()
  */
 TcpSegment& TcpSegment::operator=( const TcpSegment & )
 {
+    // TODO: Not implemented at all. Fix it or disable it.
     return *this;
 }
-