Browse Source

[3736] Fixed cppcheck warnings about unused functions.

Marcin Siodelski 10 years ago
parent
commit
f17663b23d
3 changed files with 14 additions and 7 deletions
  1. 2 1
      src/lib/dhcp/pkt4.cc
  2. 10 0
      src/lib/dhcpsrv/host.cc
  3. 2 6
      src/lib/dhcpsrv/host.h

+ 2 - 1
src/lib/dhcp/pkt4.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -379,6 +379,7 @@ Pkt4::setFile(const uint8_t* file, size_t fileLen /*= MAX_FILE_LEN*/) {
 }
 
 uint8_t
+// cppcheck-suppress unusedFunction
 Pkt4::DHCPTypeToBootpType(uint8_t dhcpType) {
     switch (dhcpType) {
     case DHCPDISCOVER:

+ 10 - 0
src/lib/dhcpsrv/host.cc

@@ -222,6 +222,16 @@ Host::hasReservation(const IPv6Resrv& reservation) const {
 }
 
 void
+Host::addClientClass4(const std::string& class_name) {
+    addClientClassInternal(dhcp4_client_classes_, class_name);
+}
+
+void
+Host::addClientClass6(const std::string& class_name) {
+    addClientClassInternal(dhcp6_client_classes_, class_name);
+}
+
+void
 Host::addClientClassInternal(ClientClasses& classes,
                              const std::string& class_name) {
     std::string trimmed = util::str::trim(class_name);

+ 2 - 6
src/lib/dhcpsrv/host.h

@@ -394,9 +394,7 @@ public:
     /// @brief Adds new client class for DHCPv4.
     ///
     /// @param class_name Class name.
-    void addClientClass4(const std::string& class_name) {
-        addClientClassInternal(dhcp4_client_classes_, class_name);
-    }
+    void addClientClass4(const std::string& class_name);
 
     /// @brief Returns classes which DHCPv4 client is associated with.
     const ClientClasses& getClientClasses4() const {
@@ -406,9 +404,7 @@ public:
     /// @brief Adds new client class for DHCPv6.
     ///
     /// @param class_name Class name.
-    void addClientClass6(const std::string& class_name) {
-        addClientClassInternal(dhcp6_client_classes_, class_name);
-    }
+    void addClientClass6(const std::string& class_name);
 
     /// @brief Returns classes which DHCPv6 client is associated with.
     const ClientClasses& getClientClasses6() const {