BIND 10 trac1704_2, updated. 227d01775bdb4dab84c97e5858c0812e2aa845c2 [1704] style matters: long line, () for return, const, { position.

BIND 10 source code commits bind10-changes at lists.isc.org
Thu May 24 21:40:26 UTC 2012


The branch, trac1704_2 has been updated
       via  227d01775bdb4dab84c97e5858c0812e2aa845c2 (commit)
      from  30198a34b9e464ffa2947955e7dd70a191e39682 (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 227d01775bdb4dab84c97e5858c0812e2aa845c2
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu May 24 14:39:23 2012 -0700

    [1704] style matters: long line, () for return, const, { position.
    
    also change 'const string' to 'const string&' in some places

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

Summary of changes:
 src/lib/log/logger_impl.h                          |    4 ++--
 src/lib/log/tests/logger_unittest.cc               |   17 +++++++++--------
 src/lib/util/interprocess_sync.h                   |   10 +++++-----
 src/lib/util/interprocess_sync_file.cc             |    3 +--
 src/lib/util/interprocess_sync_file.h              |    2 +-
 .../util/tests/interprocess_sync_file_unittest.cc  |    4 ++--
 6 files changed, 20 insertions(+), 20 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/log/logger_impl.h b/src/lib/log/logger_impl.h
index 94a68f7..e7f02af 100644
--- a/src/lib/log/logger_impl.h
+++ b/src/lib/log/logger_impl.h
@@ -186,8 +186,8 @@ public:
     }
 
 private:
-    std::string                  name_;              ///< Full name of this logger
-    log4cplus::Logger            logger_;            ///< Underlying log4cplus logger
+    std::string                  name_;   ///< Full name of this logger
+    log4cplus::Logger            logger_; ///< Underlying log4cplus logger
     isc::util::InterprocessSync* sync_;
 };
 
diff --git a/src/lib/log/tests/logger_unittest.cc b/src/lib/log/tests/logger_unittest.cc
index 3b980c8..9416bfa 100644
--- a/src/lib/log/tests/logger_unittest.cc
+++ b/src/lib/log/tests/logger_unittest.cc
@@ -386,31 +386,32 @@ TEST_F(LoggerTest, LoggerNameLength) {
 class MockSync : public isc::util::InterprocessSync {
 public:
     /// \brief Constructor
-    MockSync(const std::string component_name) :
-        InterprocessSync(component_name), was_locked_(false), was_unlocked_(false)
+    MockSync(const std::string& component_name) :
+        InterprocessSync(component_name), was_locked_(false),
+        was_unlocked_(false)
     {}
 
     bool wasLocked() const {
-        return was_locked_;
+        return (was_locked_);
     }
 
     bool wasUnlocked() const {
-        return was_unlocked_;
+        return (was_unlocked_);
     }
 
 protected:
     bool lock() {
         was_locked_ = true;
-        return true;
+        return (true);
     }
 
     bool tryLock() {
-        return true;
+        return (true);
     }
 
     bool unlock() {
         was_unlocked_ = true;
-        return true;
+        return (true);
     }
 
 private:
@@ -427,7 +428,7 @@ TEST_F(LoggerTest, Lock) {
 
     // Setup our own mock sync object so that we can intercept the lock
     // call and check if a lock has been taken.
-    MockSync *sync = new MockSync("logger");
+    MockSync* sync = new MockSync("logger");
     logger.setInterprocessSync(sync);
 
     // Log a message and put things into play.
diff --git a/src/lib/util/interprocess_sync.h b/src/lib/util/interprocess_sync.h
index 4ef36d5..c5fe11e 100644
--- a/src/lib/util/interprocess_sync.h
+++ b/src/lib/util/interprocess_sync.h
@@ -28,7 +28,7 @@ public:
     /// \brief Constructor
     ///
     /// Creates a interprocess synchronization object
-    InterprocessSync(const std::string component_name) :
+    InterprocessSync(const std::string& component_name) :
         component_name_(component_name), is_locked_(false)
     {}
 
@@ -40,7 +40,7 @@ protected:
     virtual bool tryLock() = 0;
     virtual bool unlock() = 0;
 
-    std::string component_name_;
+    const std::string component_name_;
     bool is_locked_;
 };
 
@@ -56,15 +56,15 @@ public:
     }
 
     bool lock() {
-        return sync_.lock();
+        return (sync_.lock());
     }
 
     bool tryLock() {
-        return sync_.tryLock();
+        return (sync_.tryLock());
     }
 
     bool unlock() {
-        return sync_.unlock();
+        return (sync_.unlock());
     }
 
 protected:
diff --git a/src/lib/util/interprocess_sync_file.cc b/src/lib/util/interprocess_sync_file.cc
index 73dcfa9..4b82095 100644
--- a/src/lib/util/interprocess_sync_file.cc
+++ b/src/lib/util/interprocess_sync_file.cc
@@ -36,8 +36,7 @@ InterprocessSyncFile::~InterprocessSyncFile() {
 }
 
 bool
-InterprocessSyncFile::do_lock(int cmd, short l_type)
-{
+InterprocessSyncFile::do_lock(int cmd, short l_type) {
     // Open lock file only when necessary (i.e., here). This is so that
     // if a default InterprocessSync object is replaced with another
     // implementation, it doesn't attempt any opens.
diff --git a/src/lib/util/interprocess_sync_file.h b/src/lib/util/interprocess_sync_file.h
index 848b736..c288cb0 100644
--- a/src/lib/util/interprocess_sync_file.h
+++ b/src/lib/util/interprocess_sync_file.h
@@ -35,7 +35,7 @@ public:
 class InterprocessSyncFile : public InterprocessSync {
 public:
     /// \brief Constructor
-    InterprocessSyncFile(const std::string component_name) :
+    InterprocessSyncFile(const std::string& component_name) :
         InterprocessSync(component_name), fd_(-1)
     {}
 
diff --git a/src/lib/util/tests/interprocess_sync_file_unittest.cc b/src/lib/util/tests/interprocess_sync_file_unittest.cc
index 4030bf7..e070e38 100644
--- a/src/lib/util/tests/interprocess_sync_file_unittest.cc
+++ b/src/lib/util/tests/interprocess_sync_file_unittest.cc
@@ -65,7 +65,7 @@ TEST(InterprocessSyncFileTest, TestLock) {
       tv.tv_sec = 5;
       tv.tv_usec = 0;
 
-      int nfds = select(fds[0] + 1, &rfds, NULL, NULL, &tv);
+      const int nfds = select(fds[0] + 1, &rfds, NULL, NULL, &tv);
       EXPECT_EQ(1, nfds);
 
       if (nfds == 1) {
@@ -133,7 +133,7 @@ TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
       tv.tv_sec = 5;
       tv.tv_usec = 0;
 
-      int nfds = select(fds[0] + 1, &rfds, NULL, NULL, &tv);
+      const int nfds = select(fds[0] + 1, &rfds, NULL, NULL, &tv);
       EXPECT_EQ(1, nfds);
 
       if (nfds == 1) {



More information about the bind10-changes mailing list