BIND 10 trac1975, updated. 52a26b21697e8986400ab4af46429e3d00c895c5 [1975] style fixes: indent; spacing; const, parentheses

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jun 14 06:24:20 UTC 2012


The branch, trac1975 has been updated
       via  52a26b21697e8986400ab4af46429e3d00c895c5 (commit)
       via  82d8a2a27293589bdde01e1385f3e9b05538ab4f (commit)
       via  8e4cd528b8c10c707616b0dedbb3cc61573da7a6 (commit)
      from  06a3082082feea8f608272753a24a3f014c494c8 (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 52a26b21697e8986400ab4af46429e3d00c895c5
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Jun 13 23:23:38 2012 -0700

    [1975] style fixes: indent; spacing; const, parentheses

commit 82d8a2a27293589bdde01e1385f3e9b05538ab4f
Merge: 8e4cd52 06a3082
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Jun 13 11:32:28 2012 -0700

    [1975] Merge branch 'trac1975' from upstream with fixing conflicts.

commit 8e4cd528b8c10c707616b0dedbb3cc61573da7a6
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Jun 8 18:05:01 2012 -0700

    [1975] more editorial cleanups: spacing, doxygen format for code; const.

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

Summary of changes:
 src/lib/datasrc/list.cc                |    8 ++++----
 src/lib/datasrc/list.h                 |   16 +++++++++-------
 src/lib/datasrc/tests/list_unittest.cc |   14 ++++++++------
 3 files changed, 21 insertions(+), 17 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/list.cc b/src/lib/datasrc/list.cc
index 8b76192..acfaf96 100644
--- a/src/lib/datasrc/list.cc
+++ b/src/lib/datasrc/list.cc
@@ -75,13 +75,13 @@ ConfigurableClientList::find(const dns::Name& name, bool want_exact_match,
             datasrc_client(NULL),
             matched_labels(0)
         { }
-        DataSourceClient *datasrc_client;
+        DataSourceClient* datasrc_client;
         ZoneFinderPtr finder;
         uint8_t matched_labels;
-        operator FindResult() {
+        operator FindResult() const {
             // Conversion to the right result. If we return this, there was
             // a partial match at best.
-            return FindResult(datasrc_client, finder, matched_labels, false);
+            return (FindResult(datasrc_client, finder, matched_labels, false));
         }
     } candidate;
 
@@ -112,7 +112,7 @@ ConfigurableClientList::find(const dns::Name& name, bool want_exact_match,
                         result.zone_finder->getOrigin().getLabelCount());
                     if (labels > candidate.matched_labels) {
                         // This one is strictly better. Replace it.
-                    candidate.datasrc_client = info.data_src_client_;
+                        candidate.datasrc_client = info.data_src_client_;
                         candidate.finder = result.zone_finder;
                         candidate.matched_labels = labels;
                     }
diff --git a/src/lib/datasrc/list.h b/src/lib/datasrc/list.h
index 6c060f0..0033d71 100644
--- a/src/lib/datasrc/list.h
+++ b/src/lib/datasrc/list.h
@@ -90,9 +90,9 @@ public:
         /// too.
         bool operator ==(const FindResult& other) const {
         return (dsrc_client_ == other.dsrc_client_ &&
-                    finder_ == other.finder_ &&
-                    matched_labels_ == other.matched_labels_ &&
-                    exact_match_ == other.exact_match_);
+                finder_ == other.finder_ &&
+                matched_labels_ == other.matched_labels_ &&
+                exact_match_ == other.exact_match_);
         }
 
         /// \brief The found data source client.
@@ -133,23 +133,25 @@ public:
     /// this case, the zone finder is needed and the best matching superzone
     /// of the searched name is needed. Therefore, the call would look like:
     ///
+    /// \code FindResult result(list->find(queried_name));
     ///   FindResult result(list->find(queried_name));
     ///   if (result.datasrc_) {
     ///       createTheAnswer(result.finder_);
     ///   } else {
     ///       createNotAuthAnswer();
-    ///   }
+    /// } \endcode
     ///
     /// The other scenario is manipulating zone data (XfrOut, XfrIn, DDNS,
     /// ...). In this case, the finder itself is not so important. However,
     /// we need an exact match (if we want to manipulate zone data, we must
     /// know exactly, which zone we are about to manipulate). Then the call
     ///
+    /// \code FindResult result(list->find(zone_name, true, false));
     ///   FindResult result(list->find(zone_name, true, false));
     ///   if (result.datasrc_) {
     ///       ZoneUpdaterPtr updater(result.datasrc_->getUpdater(zone_name);
     ///       ...
-    ///   }
+    /// } \endcode
     ///
     /// \param zone The name of the zone to look for.
     /// \param want_exact_match If it is true, it returns only exact matches.
@@ -222,8 +224,8 @@ public:
 
     /// \brief Implementation of the ClientList::find.
     virtual FindResult find(const dns::Name& zone,
-                              bool want_exact_match = false,
-                              bool want_finder = true) const;
+                            bool want_exact_match = false,
+                            bool want_finder = true) const;
 
     /// \brief This holds one data source client and corresponding information.
     ///
diff --git a/src/lib/datasrc/tests/list_unittest.cc b/src/lib/datasrc/tests/list_unittest.cc
index 6192ec9..ca07d67 100644
--- a/src/lib/datasrc/tests/list_unittest.cc
+++ b/src/lib/datasrc/tests/list_unittest.cc
@@ -65,7 +65,7 @@ public:
     };
     // Constructor from a list of zones.
     MockDataSourceClient(const char* zone_names[]) {
-        for (const char** zone(zone_names); *zone; ++ zone) {
+        for (const char** zone(zone_names); *zone; ++zone) {
             zones.insert(Name(*zone));
         }
     }
@@ -84,7 +84,7 @@ public:
         if (it == zones.begin()) {
             return (FindResult(result::NOTFOUND, ZoneFinderPtr()));
         }
-        -- it;
+        --it;
         NameComparisonResult compar(it->compare(name));
         const ZoneFinderPtr finder(new Finder(*it));
         switch (compar.getRelation()) {
@@ -159,7 +159,7 @@ const char* ds_zones[][3] = {
     }
 };
 
-const size_t ds_count = (sizeof (ds_zones) / sizeof (*ds_zones));
+const size_t ds_count = (sizeof(ds_zones) / sizeof(*ds_zones));
 
 class ListTest : public ::testing::Test {
 public:
@@ -224,10 +224,12 @@ public:
                 FAIL() << "Unknown configuration index " << index;
         }
     }
-    void checkDS(size_t index, const string& type, const string& params) {
+    void checkDS(size_t index, const string& type, const string& params) const
+    {
         ASSERT_GT(list_->getDataSources().size(), index);
         MockDataSourceClient* ds(dynamic_cast<MockDataSourceClient*>(
             list_->getDataSources()[index].data_src_client_));
+
         // Comparing with NULL does not work
         ASSERT_NE(ds, static_cast<const MockDataSourceClient*>(NULL));
         EXPECT_EQ(type, ds->type_);
@@ -303,7 +305,7 @@ TEST_F(ListTest, singleDSBestMatch) {
                    Name("example.org"), false, "Subdomain match");
 }
 
-const char* test_names[] = {
+const char* const test_names[] = {
     "Sub second",
     "Sub first",
     "With empty",
@@ -312,7 +314,7 @@ const char* test_names[] = {
 
 TEST_F(ListTest, multiExactMatch) {
     // Run through all the multi-configurations
-    for (size_t i(0); i < sizeof(test_names) / sizeof(*test_names); ++ i) {
+    for (size_t i(0); i < sizeof(test_names) / sizeof(*test_names); ++i) {
         SCOPED_TRACE(test_names[i]);
         multiConfiguration(i);
         // Something that is nowhere there



More information about the bind10-changes mailing list