Browse Source

cppcheck warnings removed.

Tomek Mrugalski 13 years ago
parent
commit
26f4192ca7
3 changed files with 7 additions and 7 deletions
  1. 1 1
      src/lib/dhcp/libdhcp.cc
  2. 3 3
      src/lib/dhcp/option6_ia.h
  3. 3 3
      src/lib/dhcp/option6_iaaddr.h

+ 1 - 1
src/lib/dhcp/libdhcp.cc

@@ -100,7 +100,7 @@ LibDHCP::packOptions6(boost::shared_array<uint8_t> data,
             offset = (*it).second->pack(data, data_len, offset);
         }
     }
-    catch (Exception e) {
+    catch (const Exception& e) {
         cout << "Packet build failed." << endl;
         return (-1);
     }

+ 3 - 3
src/lib/dhcp/option6_ia.h

@@ -99,17 +99,17 @@ public:
     ///
     /// @return IAID value.
     ///
-    unsigned int getIAID() { return iaid_; }
+    unsigned int getIAID() const { return iaid_; }
 
     /// Returns T1 timer.
     ///
     /// @return T1 value.
-    unsigned int getT1()   { return t1_; }
+    unsigned int getT1() const { return t1_; }
 
     /// Returns T2 timer.
     ///
     /// @return T2 value.
-    unsigned int getT2()   { return t2_; }
+    unsigned int getT2() const { return t2_; }
 
     /// @brief returns complete length of option
     ///

+ 3 - 3
src/lib/dhcp/option6_iaaddr.h

@@ -111,19 +111,19 @@ public:
     ///
     /// @return address
     isc::asiolink::IOAddress
-    getAddress() { return addr_; }
+    getAddress() const { return addr_; }
 
     /// Returns preferred lifetime of an address.
     ///
     /// @return preferred lifetime (in seconds)
     unsigned int
-    getPreferred()   { return preferred_; }
+    getPreferred() const { return preferred_; }
 
     /// Returns valid lifetime of an address.
     ///
     /// @return valid lifetime (in seconds)
     unsigned int
-    getValid()   { return valid_; }
+    getValid() const { return valid_; }
 
     /// returns data length (data length + DHCPv4/DHCPv6 option header)
     virtual unsigned short