BIND 10 trac2268, updated. 1137e979e1a22465feb03ee0a48499bebcdf6aae [2268] style fix (brace position) and clarify variable (s/set/rdataset/)

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Oct 4 06:28:42 UTC 2012


The branch, trac2268 has been updated
       via  1137e979e1a22465feb03ee0a48499bebcdf6aae (commit)
       via  12bc8985691e22aad1811322fe1f550b3f710ab8 (commit)
       via  bf382bba28e32de82649284620e36749a183472d (commit)
       via  247cb9c1d6ca73bb212cb9dfe0aa85dcf342e924 (commit)
      from  25cd191443ffd0cffc036c53a0ff57ad2391cead (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 1137e979e1a22465feb03ee0a48499bebcdf6aae
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Oct 3 23:28:18 2012 -0700

    [2268] style fix (brace position) and clarify variable (s/set/rdataset/)

commit 12bc8985691e22aad1811322fe1f550b3f710ab8
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Oct 3 22:56:31 2012 -0700

    [2268] even more editorial/style fixes

commit bf382bba28e32de82649284620e36749a183472d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Oct 3 22:23:47 2012 -0700

    [2268] more style/editorial fixes
    
    - brace position
    - combine short lines
    - clarify variable name ('set' sounds too generic)

commit 247cb9c1d6ca73bb212cb9dfe0aa85dcf342e924
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Oct 3 21:14:44 2012 -0700

    [2268] minor editorial fixes: spacing, combining two short lines

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

Summary of changes:
 src/lib/datasrc/memory/memory_client.cc     |    3 ++-
 src/lib/datasrc/memory/zone_data_updater.cc |   38 +++++++++++++--------------
 src/lib/datasrc/memory/zone_data_updater.h  |    6 ++---
 3 files changed, 24 insertions(+), 23 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/memory_client.cc b/src/lib/datasrc/memory/memory_client.cc
index 008c131..e1c1089 100644
--- a/src/lib/datasrc/memory/memory_client.cc
+++ b/src/lib/datasrc/memory/memory_client.cc
@@ -255,7 +255,8 @@ masterLoadWrapper(const char* const filename, const Name& origin,
 // The installer called from load() for the iterator version of load().
 void
 generateRRsetFromIterator(ZoneIterator* iterator,
-                          InMemoryClient::LoadCallback callback) {
+                          InMemoryClient::LoadCallback callback)
+{
     ConstRRsetPtr rrset;
     while ((rrset = iterator->getNextRRset()) != NULL) {
         callback(rrset);
diff --git a/src/lib/datasrc/memory/zone_data_updater.cc b/src/lib/datasrc/memory/zone_data_updater.cc
index 45c985e..8cd93ba 100644
--- a/src/lib/datasrc/memory/zone_data_updater.cc
+++ b/src/lib/datasrc/memory/zone_data_updater.cc
@@ -34,8 +34,7 @@ namespace { // anonymous namespace
 // function is such that often-used types such as A, AAAA, NS, SOA, MX,
 // etc.  are less than other types. See the code for the ordering.
 int
-compareTypes(const RdataSet* a,
-             const RdataSet* b) {
+compareTypes(const RdataSet* a, const RdataSet* b) {
     // First RRType::A()
     if (a->type == RRType::A()) {
         return (-1);
@@ -102,12 +101,13 @@ ZoneDataUpdater::addWildcards(const Name& name) {
 
 void
 ZoneDataUpdater::contextCheck(const AbstractRRset& rrset,
-                              const RdataSet* set) const {
+                              const RdataSet* rdataset) const
+{
     // Ensure CNAME and other type of RR don't coexist for the same
     // owner name except with NSEC, which is the only RR that can
     // coexist with CNAME (and also RRSIG, which is handled separately)
     if (rrset.getType() == RRType::CNAME()) {
-        for (const RdataSet* sp = set; sp != NULL; sp = sp->getNext()) {
+        for (const RdataSet* sp = rdataset; sp != NULL; sp = sp->getNext()) {
             if (sp->type != RRType::NSEC()) {
                 isc_throw(AddError,
                           "CNAME can't be added with " << sp->type
@@ -115,7 +115,7 @@ ZoneDataUpdater::contextCheck(const AbstractRRset& rrset,
             }
         }
     } else if ((rrset.getType() != RRType::NSEC()) &&
-               (RdataSet::find(set, RRType::CNAME()) != NULL))
+               (RdataSet::find(rdataset, RRType::CNAME()) != NULL))
     {
         isc_throw(AddError,
                   "CNAME and " << rrset.getType() <<
@@ -128,10 +128,10 @@ ZoneDataUpdater::contextCheck(const AbstractRRset& rrset,
     if (rrset.getName() != zone_name_ &&
         // Adding DNAME, NS already there
         ((rrset.getType() == RRType::DNAME() &&
-          RdataSet::find(set, RRType::NS()) != NULL) ||
+          RdataSet::find(rdataset, RRType::NS()) != NULL) ||
          // Adding NS, DNAME already there
          (rrset.getType() == RRType::NS() &&
-          RdataSet::find(set, RRType::DNAME()) != NULL)))
+          RdataSet::find(rdataset, RRType::DNAME()) != NULL)))
     {
         isc_throw(AddError, "DNAME can't coexist with NS in non-apex domain: "
                   << rrset.getName());
@@ -224,8 +224,7 @@ ZoneDataUpdater::validate(const isc::dns::ConstRRsetPtr rrset) const {
     // refuses NSEC3 at wildcard.
     if (rrset->getType() == RRType::NSEC3() &&
         (rrset->getName().isWildcard() ||
-         rrset->getName().getLabelCount() !=
-         zone_name_.getLabelCount() + 1))
+         rrset->getName().getLabelCount() != zone_name_.getLabelCount() + 1))
     {
         isc_throw(AddError, "Invalid NSEC3 owner name: " <<
                   rrset->getName() << "; zone: " << zone_name_);
@@ -261,8 +260,8 @@ ZoneDataUpdater::setupNSEC3(const ConstRRsetPtr rrset) {
 }
 
 void
-ZoneDataUpdater::addNSEC3(const ConstRRsetPtr rrset,
-                          const ConstRRsetPtr rrsig) {
+ZoneDataUpdater::addNSEC3(const ConstRRsetPtr rrset, const ConstRRsetPtr rrsig)
+{
     setupNSEC3<generic::NSEC3>(rrset);
 
     NSEC3Data* nsec3_data = zone_data_.getNSEC3Data();
@@ -270,16 +269,17 @@ ZoneDataUpdater::addNSEC3(const ConstRRsetPtr rrset,
     ZoneNode* node;
     nsec3_data->insertName(mem_sgmt_, rrset->getName(), &node);
 
-    RdataSet* set = RdataSet::create(mem_sgmt_, encoder_, rrset, rrsig);
-    RdataSet* old_set = node->setData(set);
-    if (old_set != NULL) {
-        RdataSet::destroy(mem_sgmt_, rrclass_, old_set);
+    RdataSet* rdataset = RdataSet::create(mem_sgmt_, encoder_, rrset, rrsig);
+    RdataSet* old_rdataset = node->setData(rdataset);
+    if (old_rdataset != NULL) {
+        RdataSet::destroy(mem_sgmt_, rrclass_, old_rdataset);
     }
 }
 
 void
 ZoneDataUpdater::addRdataSet(const ConstRRsetPtr rrset,
-                             const ConstRRsetPtr rrsig) {
+                             const ConstRRsetPtr rrsig)
+{
     if (rrset->getType() == RRType::NSEC3()) {
         addNSEC3(rrset, rrsig);
     } else {
@@ -307,8 +307,7 @@ ZoneDataUpdater::addRdataSet(const ConstRRsetPtr rrset,
         // Insertion sort the new RdataSet into place in the list.
         RdataSet* prev = NULL;
         RdataSet* current = rdataset_head;
-        for (; current != NULL; current = current->getNext())
-        {
+        for (; current != NULL; current = current->getNext()) {
             if (compareTypes(rdataset_new, current) < 0) {
                 break;
             }
@@ -353,7 +352,8 @@ ZoneDataUpdater::addRdataSet(const ConstRRsetPtr rrset,
 
 void
 ZoneDataUpdater::add(const ConstRRsetPtr& rrset,
-                     const ConstRRsetPtr& sig_rrset) {
+                     const ConstRRsetPtr& sig_rrset)
+{
     // Validate input.  This will cause an exception to be thrown if the
     // input RRset is empty.
     validate(rrset);
diff --git a/src/lib/datasrc/memory/zone_data_updater.h b/src/lib/datasrc/memory/zone_data_updater.h
index f7df6f7..5bb03a1 100644
--- a/src/lib/datasrc/memory/zone_data_updater.h
+++ b/src/lib/datasrc/memory/zone_data_updater.h
@@ -50,7 +50,7 @@ public:
     struct NullRRset : public InvalidParameter {
         NullRRset(const char* file, size_t line, const char* what) :
             InvalidParameter(file, line, what)
-        { }
+        {}
     };
 
     /// \brief Zone is empty exception.
@@ -60,7 +60,7 @@ public:
     struct EmptyZone : public InvalidParameter {
         EmptyZone(const char* file, size_t line, const char* what) :
             InvalidParameter(file, line, what)
-        { }
+        {}
     };
 
     /// \brief General failure exception for \c add().
@@ -75,7 +75,7 @@ public:
     struct AddError : public InvalidParameter {
         AddError(const char* file, size_t line, const char* what) :
             InvalidParameter(file, line, what)
-        { }
+        {}
     };
 
     void add(const isc::dns::ConstRRsetPtr& rrset,



More information about the bind10-changes mailing list