Parcourir la source

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

JINMEI Tatuya il y a 14 ans
Parent
commit
691d3b625c

+ 13 - 13
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);
 
 }

+ 2 - 2
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);
 }
 
 

+ 4 - 4
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

+ 1 - 1
src/lib/log/logger.h

@@ -236,7 +236,7 @@ private:
         if (!loggerptr_) {
             initLoggerImpl();
         }
-        return loggerptr_;
+        return (loggerptr_);
     }
 
     /// \brief Initialize Underlying Implementation and Set loggerptr_

+ 2 - 2
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()));
     }
 }
 

+ 3 - 3
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

+ 4 - 4
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);
 }
 
 

+ 3 - 3
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());
     }
 
 

+ 1 - 1
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:

+ 4 - 4
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:

+ 1 - 1
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);
 }
 
 }

+ 1 - 1
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:

+ 3 - 3
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

+ 2 - 2
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

+ 1 - 1
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));
     }
 };
 

+ 1 - 1
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);
 }

+ 11 - 11
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);
         }
     }
 }