BIND 10 trac558, updated. 691d3b625c7299fc9b7d58cb855615b9b11fe393 [trac558] trivial style fix: added parentheses around 'return'

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Feb 9 01:54:56 UTC 2011


The branch, trac558 has been updated
       via  691d3b625c7299fc9b7d58cb855615b9b11fe393 (commit)
      from  8a2edd0d1909bfdb0f7ddbdfb953eac95c987f2f (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 691d3b625c7299fc9b7d58cb855615b9b11fe393
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue Feb 8 17:54:36 2011 -0800

    [trac558] trivial style fix: added parentheses around 'return'

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

Summary of changes:
 src/lib/log/compiler/message.cc                   |   26 ++++++++++----------
 src/lib/log/filename.cc                           |    4 +-
 src/lib/log/filename.h                            |    8 +++---
 src/lib/log/logger.h                              |    2 +-
 src/lib/log/logger_impl_log4cxx.cc                |    4 +-
 src/lib/log/logger_impl_log4cxx.h                 |    6 ++--
 src/lib/log/message_dictionary.cc                 |    8 +++---
 src/lib/log/message_dictionary.h                  |    6 ++--
 src/lib/log/message_exception.h                   |    2 +-
 src/lib/log/message_reader.h                      |    8 +++---
 src/lib/log/root_logger_name.cc                   |    2 +-
 src/lib/log/root_logger_name.h                    |    2 +-
 src/lib/log/strutil.cc                            |    6 ++--
 src/lib/log/strutil.h                             |    4 +-
 src/lib/log/tests/logger_impl_log4cxx_unittest.cc |    2 +-
 src/lib/log/tests/logger_support_test.cc          |    2 +-
 src/lib/log/xdebuglevel.cc                        |   22 +++++++++---------
 17 files changed, 57 insertions(+), 57 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/log/compiler/message.cc b/src/lib/log/compiler/message.cc
index 04e75d9..5202f30 100644
--- a/src/lib/log/compiler/message.cc
+++ b/src/lib/log/compiler/message.cc
@@ -110,7 +110,7 @@ currentTime() {
 
     // Convert to string and strip out the trailing newline
     string current_time = buffer;
-    return isc::strutil::trim(current_time);
+    return (isc::strutil::trim(current_time));
 }
 
 
@@ -133,7 +133,7 @@ sentinel(Filename& file) {
     string ext = file.extension();
     string sentinel_text = "__" + name + "_" + ext.substr(1);
     isc::strutil::uppercase(sentinel_text);
-    return sentinel_text;
+    return (sentinel_text);
 }
 
 
@@ -160,7 +160,7 @@ quoteString(const string& instring) {
         outstring += instring[i];
     }
 
-    return outstring;
+    return (outstring);
 }
 
 
@@ -183,7 +183,7 @@ sortedIdentifiers(MessageDictionary* dictionary) {
     }
     sort(ident.begin(), ident.end());
 
-    return ident;
+    return (ident);
 }
 
 
@@ -225,7 +225,7 @@ splitNamespace(string ns) {
         components = isc::strutil::tokens(ns, ":");
     }
 
-    return components;
+    return (components);
 }
 
 
@@ -461,7 +461,7 @@ writeProgramFile(const string& file, MessageDictionary* dictionary)
 
         ccfile.close();
 
-        return unique_name;
+        return (unique_name);
     }
     catch (MessageException&) {
         ccfile.close();
@@ -520,15 +520,15 @@ main(int argc, char** argv) {
         switch (opt) {
             case 'h':
                 usage();
-                return 0;
+                return (0);
 
             case 'v':
                 version();
-                return 0;
+                return (0);
 
             default:
                 // A message will have already been output about the error.
-                return 1;
+                return (1);
         }
     }
 
@@ -536,11 +536,11 @@ main(int argc, char** argv) {
     if (optind < (argc - 1)) {
         cout << "Error: excess arguments in command line\n";
         usage();
-        return 1;
+        return (1);
     } else if (optind >= argc) {
         cout << "Error: missing message file\n";
         usage();
-        return 1;
+        return (1);
     }
     string message_file = argv[optind];
 
@@ -575,9 +575,9 @@ main(int argc, char** argv) {
         text = isc::strutil::format(text, e.arguments());
         cerr << text << "\n";
 
-        return 1;
+        return (1);
     }
 
-    return 0;
+    return (0);
 
 }
diff --git a/src/lib/log/filename.cc b/src/lib/log/filename.cc
index 949ed9f..e556c43 100644
--- a/src/lib/log/filename.cc
+++ b/src/lib/log/filename.cc
@@ -106,7 +106,7 @@ Filename::expandWithDefault(const string& defname) const {
         (directory_.empty() ? def_directory : directory_) +
         (name_.empty() ? def_name : name_) +
         (extension_.empty() ? def_extension : extension_);
-    return retstring;
+    return (retstring);
 }
 
 // Use the stored name as default for a given name
@@ -132,7 +132,7 @@ Filename::useAsDefault(const string& name) const {
         (name_directory.empty() ? directory_ : name_directory) +
         (name_name.empty() ? name_ : name_name) +
         (name_extension.empty() ? extension_ : name_extension);
-    return retstring;
+    return (retstring);
 }
 
 
diff --git a/src/lib/log/filename.h b/src/lib/log/filename.h
index 29a9cc8..e5aeceb 100644
--- a/src/lib/log/filename.h
+++ b/src/lib/log/filename.h
@@ -80,22 +80,22 @@ public:
 
     /// \return Stored Filename
     std::string fullName() const {
-        return full_name_;
+        return (full_name_);
     }
 
     /// \return Directory of Given File Name
     std::string directory() const {
-        return directory_;
+        return (directory_);
     }
 
     /// \return Name of Given File Name
     std::string name() const {
-        return name_;
+        return (name_);
     }
 
     /// \return Extension of Given File Name
     std::string extension() const {
-        return extension_;
+        return (extension_);
     }
 
     /// \brief Expand Name with Default
diff --git a/src/lib/log/logger.h b/src/lib/log/logger.h
index 1f1beee..fa3657e 100644
--- a/src/lib/log/logger.h
+++ b/src/lib/log/logger.h
@@ -236,7 +236,7 @@ private:
         if (!loggerptr_) {
             initLoggerImpl();
         }
-        return loggerptr_;
+        return (loggerptr_);
     }
 
     /// \brief Initialize Underlying Implementation and Set loggerptr_
diff --git a/src/lib/log/logger_impl_log4cxx.cc b/src/lib/log/logger_impl_log4cxx.cc
index a655d1d..b0e65f8 100644
--- a/src/lib/log/logger_impl_log4cxx.cc
+++ b/src/lib/log/logger_impl_log4cxx.cc
@@ -203,14 +203,14 @@ LoggerImpl::getSeverityCommon(const log4cxx::LoggerPtr& ptrlogger,
                 return (INFO);
             }
             else {
-                return getSeverityCommon(parent, check_parent);
+                return (getSeverityCommon(parent, check_parent));
             }
         }
         else {
             return (DEFAULT);
         }
     } else {
-        return convertLevel(level->toInt());
+        return (convertLevel(level->toInt()));
     }
 }
 
diff --git a/src/lib/log/logger_impl_log4cxx.h b/src/lib/log/logger_impl_log4cxx.h
index c915581..871d82d 100644
--- a/src/lib/log/logger_impl_log4cxx.h
+++ b/src/lib/log/logger_impl_log4cxx.h
@@ -107,7 +107,7 @@ public:
     /// \return The current logging level of this logger.  In most cases though,
     /// the effective logging level is what is required.
     virtual isc::log::Severity getSeverity() {
-        return getSeverityCommon(getLogger(), false);
+        return (getSeverityCommon(getLogger(), false));
     }
 
 
@@ -117,7 +117,7 @@ public:
     /// as getSeverity() if the logger has a severity level set, but otherwise
     /// is the severity of the parent.
     virtual isc::log::Severity getEffectiveSeverity() {
-        return getSeverityCommon(getLogger(), true);
+        return (getSeverityCommon(getLogger(), true));
     }
 
 
@@ -294,7 +294,7 @@ private:
         if (loggerptr_ == NULL) {
             initLogger();
         }
-        return *loggerptr_;
+        return (*loggerptr_);
     }
 
     // Members.  Note that loggerptr_ is a pointer to a LoggerPtr, which is
diff --git a/src/lib/log/message_dictionary.cc b/src/lib/log/message_dictionary.cc
index 7976578..556c14c 100644
--- a/src/lib/log/message_dictionary.cc
+++ b/src/lib/log/message_dictionary.cc
@@ -83,7 +83,7 @@ MessageDictionary::load(const char* messages[]) {
             }
         }
     }
-    return duplicates;
+    return (duplicates);
 }
 
 // Return message text or blank string
@@ -92,10 +92,10 @@ string
 MessageDictionary::getText(const string& ident) const {
     Dictionary::const_iterator i = dictionary_.find(ident);
     if (i == dictionary_.end()) {
-        return string("");
+        return (string(""));
     }
     else {
-        return i->second;
+        return (i->second);
     }
 }
 
@@ -104,7 +104,7 @@ MessageDictionary::getText(const string& ident) const {
 MessageDictionary*
 MessageDictionary::globalDictionary() {
     static MessageDictionary global;
-    return &global;
+    return (&global);
 }
 
 
diff --git a/src/lib/log/message_dictionary.h b/src/lib/log/message_dictionary.h
index 943ac3d..7f918c7 100644
--- a/src/lib/log/message_dictionary.h
+++ b/src/lib/log/message_dictionary.h
@@ -159,19 +159,19 @@ public:
     ///
     /// \return Number of items in the dictionary
     virtual size_t size() const {
-        return dictionary_.size();
+        return (dictionary_.size());
     }
 
 
     /// \brief Return begin() iterator of internal map
     const_iterator begin() const {
-        return dictionary_.begin();
+        return (dictionary_.begin());
     }
 
 
     /// \brief Return end() iterator of internal map
     const_iterator end() const {
-        return dictionary_.end();
+        return (dictionary_.end());
     }
 
 
diff --git a/src/lib/log/message_exception.h b/src/lib/log/message_exception.h
index 537392d..283fb03 100644
--- a/src/lib/log/message_exception.h
+++ b/src/lib/log/message_exception.h
@@ -76,7 +76,7 @@ public:
     ///
     /// \return Exception Arguments
     std::vector<std::string> arguments() const {
-        return args_;
+        return (args_);
     }
 
 private:
diff --git a/src/lib/log/message_reader.h b/src/lib/log/message_reader.h
index bfb9e54..74ede38 100644
--- a/src/lib/log/message_reader.h
+++ b/src/lib/log/message_reader.h
@@ -79,7 +79,7 @@ public:
     ///
     /// \return Pointer to current dictionary object
     MessageDictionary* getDictionary() const {
-        return dictionary_;
+        return (dictionary_);
     }
 
 
@@ -120,7 +120,7 @@ public:
     ///
     /// \return Argument to the $NAMESPACE directive (if present)
     virtual std::string getNamespace() const {
-        return ns_;
+        return (ns_);
     }
 
 
@@ -136,7 +136,7 @@ public:
     ///
     /// \return Argument to the $PREFIX directive (if present)
     virtual std::string getPrefix() const {
-        return prefix_;
+        return (prefix_);
     }
 
 
@@ -155,7 +155,7 @@ public:
     ///
     /// \return Collection of messages not added
     MessageIDCollection getNotAdded() const {
-        return not_added_;
+        return (not_added_);
     }
 
 private:
diff --git a/src/lib/log/root_logger_name.cc b/src/lib/log/root_logger_name.cc
index f330515..32c3ec8 100644
--- a/src/lib/log/root_logger_name.cc
+++ b/src/lib/log/root_logger_name.cc
@@ -22,7 +22,7 @@ namespace log {
 
 std::string& RootLoggerName::rootName() {
     static std::string root_name("");
-    return root_name;
+    return (root_name);
 }
 
 }
diff --git a/src/lib/log/root_logger_name.h b/src/lib/log/root_logger_name.h
index dc58206..0701cab 100644
--- a/src/lib/log/root_logger_name.h
+++ b/src/lib/log/root_logger_name.h
@@ -53,7 +53,7 @@ public:
     ///
     /// \return Name of the root logger.
     static std::string getName() {
-        return rootName();
+        return (rootName());
     }
     
 private:
diff --git a/src/lib/log/strutil.cc b/src/lib/log/strutil.cc
index 4b96601..1fc7a4a 100644
--- a/src/lib/log/strutil.cc
+++ b/src/lib/log/strutil.cc
@@ -58,7 +58,7 @@ trim(const string& instring) {
         }
     }
 
-    return retstring;
+    return (retstring);
 }
 
 // Tokenise string.  As noted in the header, this is locally written to avoid
@@ -89,7 +89,7 @@ tokens(const std::string text, const std::string& delim) {
         }
     }
 
-    return result;
+    return (result);
 }
 
 // Local function to pass to accumulate() for summing up string lengths.
@@ -131,7 +131,7 @@ format(const std::string& format, const std::vector<std::string>& args) {
         }
     }
 
-    return result;
+    return (result);
 }
 
 } // namespace log
diff --git a/src/lib/log/strutil.h b/src/lib/log/strutil.h
index cb0b793..d7ea51e 100644
--- a/src/lib/log/strutil.h
+++ b/src/lib/log/strutil.h
@@ -88,7 +88,7 @@ std::vector<std::string> tokens(const std::string text,
 ///
 /// \return Uppercase version of the argument
 inline char toUpper(char chr) {
-    return static_cast<char>(std::toupper(static_cast<int>(chr)));
+    return (static_cast<char>(std::toupper(static_cast<int>(chr))));
 }
 
 
@@ -113,7 +113,7 @@ inline void uppercase(std::string& text) {
 ///
 /// \return Lowercase version of the argument
 inline char toLower(char chr) {
-    return static_cast<char>(std::tolower(static_cast<int>(chr)));
+    return (static_cast<char>(std::tolower(static_cast<int>(chr))));
 }
 
 /// \brief Lowercase String
diff --git a/src/lib/log/tests/logger_impl_log4cxx_unittest.cc b/src/lib/log/tests/logger_impl_log4cxx_unittest.cc
index 1bbff15..d7e2e8a 100644
--- a/src/lib/log/tests/logger_impl_log4cxx_unittest.cc
+++ b/src/lib/log/tests/logger_impl_log4cxx_unittest.cc
@@ -50,7 +50,7 @@ public:
 
     /// \brief Conversion Between log4cxx Number and BIND-10 Severity
     Severity convertLevel(int value) {
-        return LoggerImpl::convertLevel(value);
+        return (LoggerImpl::convertLevel(value));
     }
 };
 
diff --git a/src/lib/log/tests/logger_support_test.cc b/src/lib/log/tests/logger_support_test.cc
index d65e387..222a633 100644
--- a/src/lib/log/tests/logger_support_test.cc
+++ b/src/lib/log/tests/logger_support_test.cc
@@ -103,5 +103,5 @@ int main(int argc, char** argv) {
     logger_ex.debug(24, MSG_UNRECDIR, "[24]");
     logger_ex.debug(25, MSG_UNRECDIR, "[25]");
     logger_ex.debug(26, MSG_UNRECDIR, "[26]");
-    return 0;
+    return (0);
 }
diff --git a/src/lib/log/xdebuglevel.cc b/src/lib/log/xdebuglevel.cc
index d20872f..512bf73 100644
--- a/src/lib/log/xdebuglevel.cc
+++ b/src/lib/log/xdebuglevel.cc
@@ -71,7 +71,7 @@ XDebugLevel::getExtendedDebug(int level) {
     int actual = std::max(MIN_DEBUG_LEVEL, std::min(MAX_DEBUG_LEVEL, level));
 
     // ... and return a pointer to the appropriate logging level object
-    return dbglevels_[actual - MIN_DEBUG_LEVEL];
+    return (dbglevels_[actual - MIN_DEBUG_LEVEL]);
 }
 
 // Convert an integer (an absolute logging level number, not a debug level) to a
@@ -80,7 +80,7 @@ XDebugLevel::getExtendedDebug(int level) {
 
 LevelPtr
 XDebugLevel::toLevel(int val) {
-    return toLevel(val, getExtendedDebug(MIN_DEBUG_LEVEL));
+    return (toLevel(val, getExtendedDebug(MIN_DEBUG_LEVEL)));
 }
 
 LevelPtr
@@ -89,10 +89,10 @@ XDebugLevel::toLevel(int val, const LevelPtr& defaultLevel) {
     // Note the reversal of the notion of MIN and MAX - see the header file for
     // details.
     if ((val >= XDEBUG_MAX_LEVEL_INT) && (val <= XDEBUG_MIN_LEVEL_INT)) {
-        return getExtendedDebug(XDEBUG_MIN_LEVEL_INT - val);
+        return (getExtendedDebug(XDEBUG_MIN_LEVEL_INT - val));
     }
     else {
-        return defaultLevel;
+        return (defaultLevel);
     }
 }
 
@@ -100,7 +100,7 @@ XDebugLevel::toLevel(int val, const LevelPtr& defaultLevel) {
 
 LevelPtr
 XDebugLevel::toLevelLS(const LogString& sArg) {
-    return toLevelLS(sArg, getExtendedDebug(0));
+    return (toLevelLS(sArg, getExtendedDebug(0)));
 }
 
 LevelPtr
@@ -111,7 +111,7 @@ XDebugLevel::toLevelLS(const LogString& sArg, const LevelPtr& defaultLevel) {
     if (length < 5) {
 
         // String can't possibly start DEBUG so we don't know what it is.
-        return defaultLevel;
+        return (defaultLevel);
     }
     else {
         if (strncasecmp(name.c_str(), "DEBUG", 5) == 0) {
@@ -121,7 +121,7 @@ XDebugLevel::toLevelLS(const LogString& sArg, const LevelPtr& defaultLevel) {
             if (length == 5) {
 
                 // It is plain "DEBUG".  Take this as level 0.
-                return getExtendedDebug(0);
+                return (getExtendedDebug(0));
             }
             else {
 
@@ -132,17 +132,17 @@ XDebugLevel::toLevelLS(const LogString& sArg, const LevelPtr& defaultLevel) {
                 // if DEBUG99 has been specified.
                 try {
                     int level = boost::lexical_cast<int>(name.substr(5));
-                    return getExtendedDebug(level);
+                    return (getExtendedDebug(level));
                 }
-                catch (boost::bad_lexical_cast&) {
-                    return defaultLevel;
+                catch ((boost::bad_lexical_cast&) ){
+                    return (defaultLevel);
                 }
             }
         }
         else {
 
             // Unknown string - return default.
-            return defaultLevel;
+            return (defaultLevel);
         }
     }
 }




More information about the bind10-changes mailing list