BIND 10 master, updated. 5c9dba4001ebbb432a7313a91cb3bc7b440bb396 [master] Remove indirection in defining size of arrays

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Dec 7 20:27:29 UTC 2012


The branch, master has been updated
       via  5c9dba4001ebbb432a7313a91cb3bc7b440bb396 (commit)
      from  755a3b5fa194d08e883fec5899ac4b7bcdcbfd18 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5c9dba4001ebbb432a7313a91cb3bc7b440bb396
Author: Stephen Morris <stephen at isc.org>
Date:   Fri Dec 7 20:25:25 2012 +0000

    [master] Remove indirection in defining size of arrays
    
    cppcheck was complaining about what was effectively:
    const int A = 6; const int B = A; std::string array[b];
    
    Changing this to
    const int B = 6; std::string array[b];
    
    ... works

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcpsrv/mysql_lease_mgr.cc |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.cc b/src/lib/dhcpsrv/mysql_lease_mgr.cc
index 428a137..73289ad 100644
--- a/src/lib/dhcpsrv/mysql_lease_mgr.cc
+++ b/src/lib/dhcpsrv/mysql_lease_mgr.cc
@@ -95,12 +95,6 @@ const size_t ADDRESS6_TEXT_MAX_LEN = 39;
 /// @brief Maximum size of a hardware address.
 const size_t HWADDR_MAX_LEN = 20;
 
-/// @brief Number of columns in Lease4 table
-const size_t LEASE4_COLUMNS = 6;
-
-/// @brief Number of columns in Lease6 table
-const size_t LEASE6_COLUMNS = 9;
-
 /// @brief MySQL True/False constants
 ///
 /// Declare typed values so as to avoid problems of data conversion.  These
@@ -279,10 +273,10 @@ public:
 /// in all MySqlLeaseMgr::xxx4() calls where it is used.
 
 class MySqlLease4Exchange : public MySqlLeaseExchange {
-public:
-    /// @brief Set number of columns in this lease structure
-    static const size_t LEASE_COLUMNS = LEASE4_COLUMNS;
+    /// @brief Set number of database columns for this lease structure
+    static const size_t LEASE_COLUMNS = 6;
 
+public:
     /// @brief Constructor
     ///
     /// The initialization of the variables here is only to satisfy cppcheck -
@@ -512,8 +506,8 @@ private:
 /// in all MySqlLeaseMgr::xxx6() calls where it is used.
 
 class MySqlLease6Exchange : public MySqlLeaseExchange {
-    /// @brief Set number of columns in this lease structure
-    static const size_t LEASE_COLUMNS = LEASE6_COLUMNS;
+    /// @brief Set number of database columns for this lease structure
+    static const size_t LEASE_COLUMNS = 9;
 
 public:
     /// @brief Constructor
@@ -535,7 +529,7 @@ public:
         columns_[6] = "lease_type";
         columns_[7] = "iaid";
         columns_[8] = "prefix_len";
-        BOOST_STATIC_ASSERT(5 < LEASE_COLUMNS);
+        BOOST_STATIC_ASSERT(8 < LEASE_COLUMNS);
     }
 
     /// @brief Create MYSQL_BIND objects for Lease6 Pointer



More information about the bind10-changes mailing list