Browse Source

[master] Fix missing virtual dtors and cppcheck failures in
new code from merge of Trac 3008.

Thomas Markwalder 11 years ago
parent
commit
fc5e5746a1
3 changed files with 9 additions and 3 deletions
  1. 2 2
      src/bin/d2/ncr_io.cc
  2. 6 0
      src/bin/d2/ncr_io.h
  3. 1 1
      src/bin/d2/ncr_msg.h

+ 2 - 2
src/bin/d2/ncr_io.cc

@@ -199,7 +199,7 @@ NameChangeSender::sendNext() {
 
 
     // If queue isn't empty, then get one from the front. Note we leave
     // If queue isn't empty, then get one from the front. Note we leave
     // it on the front of the queue until we successfully send it.
     // it on the front of the queue until we successfully send it.
-    if (send_queue_.size()) {
+    if (!send_queue_.empty()) {
         ncr_to_send_ = send_queue_.front();
         ncr_to_send_ = send_queue_.front();
 
 
        // @todo start defense timer
        // @todo start defense timer
@@ -262,7 +262,7 @@ NameChangeSender::invokeSendHandler(const NameChangeSender::Result result) {
 
 
 void
 void
 NameChangeSender::skipNext() {
 NameChangeSender::skipNext() {
-    if (send_queue_.size()) {
+    if (!send_queue_.empty()) {
         // Discards the request at the front of the queue.
         // Discards the request at the front of the queue.
         send_queue_.pop_front();
         send_queue_.pop_front();
     }
     }

+ 6 - 0
src/bin/d2/ncr_io.h

@@ -171,6 +171,9 @@ public:
         /// @throw This method MUST NOT throw.
         /// @throw This method MUST NOT throw.
         virtual void operator ()(const Result result,
         virtual void operator ()(const Result result,
                                  NameChangeRequestPtr& ncr) = 0;
                                  NameChangeRequestPtr& ncr) = 0;
+
+        virtual ~RequestReceiveHandler() {
+        }
     };
     };
 
 
     /// @brief Constructor
     /// @brief Constructor
@@ -435,6 +438,9 @@ public:
         /// @throw This method MUST NOT throw.
         /// @throw This method MUST NOT throw.
         virtual void operator ()(const Result result,
         virtual void operator ()(const Result result,
                                  NameChangeRequestPtr& ncr) = 0;
                                  NameChangeRequestPtr& ncr) = 0;
+
+        virtual ~RequestSendHandler(){
+        }
     };
     };
 
 
     /// @brief Constructor
     /// @brief Constructor

+ 1 - 1
src/bin/d2/ncr_msg.h

@@ -105,7 +105,7 @@ public:
     }
     }
 
 
     /// @brief Compares two D2Dhcids for inequality
     /// @brief Compares two D2Dhcids for inequality
-    bool operator!=(const D2Dhcid other) const {
+    bool operator!=(const D2Dhcid& other) const {
         return (this->bytes_ != other.bytes_);
         return (this->bytes_ != other.bytes_);
 }
 }