BIND 10 trac1704_2, updated. 075eef9a1fe8c61c69532ce8b9dc05eda102f08d [1704] style matters: don't omit {}, func name convention, typo.

BIND 10 source code commits bind10-changes at lists.isc.org
Fri May 25 22:04:56 UTC 2012


The branch, trac1704_2 has been updated
       via  075eef9a1fe8c61c69532ce8b9dc05eda102f08d (commit)
      from  2e95197a4b47847b4ec85e83bdb1fb5edf685cd0 (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 075eef9a1fe8c61c69532ce8b9dc05eda102f08d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri May 25 15:02:45 2012 -0700

    [1704] style matters: don't omit {}, func name convention, typo.
    
    also use unnamed namespace instead of file-scope static.  technically, this
    use of static was deprecated in C++.  also use the unnamed namespace for
    the entire TESTs, which is our common (though not explicitly documented)
    convention.

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

Summary of changes:
 src/lib/log/logger_impl.cc                         |    3 ++-
 src/lib/util/interprocess_sync.h                   |    4 ++--
 .../util/tests/interprocess_sync_file_unittest.cc  |   12 +++++++-----
 3 files changed, 11 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/log/logger_impl.cc b/src/lib/log/logger_impl.cc
index 88e23d6..974d0c2 100644
--- a/src/lib/log/logger_impl.cc
+++ b/src/lib/log/logger_impl.cc
@@ -113,8 +113,9 @@ void
 LoggerImpl::setInterprocessSync(isc::util::InterprocessSync* sync) {
     // If we are passed NULL, change nothing. The old sync_ object will
     // continue to be used.
-    if (sync == NULL)
+    if (sync == NULL) {
         return;
+    }
 
     delete sync_;
     sync_ = sync;
diff --git a/src/lib/util/interprocess_sync.h b/src/lib/util/interprocess_sync.h
index 340dc5a..9646f64 100644
--- a/src/lib/util/interprocess_sync.h
+++ b/src/lib/util/interprocess_sync.h
@@ -47,9 +47,9 @@ class InterprocessSync {
 public:
     /// \brief Constructor
     ///
-    /// Creates a interprocess synchronization object
+    /// Creates an interprocess synchronization object
     ///
-    /// \param name Name of the synchronization task. This has to be
+    /// \param task_name Name of the synchronization task. This has to be
     /// identical among the various processes that need to be
     /// synchronized for the same task.
     InterprocessSync(const std::string& task_name) :
diff --git a/src/lib/util/tests/interprocess_sync_file_unittest.cc b/src/lib/util/tests/interprocess_sync_file_unittest.cc
index a3a50e6..bf398df 100644
--- a/src/lib/util/tests/interprocess_sync_file_unittest.cc
+++ b/src/lib/util/tests/interprocess_sync_file_unittest.cc
@@ -20,8 +20,9 @@ using namespace std;
 namespace isc {
 namespace util {
 
-static unsigned char
-parent_read_locked_state (int fd) {
+namespace {
+unsigned char
+parentReadLockedState (int fd) {
   unsigned char locked = 0xff;
 
   fd_set rfds;
@@ -46,7 +47,7 @@ parent_read_locked_state (int fd) {
       read(fd, &locked, sizeof(locked));
   }
 
-  return locked;
+  return (locked);
 }
 
 TEST(InterprocessSyncFileTest, TestLock) {
@@ -85,7 +86,7 @@ TEST(InterprocessSyncFileTest, TestLock) {
       // Parent reads from pipe
       close(fds[1]);
 
-      const unsigned char locked = parent_read_locked_state(fds[0]);
+      const unsigned char locked = parentReadLockedState(fds[0]);
 
       close(fds[0]);
 
@@ -138,7 +139,7 @@ TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
       // Parent reads from pipe
       close(fds[1]);
 
-      const unsigned char locked = parent_read_locked_state(fds[0]);
+      const unsigned char locked = parentReadLockedState(fds[0]);
 
       close(fds[0]);
 
@@ -147,6 +148,7 @@ TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
 
   EXPECT_TRUE(locker.unlock());
 }
+}
 
 } // namespace util
 } // namespace isc



More information about the bind10-changes mailing list