[svn] commit: r2745 - in /trunk/src: bin/auth/ lib/cc/ lib/cc/tests/ lib/config/ lib/config/tests/ lib/datasrc/ lib/datasrc/tests/ lib/dns/ lib/dns/python/ lib/dns/rdata/generic/ lib/dns/tests/ lib/dns/util/ lib/xfr/

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Aug 16 22:08:14 UTC 2010


Author: jinmei
Date: Mon Aug 16 22:08:14 2010
New Revision: 2745

Log:
style fixes:
 - added surrandong parentheses for return values based on agreed guideline
 - removed redundant semicolons after a block
 - fixed curly brace position

diff is large, but the change is very trivial.  so I'm skipping explicit review.

Modified:
    trunk/src/bin/auth/asio_link.cc
    trunk/src/bin/auth/auth_srv.cc
    trunk/src/bin/auth/main.cc
    trunk/src/lib/cc/data.cc
    trunk/src/lib/cc/data.h
    trunk/src/lib/cc/session.cc
    trunk/src/lib/cc/tests/data_unittests.cc
    trunk/src/lib/config/ccsession.cc
    trunk/src/lib/config/config_data.cc
    trunk/src/lib/config/config_data.h
    trunk/src/lib/config/module_spec.cc
    trunk/src/lib/config/module_spec.h
    trunk/src/lib/config/tests/ccsession_unittests.cc
    trunk/src/lib/config/tests/config_data_unittests.cc
    trunk/src/lib/config/tests/fake_session.cc
    trunk/src/lib/config/tests/module_spec_unittests.cc
    trunk/src/lib/datasrc/data_source.cc
    trunk/src/lib/datasrc/data_source.h
    trunk/src/lib/datasrc/sqlite3_datasrc.h
    trunk/src/lib/datasrc/static_datasrc.cc
    trunk/src/lib/datasrc/tests/test_datasrc.cc
    trunk/src/lib/dns/name.h
    trunk/src/lib/dns/python/message_python.cc
    trunk/src/lib/dns/python/messagerenderer_python.cc
    trunk/src/lib/dns/python/name_python.cc
    trunk/src/lib/dns/python/question_python.cc
    trunk/src/lib/dns/python/rdata_python.cc
    trunk/src/lib/dns/python/rrclass_python.cc
    trunk/src/lib/dns/python/rrset_python.cc
    trunk/src/lib/dns/python/rrttl_python.cc
    trunk/src/lib/dns/python/rrtype_python.cc
    trunk/src/lib/dns/rdata/generic/ds_43.cc
    trunk/src/lib/dns/rdata/generic/nsec3_50.cc
    trunk/src/lib/dns/rrsetlist.cc
    trunk/src/lib/dns/rrtype-placeholder.h
    trunk/src/lib/dns/tests/rrparamregistry_unittest.cc
    trunk/src/lib/dns/tests/unittest_util.cc
    trunk/src/lib/dns/util/base16_from_binary.h
    trunk/src/lib/dns/util/base32hex_from_binary.h
    trunk/src/lib/dns/util/binary_from_base16.h
    trunk/src/lib/dns/util/binary_from_base32hex.h
    trunk/src/lib/dns/util/sha1.cc
    trunk/src/lib/xfr/fdshare_python.cc
    trunk/src/lib/xfr/xfrout_client.cc

Modified: trunk/src/bin/auth/asio_link.cc
==============================================================================
--- trunk/src/bin/auth/asio_link.cc (original)
+++ trunk/src/bin/auth/asio_link.cc Mon Aug 16 22:08:14 2010
@@ -563,7 +563,7 @@
 
 asio::io_service&
 IOService::get_io_service() {
-    return impl_->io_service_;
+    return (impl_->io_service_);
 }
 
 void

Modified: trunk/src/bin/auth/auth_srv.cc
==============================================================================
--- trunk/src/bin/auth/auth_srv.cc (original)
+++ trunk/src/bin/auth/auth_srv.cc Mon Aug 16 22:08:14 2010
@@ -521,11 +521,11 @@
         ElementPtr answer = isc::config::createAnswer();
         answer = impl_->setDbFile(new_config);
 
-        return answer;
+        return (answer);
     } catch (const isc::Exception& error) {
         if (impl_->verbose_mode_) {
             cerr << "[b10-auth] error: " << error.what() << endl;
         }
-        return isc::config::createAnswer(1, error.what());
-    }
-}
+        return (isc::config::createAnswer(1, error.what()));
+    }
+}

Modified: trunk/src/bin/auth/main.cc
==============================================================================
--- trunk/src/bin/auth/main.cc (original)
+++ trunk/src/bin/auth/main.cc Mon Aug 16 22:08:14 2010
@@ -68,7 +68,7 @@
 
 ElementPtr
 my_config_handler(ElementPtr new_config) {
-    return auth_server->updateConfig(new_config);
+    return (auth_server->updateConfig(new_config));
 }
 
 ElementPtr
@@ -83,7 +83,7 @@
         io_service->stop();
     }
     
-    return answer;
+    return (answer);
 }
 
 void

Modified: trunk/src/lib/cc/data.cc
==============================================================================
--- trunk/src/lib/cc/data.cc (original)
+++ trunk/src/lib/cc/data.cc Mon Aug 16 22:08:14 2010
@@ -35,24 +35,21 @@
 namespace data {
 
 std::string
-Element::str()
-{
+Element::str() {
     std::stringstream ss;
     toJSON(ss);
-    return ss.str();
+    return (ss.str());
 }
 
 std::string
-Element::toWire()
-{
+Element::toWire() {
     std::stringstream ss;
     toJSON(ss);
-    return ss.str();
-}
-
-void
-Element::toWire(std::ostream& ss)
-{
+    return (ss.str());
+}
+
+void
+Element::toWire(std::ostream& ss) {
     toJSON(ss);
 }
 
@@ -65,63 +62,62 @@
 //
 bool
 Element::getValue(long int& t UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::getValue(double& t UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::getValue(bool& t UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::getValue(std::string& t UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::getValue(std::vector<ElementPtr>& t UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::getValue(std::map<std::string, ElementPtr>& t UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::setValue(const long int v UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::setValue(const double v UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::setValue(const bool t UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::setValue(const std::string& v UNUSED_PARAM) {
-    return false;
+    return (false);
 }
 
 bool
 Element::setValue(const std::vector<ElementPtr>& v UNUSED_PARAM) {
-    return false;
-}
-
-bool
-Element::setValue(const std::map<std::string, ElementPtr>& v UNUSED_PARAM)
-{
-    return false;
+    return (false);
+}
+
+bool
+Element::setValue(const std::map<std::string, ElementPtr>& v UNUSED_PARAM) {
+    return (false);
 }
 
 ElementPtr
@@ -180,7 +176,7 @@
 Element::find(const std::string& identifier UNUSED_PARAM,
               ElementPtr& t UNUSED_PARAM)
 {
-    return false;
+    return (false);
 }
 
 namespace {
@@ -194,11 +190,11 @@
 }
 
 std::ostream& operator <<(std::ostream &out, const isc::data::ElementPtr& e) {
-    return out << e->str();
+    return (out << e->str());
 }
 
 bool operator==(const isc::data::ElementPtr a, const isc::data::ElementPtr b) {
-    return a->equals(b);
+    return (a->equals(b));
 };
 
 //
@@ -206,37 +202,37 @@
 //
 ElementPtr
 Element::create() {
-    return ElementPtr(new NullElement());
+    return (ElementPtr(new NullElement()));
 }
 
 ElementPtr
 Element::create(const long int i) {
-    return ElementPtr(new IntElement(i));
+    return (ElementPtr(new IntElement(i)));
 }
 
 ElementPtr
 Element::create(const double d) {
-    return ElementPtr(new DoubleElement(d));
+    return (ElementPtr(new DoubleElement(d)));
 }
 
 ElementPtr
 Element::create(const std::string& s) {
-    return ElementPtr(new StringElement(s));
+    return (ElementPtr(new StringElement(s)));
 }
 
 ElementPtr
 Element::create(const bool b) {
-    return ElementPtr(new BoolElement(b));
+    return (ElementPtr(new BoolElement(b)));
 }
 
 ElementPtr
 Element::createList() {
-    return ElementPtr(new ListElement());
+    return (ElementPtr(new ListElement()));
 }
 
 ElementPtr
 Element::createMap() {
-    return ElementPtr(new MapElement());
+    return (ElementPtr(new MapElement()));
 }
 
 
@@ -248,10 +244,10 @@
 char_in(const char c, const char *chars) {
     for (size_t i = 0; i < strlen(chars); ++i) {
         if (chars[i] == c) {
-            return true;
-        }
-    }
-    return false;
+            return (true);
+        }
+    }
+    return (false);
 }
 
 void
@@ -332,7 +328,7 @@
         c = in.get();
         ++pos;
     }
-    return ss.str();
+    return (ss.str());
 }
 
 std::string
@@ -342,7 +338,7 @@
         ss << (char) in.get();
     }
     pos += ss.str().size();
-    return ss.str();
+    return (ss.str());
 }
 
 static std::string
@@ -353,7 +349,7 @@
         ss << (char) in.get();
     }
     pos += ss.str().size();
-    return ss.str();
+    return (ss.str());
 }
 
 // Should we change from IntElement and DoubleElement to NumberElement
@@ -386,9 +382,9 @@
     }
     
     if (is_double) {
-        return Element::create(d);
-    } else {
-        return Element::create(i);
+        return (Element::create(d));
+    } else {
+        return (Element::create(i));
     }
 }
 
@@ -398,13 +394,13 @@
 {
     const std::string word = word_from_stringstream(in, pos);
     if (boost::iequals(word, "True")) {
-        return Element::create(true);
+        return (Element::create(true));
     } else if (boost::iequals(word, "False")) {
-        return Element::create(false);
+        return (Element::create(false));
     } else {
         throwJSONError(std::string("Bad boolean value: ") + word, file, line, pos);
         // above is a throw shortcurt, return empty is never reached
-        return ElementPtr();
+        return (ElementPtr());
     }
 }
 
@@ -414,17 +410,17 @@
 {
     const std::string word = word_from_stringstream(in, pos);
     if (boost::iequals(word, "null")) {
-        return Element::create();
+        return (Element::create());
     } else {
         throwJSONError(std::string("Bad null value: ") + word, file, line, pos);
-        return ElementPtr();
+        return (ElementPtr());
     }
 }
 
 ElementPtr
 from_stringstream_string(std::istream& in, const std::string& file, int& line, int& pos)
 {
-    return Element::create(str_from_stringstream(in, file, line, pos));
+    return (Element::create(str_from_stringstream(in, file, line, pos)));
 }
 
 ElementPtr
@@ -444,7 +440,7 @@
         c = in.get();
         pos++;
     }
-    return list;
+    return (list);
 }
 
 ElementPtr
@@ -474,53 +470,53 @@
             pos++;
         }
     }
-    return map;
+    return (map);
 }
 }
 
 std::string
 Element::typeToName(Element::types type)
 {
-    switch(type) {
+    switch (type) {
     case Element::integer:
-        return std::string("integer");
+        return (std::string("integer"));
     case Element::real:
-        return std::string("real");
+        return (std::string("real"));
     case Element::boolean:
-        return std::string("boolean");
+        return (std::string("boolean"));
     case Element::string:
-        return std::string("string");
+        return (std::string("string"));
     case Element::list:
-        return std::string("list");
+        return (std::string("list"));
     case Element::map:
-        return std::string("map");
+        return (std::string("map"));
     case Element::null:
-        return std::string("null");
+        return (std::string("null"));
     case Element::any:
-        return std::string("any");
+        return (std::string("any"));
     default:
-        return std::string("unknown");
+        return (std::string("unknown"));
     }
 }
 
 Element::types
 Element::nameToType(const std::string& type_name) {
     if (type_name == "integer") {
-        return Element::integer;
+        return (Element::integer);
     } else if (type_name == "real") {
-        return Element::real;
+        return (Element::real);
     } else if (type_name == "boolean") {
-        return Element::boolean;
+        return (Element::boolean);
     } else if (type_name == "string") {
-        return Element::string;
+        return (Element::string);
     } else if (type_name == "list") {
-        return Element::list;
+        return (Element::list);
     } else if (type_name == "map") {
-        return Element::map;
+        return (Element::map);
     } else if (type_name == "null") {
-        return Element::null;
+        return (Element::null);
     } else if (type_name == "any") {
-        return Element::any;
+        return (Element::any);
     } else {
         isc_throw(TypeError, type_name + " is not a valid type name");
     }
@@ -529,14 +525,14 @@
 ElementPtr
 Element::fromJSON(std::istream& in) throw(JSONError) {
     int line = 1, pos = 1;
-    return fromJSON(in, "<istream>", line, pos);
+    return (fromJSON(in, "<istream>", line, pos));
 }
 
 ElementPtr
 Element::fromJSON(std::istream& in, const std::string& file_name) throw(JSONError)
 {
     int line = 1, pos = 1;
-    return fromJSON(in, file_name, line, pos);
+    return (fromJSON(in, file_name, line, pos));
 }
 
 ElementPtr
@@ -602,7 +598,7 @@
         }
     }
     if (el_read) {
-        return element;
+        return (element);
     } else {
         isc_throw(JSONError, "nothing read");
     }
@@ -612,7 +608,7 @@
 Element::fromJSON(const std::string &in) {
     std::stringstream ss;
     ss << in;
-    return fromJSON(ss, "<string>");
+    return (fromJSON(ss, "<string>"));
 }
 
 // to JSON format
@@ -698,18 +694,18 @@
 MapElement::find(const std::string& id) {
     const size_t sep = id.find('/');
     if (sep == std::string::npos) {
-        return get(id);
+        return (get(id));
     } else {
         ElementPtr ce = get(id.substr(0, sep));
         if (ce) {
             // ignore trailing slash
             if  (sep + 1 != id.size()) {
-                return ce->find(id.substr(sep + 1));
+                return (ce->find(id.substr(sep + 1)));
             } else {
-                return ce;
+                return (ce);
             }
         } else {
-            return ElementPtr();
+            return (ElementPtr());
         }
     }
 }
@@ -719,7 +715,7 @@
     std::stringstream ss;
     ss << s;
     int line = 0, pos = 0;
-    return fromJSON(ss, "<wire>", line, pos);
+    return (fromJSON(ss, "<wire>", line, pos));
 }
 
 ElementPtr
@@ -735,7 +731,7 @@
     //}
     //length -= 4;
     int line = 0, pos = 0;
-    return fromJSON(in, "<wire>", line, pos);
+    return (fromJSON(in, "<wire>", line, pos));
 }
 
 void
@@ -749,12 +745,12 @@
         ElementPtr p = find(id);
         if (p) {
             t = p;
-            return true;
+            return (true);
         }
     } catch (const TypeError& e) {
         // ignore
     }
-    return false;
+    return (false);
 }
 
 bool
@@ -777,7 +773,7 @@
 
 bool
 NullElement::equals(ElementPtr other) {
-    return other->getType() == Element::null;
+    return (other->getType() == Element::null);
 }
 
 bool
@@ -791,16 +787,16 @@
     if (other->getType() == Element::list) {
         const int s = size();
         if (s != other->size()) {
-            return false;
+            return (false);
         }
         for (int i = 0; i < s; ++i) {
             if (!get(i)->equals(other->get(i))) {
-                return false;
+                return (false);
             }
         }
-        return true;
-    } else {
-        return false;
+        return (true);
+    } else {
+        return (false);
     }
 }
 
@@ -812,10 +808,10 @@
              it != m.end() ; ++it) {
             if (other->contains((*it).first)) {
                 if (!get((*it).first)->equals(other->get((*it).first))) {
-                    return false;
+                    return (false);
                 }
             } else {
-                return false;
+                return (false);
             }
         }
         // quickly walk through the other map too, to see if there's
@@ -827,18 +823,18 @@
         for (std::map<std::string, ElementPtr>::const_iterator it = m.begin();
              it != m.end() ; ++it) {
             if (!contains((*it).first)) {
-                return false;
+                return (false);
             }
         }
-        return true;
-    } else {
-        return false;
+        return (true);
+    } else {
+        return (false);
     }
 }
 
 bool
 isNull(ElementPtr p) {
-    return !p;
+    return (!p);
 }
 
 void

Modified: trunk/src/lib/cc/data.h
==============================================================================
--- trunk/src/lib/cc/data.h (original)
+++ trunk/src/lib/cc/data.h Mon Aug 16 22:08:14 2010
@@ -90,7 +90,7 @@
     virtual ~Element() {};
 
     /// \return the type of this element
-    int getType() { return type; };
+    int getType() { return (type); }
 
     /// Returns a string representing the Element and all its
     /// child elements; note that this is different from stringValue(),
@@ -265,13 +265,13 @@
     //@{
     static ElementPtr create();
     static ElementPtr create(const long int i);
-    static ElementPtr create(const int i) { return create(static_cast<long int>(i)); };
+    static ElementPtr create(const int i) { return (create(static_cast<long int>(i))); };
     static ElementPtr create(const double d);
     static ElementPtr create(const bool b);
     static ElementPtr create(const std::string& s);
     // need both std:string and char *, since c++ will match
     // bool before std::string when you pass it a char *
-    static ElementPtr create(const char *s) { return create(std::string(s)); };
+    static ElementPtr create(const char *s) { return (create(std::string(s))); }
 
     /// \brief Creates an empty ListElement type ElementPtr.
     static ElementPtr createList();
@@ -364,12 +364,12 @@
     long int i;
 
 public:
-    IntElement(long int v) : Element(integer), i(v) { };
-    long int intValue() { return i; }
+    IntElement(long int v) : Element(integer), i(v) { }
+    long int intValue() { return (i); }
     using Element::getValue;
-    bool getValue(long int& t) { t = i; return true; };
+    bool getValue(long int& t) { t = i; return (true); }
     using Element::setValue;
-    bool setValue(const long int v) { i = v; return true; };
+    bool setValue(const long int v) { i = v; return (true); }
     void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
@@ -379,11 +379,11 @@
 
 public:
     DoubleElement(double v) : Element(real), d(v) {};
-    double doubleValue() { return d; }
+    double doubleValue() { return (d); }
     using Element::getValue;
-    bool getValue(double& t) { t = d; return true; };
+    bool getValue(double& t) { t = d; return (true); }
     using Element::setValue;
-    bool setValue(const double v) { d = v; return true; };
+    bool setValue(const double v) { d = v; return (true); }
     void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
@@ -393,11 +393,11 @@
 
 public:
     BoolElement(const bool v) : Element(boolean), b(v) {};
-    bool boolValue() { return b; }
+    bool boolValue() { return (b); }
     using Element::getValue;
-    bool getValue(bool& t) { t = b; return true; };
+    bool getValue(bool& t) { t = b; return (true); }
     using Element::setValue;
-    bool setValue(const bool v) { b = v; return true; };
+    bool setValue(const bool v) { b = v; return (true); }
     void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
@@ -414,11 +414,11 @@
 
 public:
     StringElement(std::string v) : Element(string), s(v) {};
-    std::string stringValue() { return s; };
+    std::string stringValue() { return (s); }
     using Element::getValue;
-    bool getValue(std::string& t) { t = s; return true; };
+    bool getValue(std::string& t) { t = s; return (true); }
     using Element::setValue;
-    bool setValue(const std::string& v) { s = v; return true; };
+    bool setValue(const std::string& v) { s = v; return (true); }
     void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
@@ -428,20 +428,20 @@
 
 public:
     ListElement() : Element(list), l(std::vector<ElementPtr>()) {};
-    const std::vector<ElementPtr>& listValue() { return l; }
+    const std::vector<ElementPtr>& listValue() { return (l); }
     using Element::getValue;
-    bool getValue(std::vector<ElementPtr>& t) { t = l; return true; };
+    bool getValue(std::vector<ElementPtr>& t) { t = l; return (true); }
     using Element::setValue;
-    bool setValue(const std::vector<ElementPtr>& v) { l = v; return true; };
+    bool setValue(const std::vector<ElementPtr>& v) { l = v; return (true); }
     using Element::get;
-    ElementPtr get(int i) { return l.at(i); };
+    ElementPtr get(int i) { return (l.at(i)); }
     using Element::set;
     void set(size_t i, ElementPtr e) { if (i <= l.size()) {l[i] = e;} else { throw std::out_of_range("vector::_M_range_check"); } };
     void add(ElementPtr e) { l.push_back(e); };
     using Element::remove;
     void remove(int i) { l.erase(l.begin() + i); };
     void toJSON(std::ostream& ss);
-    size_t size() { return l.size(); }
+    size_t size() { return (l.size()); }
     bool equals(ElementPtr other);
 };
 
@@ -451,18 +451,18 @@
 public:
     MapElement() : Element(map), m(std::map<std::string, ElementPtr>()) {};
     // TODO: should we have direct iterators instead of exposing the std::map here?
-    const std::map<std::string, ElementPtr>& mapValue() { return m; }
+    const std::map<std::string, ElementPtr>& mapValue() { return (m); }
     using Element::getValue;
-    bool getValue(std::map<std::string, ElementPtr>& t) { t = m; return true; };
+    bool getValue(std::map<std::string, ElementPtr>& t) { t = m; return (true); }
     using Element::setValue;
-    bool setValue(std::map<std::string, ElementPtr>& v) { m = v; return true; };
+    bool setValue(std::map<std::string, ElementPtr>& v) { m = v; return (true); }
     using Element::get;
-    ElementPtr get(const std::string& s) { if (contains(s)) { return m[s]; } else { return ElementPtr();} };
+    ElementPtr get(const std::string& s) { if (contains(s)) { return (m[s]); } else { return (ElementPtr());} }
     using Element::set;
     void set(const std::string& key, ElementPtr value);
     using Element::remove;
     void remove(const std::string& s) { m.erase(s); }
-    bool contains(const std::string& s) { return m.find(s) != m.end(); }
+    bool contains(const std::string& s) { return (m.find(s) != m.end()); }
     void toJSON(std::ostream& ss);
     
     // we should name the two finds better...

Modified: trunk/src/lib/cc/session.cc
==============================================================================
--- trunk/src/lib/cc/session.cc (original)
+++ trunk/src/lib/cc/session.cc Mon Aug 16 22:08:14 2010
@@ -268,7 +268,7 @@
 bool
 Session::recvmsg(ElementPtr& msg, bool nonblock, int seq) {
     ElementPtr l_env;
-    return recvmsg(l_env, msg, nonblock, seq);
+    return (recvmsg(l_env, msg, nonblock, seq));
 }
 
 bool
@@ -290,7 +290,7 @@
                    env = q_el->get(0);
                    msg = q_el->get(1);
                    impl_->queue_->remove(i);
-                   return true;
+                   return (true);
             }
         }
     }
@@ -328,13 +328,13 @@
        ) {
         env = l_env;
         msg = l_msg;
-        return true;
+        return (true);
     } else {
         ElementPtr q_el = Element::createList();
         q_el->add(l_env);
         q_el->add(l_msg);
         impl_->queue_->add(q_el);
-        return recvmsg(env, msg, nonblock, seq);
+        return (recvmsg(env, msg, nonblock, seq));
     }
     // XXXMLG handle non-block here, and return false for short reads
 }
@@ -377,7 +377,7 @@
     //env->set("msg", Element::create(msg->toWire()));
 
     sendmsg(env, msg);
-    return nseq;
+    return (nseq);
 }
 
 bool
@@ -402,12 +402,11 @@
 
     sendmsg(env, newmsg);
 
-    return nseq;
+    return (nseq);
 }
 
 bool
-Session::hasQueuedMsgs()
-{
+Session::hasQueuedMsgs() {
     return (impl_->queue_->size() > 0);
 }
 

Modified: trunk/src/lib/cc/tests/data_unittests.cc
==============================================================================
--- trunk/src/lib/cc/tests/data_unittests.cc (original)
+++ trunk/src/lib/cc/tests/data_unittests.cc Mon Aug 16 22:08:14 2010
@@ -400,7 +400,7 @@
 
 static ElementPtr
 efs(const std::string& str) {
-    return Element::fromJSON(str);
+    return (Element::fromJSON(str));
 }
 
 TEST(Element, equals) {

Modified: trunk/src/lib/config/ccsession.cc
==============================================================================
--- trunk/src/lib/config/ccsession.cc (original)
+++ trunk/src/lib/config/ccsession.cc Mon Aug 16 22:08:14 2010
@@ -53,17 +53,15 @@
 
 /// Creates a standard config/command protocol answer message
 ElementPtr
-createAnswer()
-{
+createAnswer() {
     ElementPtr answer = Element::fromJSON("{\"result\": [] }");
     ElementPtr answer_content = answer->get("result");
     answer_content->add(Element::create(0));
-    return answer;
-}
-
-ElementPtr
-createAnswer(const int rcode, const ElementPtr arg)
-{
+    return (answer);
+}
+
+ElementPtr
+createAnswer(const int rcode, const ElementPtr arg) {
     if (rcode != 0 && (!arg || arg->getType() != Element::string)) {
         isc_throw(CCSessionError, "Bad or no argument for rcode != 0");
     }
@@ -71,22 +69,20 @@
     ElementPtr answer_content = answer->get("result");
     answer_content->add(Element::create(rcode));
     answer_content->add(arg);
-    return answer;
-}
-
-ElementPtr
-createAnswer(const int rcode, const std::string& arg)
-{
+    return (answer);
+}
+
+ElementPtr
+createAnswer(const int rcode, const std::string& arg) {
     ElementPtr answer = Element::fromJSON("{\"result\": [] }");
     ElementPtr answer_content = answer->get("result");
     answer_content->add(Element::create(rcode));
     answer_content->add(Element::create(arg));
-    return answer;
-}
-
-ElementPtr
-parseAnswer(int &rcode, const ElementPtr msg)
-{
+    return (answer);
+}
+
+ElementPtr
+parseAnswer(int &rcode, const ElementPtr msg) {
     if (msg &&
         msg->getType() == Element::map &&
         msg->contains("result")) {
@@ -99,13 +95,13 @@
         rcode = result->get(0)->intValue();
         if (result->size() > 1) {
             if (rcode == 0 || result->get(1)->getType() == Element::string) {
-                return result->get(1);
+                return (result->get(1));
             } else {
                 isc_throw(CCSessionError, "Error description in result with rcode != 0 is not a string");
             }
         } else {
             if (rcode == 0) {
-                return ElementPtr();
+                return (ElementPtr());
             } else {
                 isc_throw(CCSessionError, "Result with rcode != 0 does not have an error description");
             }
@@ -116,14 +112,12 @@
 }
 
 ElementPtr
-createCommand(const std::string& command)
-{
-    return createCommand(command, ElementPtr());
-}
-
-ElementPtr
-createCommand(const std::string& command, ElementPtr arg)
-{
+createCommand(const std::string& command) {
+    return (createCommand(command, ElementPtr()));
+}
+
+ElementPtr
+createCommand(const std::string& command, ElementPtr arg) {
     ElementPtr cmd = Element::createMap();
     ElementPtr cmd_parts = Element::createList();
     cmd_parts->add(Element::create(command));
@@ -131,7 +125,7 @@
         cmd_parts->add(arg);
     }
     cmd->set("command", cmd_parts);
-    return cmd;
+    return (cmd);
 }
 
 /// Returns "" and empty ElementPtr() if this does not
@@ -151,7 +145,7 @@
             } else {
                 arg = ElementPtr();
             }
-            return cmd->get(0)->stringValue();
+            return (cmd->get(0)->stringValue());
         } else {
             isc_throw(CCSessionError, "Command part in command message missing, empty, or not a list");
         }
@@ -182,7 +176,7 @@
         exit(1);
     }
     file.close();
-    return module_spec;
+    return (module_spec);
 }
 
 void
@@ -275,7 +269,7 @@
             setLocalConfig(local_config);
         }
     }
-    return answer;
+    return (answer);
 }
 
 bool
@@ -293,7 +287,7 @@
         /* ignore result messages (in case we're out of sync, to prevent
          * pingpongs */
         if (data->getType() != Element::map || data->contains("result")) {
-            return 0;
+            return (0);
         }
         ElementPtr arg;
         ElementPtr answer;
@@ -308,7 +302,7 @@
                     // in our remote config list, update that
                     updateRemoteConfig(target_module, arg);
                     // we're not supposed to answer to this, so return
-                    return 0;
+                    return (0);
                 }
             } else {
                 if (target_module == module_name_) {
@@ -329,7 +323,7 @@
         }
     }
     
-    return 0;
+    return (0);
 }
 
 std::string
@@ -356,7 +350,7 @@
 
     // all ok, add it
     remote_module_configs_[module_name] = rmod_config;
-    return module_name;
+    return (module_name);
 }
 
 void
@@ -378,7 +372,7 @@
 
     it = remote_module_configs_.find(module_name);
     if (it != remote_module_configs_.end()) {
-        return remote_module_configs_[module_name].getValue(identifier);
+        return (remote_module_configs_[module_name].getValue(identifier));
     } else {
         isc_throw(CCSessionError, "Remote module " + module_name + " not found.");
     }

Modified: trunk/src/lib/config/config_data.cc
==============================================================================
--- trunk/src/lib/config/config_data.cc (original)
+++ trunk/src/lib/config/config_data.cc Mon Aug 16 22:08:14 2010
@@ -104,7 +104,7 @@
         }
     }
     //std::cout << "[XX] found spec part: " << std::endl << spec_part << std::endl;
-    return spec_part;
+    return (spec_part);
 }
 
 //
@@ -142,17 +142,15 @@
 }
 
 ElementPtr
-ConfigData::getValue(const std::string& identifier)
-{
+ConfigData::getValue(const std::string& identifier) {
     // 'fake' is set, but dropped by this function and
     // serves no further purpose.
     bool fake;
-    return getValue(fake, identifier);
+    return (getValue(fake, identifier));
 }
 
 ElementPtr
-ConfigData::getValue(bool& is_default, const std::string& identifier)
-{
+ConfigData::getValue(bool& is_default, const std::string& identifier) {
     ElementPtr value = _config->find(identifier);
     if (value) {
         is_default = false;
@@ -166,7 +164,7 @@
             value = ElementPtr();
         }
     }
-    return value;
+    return (value);
 }
 
 /// Returns an ElementPtr pointing to a ListElement containing
@@ -181,7 +179,7 @@
         spec_part = find_spec_part(spec_part, identifier);
     }
     spec_name_list(result, spec_part, identifier, recurse);
-    return result;
+    return (result);
 }
 
 /// Returns an ElementPtr containing a MapElement with identifier->value
@@ -194,7 +192,7 @@
     BOOST_FOREACH(ElementPtr item, items->listValue()) {
         result->set(item->stringValue(), getValue(item->stringValue()));
     }
-    return result;
+    return (result);
 }
 
 }

Modified: trunk/src/lib/config/config_data.h
==============================================================================
--- trunk/src/lib/config/config_data.h (original)
+++ trunk/src/lib/config/config_data.h Mon Aug 16 22:08:14 2010
@@ -70,7 +70,7 @@
     ElementPtr getValue(bool &is_default, const std::string& identifier);
 
     /// Returns the ModuleSpec associated with this ConfigData object
-    const ModuleSpec getModuleSpec() { return _module_spec; };
+    const ModuleSpec getModuleSpec() { return (_module_spec); }
     
     /// Set the ModuleSpec associated with this ConfigData object
     void setModuleSpec(ModuleSpec module_spec) { _module_spec = module_spec; };
@@ -84,7 +84,7 @@
     /// Returns the local (i.e. non-default) configuration.
     /// \returns An ElementPtr pointing to a MapElement containing all
     ///          non-default configuration options.
-    ElementPtr getLocalConfig() { return _config; }
+    ElementPtr getLocalConfig() { return (_config); }
     
     /// Returns a list of all possible configuration options as specified
     ///         by the ModuleSpec.

Modified: trunk/src/lib/config/module_spec.cc
==============================================================================
--- trunk/src/lib/config/module_spec.cc (original)
+++ trunk/src/lib/config/module_spec.cc Mon Aug 16 22:08:14 2010
@@ -141,53 +141,49 @@
 }
 
 const ElementPtr
-ModuleSpec::getCommandsSpec() const
-{
+ModuleSpec::getCommandsSpec() const {
     if (module_specification->contains("commands")) {
-        return module_specification->get("commands");
-    } else {
-        return ElementPtr();
+        return (module_specification->get("commands"));
+    } else {
+        return (ElementPtr());
     }
 }
 
 const ElementPtr
-ModuleSpec::getConfigSpec() const
-{
+ModuleSpec::getConfigSpec() const {
     if (module_specification->contains("config_data")) {
-        return module_specification->get("config_data");
-    } else {
-        return ElementPtr();
+        return (module_specification->get("config_data"));
+    } else {
+        return (ElementPtr());
     }
 }
 
 const std::string
-ModuleSpec::getModuleName() const
-{
-    return module_specification->get("module_name")->stringValue();
+ModuleSpec::getModuleName() const {
+    return (module_specification->get("module_name")->stringValue());
 }
 
 const std::string
-ModuleSpec::getModuleDescription() const
-{
+ModuleSpec::getModuleDescription() const {
     if (module_specification->contains("module_description")) {
-        return module_specification->get("module_description")->stringValue();
-    } else {
-        return std::string("");
-    }
-}
-
-bool
-ModuleSpec::validate_config(const ElementPtr data, const bool full)
-{
+        return (module_specification->get("module_description")->stringValue());
+    } else {
+        return (std::string(""));
+    }
+}
+
+bool
+ModuleSpec::validate_config(const ElementPtr data, const bool full) {
     ElementPtr spec = module_specification->find("config_data");
-    return validate_spec_list(spec, data, full, ElementPtr());
-}
-
-bool
-ModuleSpec::validate_config(const ElementPtr data, const bool full, ElementPtr errors)
+    return (validate_spec_list(spec, data, full, ElementPtr()));
+}
+
+bool
+ModuleSpec::validate_config(const ElementPtr data, const bool full,
+                            ElementPtr errors)
 {
     ElementPtr spec = module_specification->find("config_data");
-    return validate_spec_list(spec, data, full, errors);
+    return (validate_spec_list(spec, data, full, errors));
 }
 
 ModuleSpec
@@ -205,7 +201,7 @@
 
     ElementPtr module_spec_element = Element::fromJSON(file, file_name);
     if (module_spec_element->contains("module_spec")) {
-        return ModuleSpec(module_spec_element->get("module_spec"), check);
+        return (ModuleSpec(module_spec_element->get("module_spec"), check));
     } else {
         throw ModuleSpecError("No module_spec in specification");
     }
@@ -213,10 +209,11 @@
 
 ModuleSpec
 moduleSpecFromFile(std::ifstream& in, const bool check)
-                   throw(JSONError, ModuleSpecError) {
+                   throw(JSONError, ModuleSpecError)
+{
     ElementPtr module_spec_element = Element::fromJSON(in);
     if (module_spec_element->contains("module_spec")) {
-        return ModuleSpec(module_spec_element->get("module_spec"), check);
+        return (ModuleSpec(module_spec_element->get("module_spec"), check));
     } else {
         throw ModuleSpecError("No module_spec in specification");
     }
@@ -236,29 +233,29 @@
     std::string cur_item_type;
     cur_item_type = spec->get("item_type")->stringValue();
     if (cur_item_type == "any") {
-        return true;
+        return (true);
     }
     switch (element->getType()) {
         case Element::integer:
-            return cur_item_type == "integer";
+            return (cur_item_type == "integer");
             break;
         case Element::real:
-            return cur_item_type == "real";
+            return (cur_item_type == "real");
             break;
         case Element::boolean:
-            return cur_item_type == "boolean";
+            return (cur_item_type == "boolean");
             break;
         case Element::string:
-            return cur_item_type == "string";
+            return (cur_item_type == "string");
             break;
         case Element::list:
-            return cur_item_type == "list";
+            return (cur_item_type == "list");
             break;
         case Element::map:
-            return cur_item_type == "map";
-            break;
-    }
-    return false;
+            return (cur_item_type == "map");
+            break;
+    }
+    return (false);
 }
 
 bool
@@ -270,7 +267,7 @@
         if (errors) {
             errors->add(Element::create("Type mismatch"));
         }
-        return false;
+        return (false);
     }
     if (data->getType() == Element::list) {
         ElementPtr list_spec = spec->get("list_item_spec");
@@ -279,21 +276,21 @@
                 if (errors) {
                     errors->add(Element::create("Type mismatch"));
                 }
-                return false;
+                return (false);
             }
             if (list_spec->get("item_type")->stringValue() == "map") {
                 if (!validate_item(list_spec, list_el, full, errors)) {
-                    return false;
+                    return (false);
                 }
             }
         }
     }
     if (data->getType() == Element::map) {
         if (!validate_spec_list(spec->get("map_item_spec"), data, full, errors)) {
-            return false;
-        }
-    }
-    return true;
+            return (false);
+        }
+    }
+    return (true);
 }
 
 // spec is a map with item_name etc, data is a map
@@ -306,17 +303,17 @@
     
     if (data_el) {
         if (!validate_item(spec, data_el, full, errors)) {
-            return false;
+            return (false);
         }
     } else {
         if (!optional && full) {
             if (errors) {
                 errors->add(Element::create("Non-optional value missing"));
             }
-            return false;
-        }
-    }
-    return true;
+            return (false);
+        }
+    }
+    return (true);
 }
 
 // spec is a list of maps, data is a map
@@ -326,11 +323,11 @@
     std::string cur_item_name;
     BOOST_FOREACH(ElementPtr cur_spec_el, spec->listValue()) {
         if (!validate_spec(cur_spec_el, data, full, errors)) {
-            return false;
-        }
-    }
-    return true;
-}
-
-}
-}
+            return (false);
+        }
+    }
+    return (true);
+}
+
+}
+}

Modified: trunk/src/lib/config/module_spec.h
==============================================================================
--- trunk/src/lib/config/module_spec.h (original)
+++ trunk/src/lib/config/module_spec.h Mon Aug 16 22:08:14 2010
@@ -34,7 +34,7 @@
     public:
         ModuleSpecError(std::string m = "Module specification is invalid") : msg(m) {}
         ~ModuleSpecError() throw() {}
-        const char* what() const throw() { return msg.c_str(); }
+        const char* what() const throw() { return (msg.c_str()); }
     private:
         std::string msg;
     };
@@ -72,7 +72,7 @@
 
         /// Returns the full module specification as an ElementPtr
         /// \return ElementPtr Shared pointer to the specification
-        const ElementPtr getFullSpec() const { return module_specification; };
+        const ElementPtr getFullSpec() const { return (module_specification); }
 
         /// Returns the module name as specified by the specification
         const std::string getModuleName() const;

Modified: trunk/src/lib/config/tests/ccsession_unittests.cc
==============================================================================
--- trunk/src/lib/config/tests/ccsession_unittests.cc (original)
+++ trunk/src/lib/config/tests/ccsession_unittests.cc Mon Aug 16 22:08:14 2010
@@ -34,12 +34,12 @@
 namespace {
 std::string
 ccspecfile(const std::string name) {
-    return std::string(TEST_DATA_PATH) + "/" + name;
+    return (std::string(TEST_DATA_PATH) + "/" + name);
 }
 
 ElementPtr
 el(const std::string& str) {
-    return Element::fromJSON(str);
+    return (Element::fromJSON(str));
 }
 
 class CCSessionTest : public ::testing::Test {
@@ -183,28 +183,28 @@
 ElementPtr my_config_handler(ElementPtr new_config) {
     if (new_config && new_config->contains("item1") &&
         new_config->get("item1")->intValue() == 5) {
-        return createAnswer(6, "I do not like the number 5");
+        return (createAnswer(6, "I do not like the number 5"));
     }
-    return createAnswer();
+    return (createAnswer());
 }
 
 ElementPtr my_command_handler(const std::string& command,
                               ElementPtr arg UNUSED_PARAM)
 {
     if (command == "good_command") {
-        return createAnswer();
+        return (createAnswer());
     } else if (command == "command_with_arg") {
         if (arg) {
             if (arg->getType() == Element::integer) {
-                return createAnswer(0, el("2"));
+                return (createAnswer(0, el("2")));
             } else {
-                return createAnswer(1, "arg bad type");
+                return (createAnswer(1, "arg bad type"));
             }
         } else {
-            return createAnswer(1, "arg missing");
+            return (createAnswer(1, "arg missing"));
         }
     } else {
-        return createAnswer(1, "bad command");
+        return (createAnswer(1, "bad command"));
     }
 }
 

Modified: trunk/src/lib/config/tests/config_data_unittests.cc
==============================================================================
--- trunk/src/lib/config/tests/config_data_unittests.cc (original)
+++ trunk/src/lib/config/tests/config_data_unittests.cc Mon Aug 16 22:08:14 2010
@@ -26,10 +26,9 @@
 using namespace isc::config;
 
 ConfigData
-setupSpec2()
-{
+setupSpec2() {
     ModuleSpec spec2 = moduleSpecFromFile(std::string(TEST_DATA_PATH) + "/spec22.spec");
-    return ConfigData(spec2);
+    return (ConfigData(spec2));
 }
 
 TEST(ConfigData, Creation) {

Modified: trunk/src/lib/config/tests/fake_session.cc
==============================================================================
--- trunk/src/lib/config/tests/fake_session.cc (original)
+++ trunk/src/lib/config/tests/fake_session.cc Mon Aug 16 22:08:14 2010
@@ -145,7 +145,7 @@
         // do we need initial message to have env[group] and [to] too?
         msg = messages_->get(0);
         messages_->remove(0);
-        return true;
+        return (true);
     } else if (msg_queue_) {
         BOOST_FOREACH(ElementPtr c_m, msg_queue_->listValue()) {
             ElementPtr to_remove = ElementPtr();
@@ -158,13 +158,13 @@
             }
             if (to_remove) {
                 listRemove(msg_queue_, to_remove);
-                return true;
+                return (true);
             }
         }
     }
     msg = ElementPtr();
     env = ElementPtr();
-    return false;
+    return (false);
 }
 
 void
@@ -198,7 +198,7 @@
     //cout << "[XX] client sends message: " << msg << endl;
     //cout << "[XX] to: " << group << " . " << instance << "." << to << endl;
     addMessage(msg, group, to);
-    return 1;
+    return (1);
 }
 
 bool
@@ -213,12 +213,12 @@
     //cout << "[XX] client sends reply: " << newmsg << endl;
     //cout << "[XX] env: " << envelope << endl;
     addMessage(newmsg, envelope->get("group")->stringValue(), envelope->get("to")->stringValue());
-    return 1;
+    return (1);
 }
 
 bool
 FakeSession::hasQueuedMsgs() {
-    return false;
+    return (false);
 }
 
 ElementPtr
@@ -229,7 +229,7 @@
         msg_queue_->remove(0);
         group = el->get(0)->stringValue();
         to = el->get(1)->stringValue();
-        return el->get(2);
+        return (el->get(2));
     } else {
         group = "";
         to = "";

Modified: trunk/src/lib/config/tests/module_spec_unittests.cc
==============================================================================
--- trunk/src/lib/config/tests/module_spec_unittests.cc (original)
+++ trunk/src/lib/config/tests/module_spec_unittests.cc Mon Aug 16 22:08:14 2010
@@ -26,7 +26,7 @@
 using namespace isc::config;
 
 std::string specfile(const std::string name) {
-    return std::string(TEST_DATA_PATH) + "/" + name;
+    return (std::string(TEST_DATA_PATH) + "/" + name);
 }
 
 void
@@ -134,15 +134,14 @@
 }
 
 bool
-data_test(ModuleSpec dd, const std::string& data_file_name)
-{
+data_test(ModuleSpec dd, const std::string& data_file_name) {
     std::ifstream data_file;
 
     data_file.open(specfile(data_file_name).c_str());
     ElementPtr data = Element::fromJSON(data_file, data_file_name);
     data_file.close();
 
-    return dd.validate_config(data);
+    return (dd.validate_config(data));
 }
 
 bool
@@ -154,7 +153,7 @@
     ElementPtr data = Element::fromJSON(data_file, data_file_name);
     data_file.close();
 
-    return dd.validate_config(data, true, errors);
+    return (dd.validate_config(data, true, errors));
 }
 
 TEST(ModuleSpec, DataValidation) {

Modified: trunk/src/lib/datasrc/data_source.cc
==============================================================================
--- trunk/src/lib/datasrc/data_source.cc (original)
+++ trunk/src/lib/datasrc/data_source.cc Mon Aug 16 22:08:14 2010
@@ -1246,7 +1246,7 @@
 //
 DataSrc::Result
 DataSrc::init(const isc::data::ElementPtr config UNUSED_PARAM) {
-    return NOT_IMPLEMENTED;
+    return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result

Modified: trunk/src/lib/datasrc/data_source.h
==============================================================================
--- trunk/src/lib/datasrc/data_source.h (original)
+++ trunk/src/lib/datasrc/data_source.h Mon Aug 16 22:08:14 2010
@@ -182,13 +182,13 @@
 
     virtual void findClosestEnclosure(DataSrcMatch& match) const = 0;
 
-    const isc::dns::RRClass& getClass() const { return rrclass; }
+    const isc::dns::RRClass& getClass() const { return (rrclass); }
     void setClass(isc::dns::RRClass& c) { rrclass = c; }
     void setClass(const isc::dns::RRClass& c) { rrclass = c; }
 
-    Result init() { return NOT_IMPLEMENTED; }
+    Result init() { return (NOT_IMPLEMENTED); }
     Result init(const isc::data::ElementPtr config);
-    Result close() { return NOT_IMPLEMENTED; }
+    Result close() { return (NOT_IMPLEMENTED); }
 
     virtual Result findRRset(const isc::dns::Name& qname,
                              const isc::dns::RRClass& qclass,
@@ -247,7 +247,7 @@
 
     void addDataSrc(ConstDataSrcPtr data_src);
     void removeDataSrc(ConstDataSrcPtr data_src);
-    size_t dataSrcCount() { return data_sources.size(); };
+    size_t dataSrcCount() { return (data_sources.size()); }
     
     void findClosestEnclosure(DataSrcMatch& match) const;
 

Modified: trunk/src/lib/datasrc/sqlite3_datasrc.h
==============================================================================
--- trunk/src/lib/datasrc/sqlite3_datasrc.h (original)
+++ trunk/src/lib/datasrc/sqlite3_datasrc.h Mon Aug 16 22:08:14 2010
@@ -94,7 +94,7 @@
                              std::string& hash,
                              isc::dns::RRsetList& target) const;
 
-    Result init() { return init(isc::data::ElementPtr()); };
+    Result init() { return (init(isc::data::ElementPtr())); }
     Result init(const isc::data::ElementPtr config);
     Result close();
 

Modified: trunk/src/lib/datasrc/static_datasrc.cc
==============================================================================
--- trunk/src/lib/datasrc/static_datasrc.cc (original)
+++ trunk/src/lib/datasrc/static_datasrc.cc Mon Aug 16 22:08:14 2010
@@ -261,7 +261,7 @@
 // is intentionally ignored.
 DataSrc::Result
 StaticDataSrc::init(const isc::data::ElementPtr config UNUSED_PARAM) {
-    return init();
+    return (init());
 }
 
 DataSrc::Result

Modified: trunk/src/lib/datasrc/tests/test_datasrc.cc
==============================================================================
--- trunk/src/lib/datasrc/tests/test_datasrc.cc (original)
+++ trunk/src/lib/datasrc/tests/test_datasrc.cc Mon Aug 16 22:08:14 2010
@@ -309,7 +309,7 @@
 DataSrc::Result
 TestDataSrc::init(const isc::data::ElementPtr config UNUSED_PARAM)
 {
-    return init();
+    return (init());
 }
 
 void

Modified: trunk/src/lib/dns/name.h
==============================================================================
--- trunk/src/lib/dns/name.h (original)
+++ trunk/src/lib/dns/name.h Mon Aug 16 22:08:14 2010
@@ -406,7 +406,7 @@
     /// This method simply negates the result of \c equal() method, and in that
     /// sense it's redundant.  The separate method is provided just for
     /// convenience.
-    bool nequals(const Name& other) const { return !(equals(other)); }
+    bool nequals(const Name& other) const { return (!(equals(other))); }
 
     /// Same as nequals()
     bool operator!=(const Name& other) const { return (nequals(other)); }

Modified: trunk/src/lib/dns/python/message_python.cc
==============================================================================
--- trunk/src/lib/dns/python/message_python.cc (original)
+++ trunk/src/lib/dns/python/message_python.cc Mon Aug 16 22:08:14 2010
@@ -326,9 +326,9 @@
 static PyObject*
 Opcode_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*
@@ -624,9 +624,9 @@
 static PyObject*
 Rcode_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*
@@ -886,22 +886,22 @@
 
 static PyObject*
 Section_QUESTION(s_Section* self UNUSED_PARAM) {
-    return Section_createStatic(Section::QUESTION());
+    return (Section_createStatic(Section::QUESTION()));
 }
 
 static PyObject*
 Section_ANSWER(s_Section* self UNUSED_PARAM) {
-    return Section_createStatic(Section::ANSWER());
+    return (Section_createStatic(Section::ANSWER()));
 }
 
 static PyObject*
 Section_AUTHORITY(s_Section* self UNUSED_PARAM) {
-    return Section_createStatic(Section::AUTHORITY());
+    return (Section_createStatic(Section::AUTHORITY()));
 }
 
 static PyObject*
 Section_ADDITIONAL(s_Section* self UNUSED_PARAM) {
-    return Section_createStatic(Section::ADDITIONAL());
+    return (Section_createStatic(Section::ADDITIONAL()));
 }
 
 static PyObject* 
@@ -1526,9 +1526,9 @@
 static PyObject*
 Message_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/messagerenderer_python.cc
==============================================================================
--- trunk/src/lib/dns/python/messagerenderer_python.cc (original)
+++ trunk/src/lib/dns/python/messagerenderer_python.cc Mon Aug 16 22:08:14 2010
@@ -133,9 +133,9 @@
 
 static PyObject*
 MessageRenderer_getData(s_MessageRenderer* self) {
-    return Py_BuildValue("y#",
+    return (Py_BuildValue("y#",
                          self->messagerenderer->getData(),
-                         self->messagerenderer->getLength());
+                          self->messagerenderer->getLength()));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/name_python.cc
==============================================================================
--- trunk/src/lib/dns/python/name_python.cc (original)
+++ trunk/src/lib/dns/python/name_python.cc Mon Aug 16 22:08:14 2010
@@ -400,9 +400,9 @@
     // Simply call the to_text method we already defined
     // str() is not defined in the c++ version, only to_text
     // and we already have a wrapper for that one.
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/question_python.cc
==============================================================================
--- trunk/src/lib/dns/python/question_python.cc (original)
+++ trunk/src/lib/dns/python/question_python.cc Mon Aug 16 22:08:14 2010
@@ -231,9 +231,9 @@
 static PyObject*
 Question_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/rdata_python.cc
==============================================================================
--- trunk/src/lib/dns/python/rdata_python.cc (original)
+++ trunk/src/lib/dns/python/rdata_python.cc Mon Aug 16 22:08:14 2010
@@ -174,9 +174,9 @@
 static PyObject*
 Rdata_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/rrclass_python.cc
==============================================================================
--- trunk/src/lib/dns/python/rrclass_python.cc (original)
+++ trunk/src/lib/dns/python/rrclass_python.cc Mon Aug 16 22:08:14 2010
@@ -215,9 +215,9 @@
 static PyObject*
 RRClass_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/rrset_python.cc
==============================================================================
--- trunk/src/lib/dns/python/rrset_python.cc (original)
+++ trunk/src/lib/dns/python/rrset_python.cc Mon Aug 16 22:08:14 2010
@@ -293,9 +293,9 @@
 static PyObject*
 RRset_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/rrttl_python.cc
==============================================================================
--- trunk/src/lib/dns/python/rrttl_python.cc (original)
+++ trunk/src/lib/dns/python/rrttl_python.cc Mon Aug 16 22:08:14 2010
@@ -213,9 +213,9 @@
 static PyObject*
 RRTTL_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self,
+    return (PyObject_CallMethod(self,
                                const_cast<char*>("to_text"),
-                               const_cast<char*>(""));
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/python/rrtype_python.cc
==============================================================================
--- trunk/src/lib/dns/python/rrtype_python.cc (original)
+++ trunk/src/lib/dns/python/rrtype_python.cc Mon Aug 16 22:08:14 2010
@@ -253,8 +253,8 @@
 static PyObject*
 RRType_str(PyObject* self) {
     // Simply call the to_text method we already defined
-    return PyObject_CallMethod(self, const_cast<char*>("to_text"),
-                                     const_cast<char*>(""));
+    return (PyObject_CallMethod(self, const_cast<char*>("to_text"),
+                                const_cast<char*>("")));
 }
 
 static PyObject*

Modified: trunk/src/lib/dns/rdata/generic/ds_43.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/ds_43.cc (original)
+++ trunk/src/lib/dns/rdata/generic/ds_43.cc Mon Aug 16 22:08:14 2010
@@ -173,7 +173,7 @@
 
 uint16_t
 DS::getTag() const {
-    return impl_->tag_;
+    return (impl_->tag_);
 }
 
 // END_RDATA_NAMESPACE

Modified: trunk/src/lib/dns/rdata/generic/nsec3_50.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/nsec3_50.cc (original)
+++ trunk/src/lib/dns/rdata/generic/nsec3_50.cc Mon Aug 16 22:08:14 2010
@@ -323,22 +323,22 @@
 
 uint8_t
 NSEC3::getHashalg() const {
-    return impl_->hashalg_;
+    return (impl_->hashalg_);
 }
 
 uint8_t
 NSEC3::getFlags() const {
-    return impl_->flags_;
+    return (impl_->flags_);
 }
 
 uint16_t
 NSEC3::getIterations() const {
-    return impl_->iterations_;
+    return (impl_->iterations_);
 }
 
 vector<uint8_t>&
 NSEC3::getSalt() const {
-    return impl_->salt_;
+    return (impl_->salt_);
 }
 
 // END_RDATA_NAMESPACE

Modified: trunk/src/lib/dns/rrsetlist.cc
==============================================================================
--- trunk/src/lib/dns/rrsetlist.cc (original)
+++ trunk/src/lib/dns/rrsetlist.cc Mon Aug 16 22:08:14 2010
@@ -53,10 +53,10 @@
     BOOST_FOREACH(RRsetPtr rrsetptr, rrsets_) {
         if ((rrsetptr->getClass() == rrclass) &&
             (rrsetptr->getType() == rrtype)) {
-            return rrsetptr;
+            return (rrsetptr);
         }
     }
-    return RRsetPtr();
+    return (RRsetPtr());
 }
 
 }

Modified: trunk/src/lib/dns/rrtype-placeholder.h
==============================================================================
--- trunk/src/lib/dns/rrtype-placeholder.h (original)
+++ trunk/src/lib/dns/rrtype-placeholder.h Mon Aug 16 22:08:14 2010
@@ -221,7 +221,7 @@
     bool equals(const RRType& other) const
     { return (typecode_ == other.typecode_); }
     /// \brief Same as \c equals().
-    bool operator==(const RRType& other) const { return equals(other); }
+    bool operator==(const RRType& other) const { return (equals(other)); }
 
     /// \brief Return true iff two RRTypes are equal.
     ///
@@ -232,7 +232,7 @@
     bool nequals(const RRType& other) const 
     { return (typecode_ != other.typecode_); }
     /// \brief Same as \c nequals().
-    bool operator!=(const RRType& other) const { return nequals(other); }
+    bool operator!=(const RRType& other) const { return (nequals(other)); }
  
     /// \brief Less-than comparison for RRType against \c other
     ///

Modified: trunk/src/lib/dns/tests/rrparamregistry_unittest.cc
==============================================================================
--- trunk/src/lib/dns/tests/rrparamregistry_unittest.cc (original)
+++ trunk/src/lib/dns/tests/rrparamregistry_unittest.cc Mon Aug 16 22:08:14 2010
@@ -107,11 +107,11 @@
 class TestRdataFactory : public AbstractRdataFactory {
 public:
     virtual RdataPtr create(const string& rdata_str) const
-    { return RdataPtr(new in::A(rdata_str)); }
+    { return (RdataPtr(new in::A(rdata_str))); }
     virtual RdataPtr create(InputBuffer& buffer, size_t rdata_len) const
-    { return RdataPtr(new in::A(buffer, rdata_len)); }
+    { return (RdataPtr(new in::A(buffer, rdata_len))); }
     virtual RdataPtr create(const Rdata& source) const
-    { return RdataPtr(new in::A(dynamic_cast<const in::A&>(source))); }
+    { return (RdataPtr(new in::A(dynamic_cast<const in::A&>(source)))); }
 };
 
 TEST_F(RRParamRegistryTest, addRemoveFactory)

Modified: trunk/src/lib/dns/tests/unittest_util.cc
==============================================================================
--- trunk/src/lib/dns/tests/unittest_util.cc (original)
+++ trunk/src/lib/dns/tests/unittest_util.cc Mon Aug 16 22:08:14 2010
@@ -158,7 +158,7 @@
             << "Expected: " << len2 << "\n";
         return (::testing::AssertionFailure(msg));
     }
-    return ::testing::AssertionSuccess();
+    return (::testing::AssertionSuccess());
 }
 
 ::testing::AssertionResult
@@ -177,5 +177,5 @@
             << "Other: " << name2 << "\n";
         return (::testing::AssertionFailure(msg));
     }
-    return ::testing::AssertionSuccess();
+    return (::testing::AssertionSuccess());
 }

Modified: trunk/src/lib/dns/util/base16_from_binary.h
==============================================================================
--- trunk/src/lib/dns/util/base16_from_binary.h (original)
+++ trunk/src/lib/dns/util/base16_from_binary.h Mon Aug 16 22:08:14 2010
@@ -46,7 +46,7 @@
             "0123456789"
             "ABCDEF";
         assert(t < 16);
-        return lookup_table[static_cast<size_t>(t)];
+        return (lookup_table[static_cast<size_t>(t)]);
     }
 };
 

Modified: trunk/src/lib/dns/util/base32hex_from_binary.h
==============================================================================
--- trunk/src/lib/dns/util/base32hex_from_binary.h (original)
+++ trunk/src/lib/dns/util/base32hex_from_binary.h Mon Aug 16 22:08:14 2010
@@ -48,7 +48,7 @@
             "0123456789"
             "ABCDEFGHIJKLMNOPQRSTUV";
         assert(t < 32);
-        return lookup_table[static_cast<size_t>(t)];
+        return (lookup_table[static_cast<size_t>(t)]);
     }
 };
 

Modified: trunk/src/lib/dns/util/binary_from_base16.h
==============================================================================
--- trunk/src/lib/dns/util/binary_from_base16.h (original)
+++ trunk/src/lib/dns/util/binary_from_base16.h Mon Aug 16 22:08:14 2010
@@ -56,7 +56,7 @@
             isc_throw(isc::BadValue,
                       "attempt to decode a value not in base16 char set");
         }
-        return value;
+        return (value);
     }
 };
 

Modified: trunk/src/lib/dns/util/binary_from_base32hex.h
==============================================================================
--- trunk/src/lib/dns/util/binary_from_base32hex.h (original)
+++ trunk/src/lib/dns/util/binary_from_base32hex.h Mon Aug 16 22:08:14 2010
@@ -59,7 +59,7 @@
             isc_throw(isc::BadValue,
                       "attempt to decode a value not in base32hex char set");
         }
-        return value;
+        return (value);
     }
 };
 

Modified: trunk/src/lib/dns/util/sha1.cc
==============================================================================
--- trunk/src/lib/dns/util/sha1.cc (original)
+++ trunk/src/lib/dns/util/sha1.cc Mon Aug 16 22:08:14 2010
@@ -85,9 +85,9 @@
     uint32_t addTemp = context->Length_Low;
     context->Length_Low += length;
     if (context->Length_Low < addTemp && ++context->Length_High == 0) {
-        return true;
+        return (true);
     } else {
-        return false;
+        return (false);
     }
 }
 

Modified: trunk/src/lib/xfr/fdshare_python.cc
==============================================================================
--- trunk/src/lib/xfr/fdshare_python.cc (original)
+++ trunk/src/lib/xfr/fdshare_python.cc Mon Aug 16 22:08:14 2010
@@ -23,25 +23,23 @@
 #include <xfr/fd_share.h>
 
 static PyObject*
-fdshare_recv_fd(PyObject *self UNUSED_PARAM, PyObject *args)
-{
+fdshare_recv_fd(PyObject *self UNUSED_PARAM, PyObject *args) {
     int sock, fd;
     if (!PyArg_ParseTuple(args, "i", &sock)) {
-        return NULL;
+        return (NULL);
     }
     fd = isc::xfr::recv_fd(sock);
-    return Py_BuildValue("i", fd);
+    return (Py_BuildValue("i", fd));
 }
 
 static PyObject*
-fdshare_send_fd(PyObject *self UNUSED_PARAM, PyObject *args)
-{
+fdshare_send_fd(PyObject *self UNUSED_PARAM, PyObject *args) {
     int sock, fd, result;
     if (!PyArg_ParseTuple(args, "ii", &sock, &fd)) {
-        return NULL;
+        return (NULL);
     }
     result = isc::xfr::send_fd(sock, fd);
-    return Py_BuildValue("i", result);
+    return (Py_BuildValue("i", result));
 }
 
 static PyMethodDef fdshare_Methods[] = {
@@ -64,13 +62,12 @@
 };
 
 PyMODINIT_FUNC
-PyInit_libxfr_python(void)
-{
+PyInit_libxfr_python(void) {
     PyObject *mod = PyModule_Create(&bind10_fdshare_python);
     if (mod == NULL) {
-        return NULL;
+        return (NULL);
     }
 
-    return mod;
+    return (mod);
 }
 

Modified: trunk/src/lib/xfr/xfrout_client.cc
==============================================================================
--- trunk/src/lib/xfr/xfrout_client.cc (original)
+++ trunk/src/lib/xfr/xfrout_client.cc Mon Aug 16 22:08:14 2010
@@ -101,7 +101,7 @@
                   "xfr query hasn't been processed properly by xfrout module");
     }
 
-    return 0;
+    return (0);
 }
 
 } // End for xfr




More information about the bind10-changes mailing list