Browse Source

[trac449] Parenthesize return statements

Jelte Jansen 14 years ago
parent
commit
26ab69e18b

+ 2 - 2
src/lib/cache/cache_entry_key.cc

@@ -29,7 +29,7 @@ genCacheEntryName(const isc::dns::Name& name,
     ostringstream stream;
     ostringstream stream;
     stream << type.getCode();
     stream << type.getCode();
     keystr += stream.str();
     keystr += stream.str();
-    return keystr;
+    return (keystr);
 }
 }
 
 
 const std::string
 const std::string
@@ -40,7 +40,7 @@ genCacheEntryName(const std::string& namestr,
     ostringstream stream;
     ostringstream stream;
     stream << type;
     stream << type;
     keystr += stream.str();
     keystr += stream.str();
-    return keystr;
+    return (keystr);
 }
 }
 
 
 } // namespace cache
 } // namespace cache

+ 2 - 2
src/lib/cache/local_zone_data.cc

@@ -35,9 +35,9 @@ LocalZoneData::lookup(const isc::dns::Name& name,
     string key = genCacheEntryName(name, type);
     string key = genCacheEntryName(name, type);
     RRsetMapIterator iter = rrsets_map_.find(key);
     RRsetMapIterator iter = rrsets_map_.find(key);
     if (iter == rrsets_map_.end()) {
     if (iter == rrsets_map_.end()) {
-        return RRsetPtr();
+        return (RRsetPtr());
     } else {
     } else {
-        return iter->second;
+        return (iter->second);
     }
     }
 }
 }
 
 

+ 4 - 4
src/lib/cache/message_cache.cc

@@ -47,10 +47,10 @@ MessageCache::lookup(const isc::dns::Name& qname,
     MessageEntryPtr msg_entry = message_table_.get(entry_key);
     MessageEntryPtr msg_entry = message_table_.get(entry_key);
     if(msg_entry) {
     if(msg_entry) {
         message_lru_.touch(msg_entry);
         message_lru_.touch(msg_entry);
-        return msg_entry->genMessage(time(NULL), response);
+        return (msg_entry->genMessage(time(NULL), response));
     }
     }
 
 
-    return false;
+    return (false);
 }
 }
 
 
 bool
 bool
@@ -72,7 +72,7 @@ MessageCache::update(const Message& msg) {
 
 
     MessageEntryPtr msg_entry(new MessageEntry(msg, rrset_cache_));
     MessageEntryPtr msg_entry(new MessageEntry(msg, rrset_cache_));
     message_lru_.add(msg_entry);
     message_lru_.add(msg_entry);
-    return message_table_.add(msg_entry, entry_key, true);
+    return (message_table_.add(msg_entry, entry_key, true));
 }
 }
 
 
 void
 void
@@ -88,7 +88,7 @@ MessageCache::load(const std::string&) {
 bool
 bool
 MessageCache::resize(uint32_t) {
 MessageCache::resize(uint32_t) {
     //TODO
     //TODO
-    return true;
+    return (true);
 }
 }
 
 
 } // namespace cache
 } // namespace cache

+ 16 - 16
src/lib/cache/message_entry.cc

@@ -50,11 +50,11 @@ MessageEntry::getRRsetEntries(vector<RRsetEntryPtr>& rrset_entry_vec,
         if (time_now < rrset_entry->getExpireTime()) {
         if (time_now < rrset_entry->getExpireTime()) {
             rrset_entry_vec.push_back(rrset_entry);
             rrset_entry_vec.push_back(rrset_entry);
         } else {
         } else {
-            return false;
+            return (false);
         }
         }
     }
     }
 
 
-    return true;
+    return (true);
 }
 }
 
 
 void
 void
@@ -84,13 +84,13 @@ MessageEntry::genMessage(const time_t& time_now,
 {
 {
     if (time_now > expire_time_) {
     if (time_now > expire_time_) {
         // The message entry has expired.
         // The message entry has expired.
-        return false;
+        return (false);
     } else {
     } else {
         // Before do any generation, we should check if some rrset
         // Before do any generation, we should check if some rrset
         // has expired, if it is, return false.
         // has expired, if it is, return false.
         vector<RRsetEntryPtr> rrset_entry_vec;
         vector<RRsetEntryPtr> rrset_entry_vec;
         if (false == getRRsetEntries(rrset_entry_vec, time_now)) {
         if (false == getRRsetEntries(rrset_entry_vec, time_now)) {
-            return false;
+            return (false);
         }
         }
 
 
         // Begin message generation. We don't need to add question
         // Begin message generation. We don't need to add question
@@ -104,7 +104,7 @@ MessageEntry::genMessage(const time_t& time_now,
         addRRset(msg, rrset_entry_vec, Message::SECTION_AUTHORITY, dnssec_need);
         addRRset(msg, rrset_entry_vec, Message::SECTION_AUTHORITY, dnssec_need);
         addRRset(msg, rrset_entry_vec, Message::SECTION_ADDITIONAL, dnssec_need);
         addRRset(msg, rrset_entry_vec, Message::SECTION_ADDITIONAL, dnssec_need);
 
 
-        return true;
+        return (true);
     }
     }
 }
 }
 
 
@@ -124,9 +124,9 @@ MessageEntry::getRRsetTrustLevel(const Message& message,
                 RRsetIterator rrset_iter = message.beginSection(section);
                 RRsetIterator rrset_iter = message.beginSection(section);
                 if ((*rrset_iter)->getType() == RRType("CNAME")) {
                 if ((*rrset_iter)->getType() == RRType("CNAME")) {
                     if ((*rrset_iter).get() == rrset.get()) {
                     if ((*rrset_iter).get() == rrset.get()) {
-                        return RRSET_TRUST_ANSWER_AA;
+                        return (RRSET_TRUST_ANSWER_AA);
                     } else {
                     } else {
-                        return RRSET_TRUST_ANSWER_NONAA;
+                        return (RRSET_TRUST_ANSWER_NONAA);
                     }
                     }
                 }
                 }
 
 
@@ -141,40 +141,40 @@ MessageEntry::getRRsetTrustLevel(const Message& message,
                         ((++rrset_iter) != message.endSection(section) &&
                         ((++rrset_iter) != message.endSection(section) &&
                                      (*rrset_iter).get() == rrset.get())) {
                                      (*rrset_iter).get() == rrset.get())) {
 
 
-                        return RRSET_TRUST_ANSWER_AA;
+                        return (RRSET_TRUST_ANSWER_AA);
                     } else {
                     } else {
-                        return RRSET_TRUST_ANSWER_NONAA;
+                        return (RRSET_TRUST_ANSWER_NONAA);
                     }
                     }
                 }
                 }
 
 
-                return RRSET_TRUST_ANSWER_AA;
+                return (RRSET_TRUST_ANSWER_AA);
 
 
             } else {
             } else {
-                return RRSET_TRUST_ANSWER_NONAA;
+                return (RRSET_TRUST_ANSWER_NONAA);
             }
             }
             break;
             break;
         }
         }
 
 
         case Message::SECTION_AUTHORITY: {
         case Message::SECTION_AUTHORITY: {
             if (aa) {
             if (aa) {
-                return RRSET_TRUST_AUTHORITY_AA;
+                return (RRSET_TRUST_AUTHORITY_AA);
             } else {
             } else {
-                return RRSET_TRUST_AUTHORITY_NONAA;
+                return (RRSET_TRUST_AUTHORITY_NONAA);
             }
             }
             break;
             break;
         }
         }
 
 
         case Message::SECTION_ADDITIONAL: {
         case Message::SECTION_ADDITIONAL: {
             if (aa) {
             if (aa) {
-                return RRSET_TRUST_ADDITIONAL_AA;
+                return (RRSET_TRUST_ADDITIONAL_AA);
             } else {
             } else {
-                return RRSET_TRUST_ADDITIONAL_NONAA;
+                return (RRSET_TRUST_ADDITIONAL_NONAA);
             }
             }
             break;
             break;
         }
         }
 
 
         default:
         default:
-            return RRSET_TRUST_DEFAULT;
+            return (RRSET_TRUST_DEFAULT);
     }
     }
 }
 }
 
 

+ 1 - 1
src/lib/cache/message_entry.h

@@ -79,7 +79,7 @@ public:
     /// \brief Get the hash key of the message entry.
     /// \brief Get the hash key of the message entry.
     /// \return return hash key
     /// \return return hash key
     virtual HashKey hashKey() const {
     virtual HashKey hashKey() const {
-        return *hash_key_ptr_;
+        return (*hash_key_ptr_);
     }
     }
 
 
 protected:
 protected:

+ 14 - 14
src/lib/cache/resolver_cache.cc

@@ -70,7 +70,7 @@ ResolverCache::lookup(const isc::dns::Name& qname,
 {
 {
     uint16_t class_code = qclass.getCode();
     uint16_t class_code = qclass.getCode();
     if (!classIsSupported(class_code)) {
     if (!classIsSupported(class_code)) {
-        return false;
+        return (false);
     }
     }
 
 
     // message response should has question section already.
     // message response should has question section already.
@@ -84,11 +84,11 @@ ResolverCache::lookup(const isc::dns::Name& qname,
     RRsetPtr rrset_ptr = (local_zone_data_[class_code])->lookup(qname, qtype);
     RRsetPtr rrset_ptr = (local_zone_data_[class_code])->lookup(qname, qtype);
     if (rrset_ptr) {
     if (rrset_ptr) {
         response.addRRset(Message::SECTION_ANSWER, rrset_ptr);
         response.addRRset(Message::SECTION_ANSWER, rrset_ptr);
-        return true;
+        return (true);
     }
     }
 
 
     // Search in class-specific message cache.
     // Search in class-specific message cache.
-    return messages_cache_[class_code]->lookup(qname, qtype, response);
+    return (messages_cache_[class_code]->lookup(qname, qtype, response));
 }
 }
 
 
 isc::dns::RRsetPtr
 isc::dns::RRsetPtr
@@ -98,7 +98,7 @@ ResolverCache::lookup(const isc::dns::Name& qname,
 {
 {
     uint16_t klass = qclass.getCode();
     uint16_t klass = qclass.getCode();
     if (!classIsSupported(klass)) {
     if (!classIsSupported(klass)) {
-        return RRsetPtr();
+        return (RRsetPtr());
     }
     }
 
 
     // Algorithm:
     // Algorithm:
@@ -106,13 +106,13 @@ ResolverCache::lookup(const isc::dns::Name& qname,
     // 2. Then do search in rrsets_cache_.
     // 2. Then do search in rrsets_cache_.
     RRsetPtr rrset_ptr = local_zone_data_[klass]->lookup(qname, qtype);
     RRsetPtr rrset_ptr = local_zone_data_[klass]->lookup(qname, qtype);
     if (rrset_ptr) {
     if (rrset_ptr) {
-        return rrset_ptr;
+        return (rrset_ptr);
     } else {
     } else {
         RRsetEntryPtr rrset_entry = rrsets_cache_[klass]->lookup(qname, qtype);
         RRsetEntryPtr rrset_entry = rrsets_cache_[klass]->lookup(qname, qtype);
         if (rrset_entry) {
         if (rrset_entry) {
-            return rrset_entry->getRRset();
+            return (rrset_entry->getRRset());
         } else {
         } else {
-            return RRsetPtr();
+            return (RRsetPtr());
         }
         }
     }
     }
 }
 }
@@ -128,13 +128,13 @@ ResolverCache::lookupClosestRRset(const isc::dns::Name& qname,
         Name close_name = qname.split(level);
         Name close_name = qname.split(level);
         RRsetPtr rrset_ptr = lookup(close_name, qtype, qclass);
         RRsetPtr rrset_ptr = lookup(close_name, qtype, qclass);
         if (rrset_ptr) {
         if (rrset_ptr) {
-            return rrset_ptr;
+            return (rrset_ptr);
         } else {
         } else {
             ++level;
             ++level;
         }
         }
     }
     }
 
 
-    return RRsetPtr();
+    return (RRsetPtr());
 }
 }
 
 
 bool
 bool
@@ -142,10 +142,10 @@ ResolverCache::update(const isc::dns::Message& msg) {
     QuestionIterator iter = msg.beginQuestion();
     QuestionIterator iter = msg.beginQuestion();
     uint16_t klass = (*iter)->getClass().getCode();
     uint16_t klass = (*iter)->getClass().getCode();
     if (!classIsSupported(klass)) {
     if (!classIsSupported(klass)) {
-        return false;
+        return (false);
     }
     }
 
 
-    return messages_cache_[klass]->update(msg);
+    return (messages_cache_[klass]->update(msg));
 }
 }
 
 
 bool
 bool
@@ -161,20 +161,20 @@ ResolverCache::updateRRsetCache(const isc::dns::ConstRRsetPtr rrset_ptr,
     }
     }
 
 
     rrset_cache_ptr->update((*rrset_ptr.get()), level);
     rrset_cache_ptr->update((*rrset_ptr.get()), level);
-    return true;
+    return (true);
 }
 }
 
 
 bool
 bool
 ResolverCache::update(const isc::dns::ConstRRsetPtr rrset_ptr) {
 ResolverCache::update(const isc::dns::ConstRRsetPtr rrset_ptr) {
     uint16_t klass = rrset_ptr->getClass().getCode();
     uint16_t klass = rrset_ptr->getClass().getCode();
     if (!classIsSupported(klass)) {
     if (!classIsSupported(klass)) {
-        return false;
+        return (false);
     }
     }
 
 
     // First update local zone, then update rrset cache.
     // First update local zone, then update rrset cache.
     local_zone_data_[klass]->update((*rrset_ptr.get()));
     local_zone_data_[klass]->update((*rrset_ptr.get()));
     updateRRsetCache(rrset_ptr, rrsets_cache_[klass]);
     updateRRsetCache(rrset_ptr, rrsets_cache_[klass]);
-    return true;
+    return (true);
 }
 }
 
 
 void
 void

+ 6 - 6
src/lib/cache/rrset_cache.cc

@@ -45,9 +45,9 @@ RRsetCache::lookup(const isc::dns::Name& qname,
 
 
     //If the rrset entry has expired, return NULL.
     //If the rrset entry has expired, return NULL.
     if(entry_ptr && (time(NULL) > entry_ptr->getExpireTime())) {
     if(entry_ptr && (time(NULL) > entry_ptr->getExpireTime())) {
-        return RRsetEntryPtr();
+        return (RRsetEntryPtr());
     }
     }
-    return entry_ptr;
+    return (entry_ptr);
 }
 }
 
 
 RRsetEntryPtr
 RRsetEntryPtr
@@ -61,7 +61,7 @@ RRsetCache::update(const isc::dns::RRset& rrset, const RRsetTrustLevel& level) {
         // Replace the expired rrset entry if it exists.
         // Replace the expired rrset entry if it exists.
         rrset_table_.add(entry_ptr, entry_ptr->hashKey(), true);
         rrset_table_.add(entry_ptr, entry_ptr->hashKey(), true);
         //TODO , lru list touch.
         //TODO , lru list touch.
-        return entry_ptr;
+        return (entry_ptr);
     } else {
     } else {
         // there is one rrset entry in the cache, need to check whether
         // there is one rrset entry in the cache, need to check whether
         // the new rrset is more authoritative.
         // the new rrset is more authoritative.
@@ -69,7 +69,7 @@ RRsetCache::update(const isc::dns::RRset& rrset, const RRsetTrustLevel& level) {
             // existed rrset entry is more authoritative, do nothing,
             // existed rrset entry is more authoritative, do nothing,
             // just return it.
             // just return it.
             //TODO, lru list touch
             //TODO, lru list touch
-            return entry_ptr;
+            return (entry_ptr);
         } else {
         } else {
             HashKey key = entry_ptr->hashKey();
             HashKey key = entry_ptr->hashKey();
             rrset_table_.remove(key);
             rrset_table_.remove(key);
@@ -77,7 +77,7 @@ RRsetCache::update(const isc::dns::RRset& rrset, const RRsetTrustLevel& level) {
             //TODO, lru list touch.
             //TODO, lru list touch.
             // Replace the expired rrset entry if it exists.
             // Replace the expired rrset entry if it exists.
             rrset_table_.add(entry_ptr, key, true);
             rrset_table_.add(entry_ptr, key, true);
-            return entry_ptr;
+            return (entry_ptr);
         }
         }
     }
     }
 }
 }
@@ -95,7 +95,7 @@ RRsetCache::load(const std::string&) {
 bool
 bool
 RRsetCache::resize(uint32_t) {
 RRsetCache::resize(uint32_t) {
     //TODO
     //TODO
-    return true;
+    return (true);
 }
 }
 
 
 } // namespace cache
 } // namespace cache

+ 2 - 2
src/lib/cache/rrset_entry.cc

@@ -38,12 +38,12 @@ RRsetEntry::RRsetEntry(const isc::dns::RRset& rrset, const RRsetTrustLevel& leve
 isc::dns::RRsetPtr
 isc::dns::RRsetPtr
 RRsetEntry::getRRset() {
 RRsetEntry::getRRset() {
     updateTTL();
     updateTTL();
-    return rrset_;
+    return (rrset_);
 }
 }
 
 
 time_t
 time_t
 RRsetEntry::getExpireTime() const {
 RRsetEntry::getExpireTime() const {
-    return expire_time_;
+    return (expire_time_);
 }
 }
 
 
 void
 void

+ 3 - 3
src/lib/cache/rrset_entry.h

@@ -93,17 +93,17 @@ public:
     /// \brief Get the ttl of the RRset.
     /// \brief Get the ttl of the RRset.
     uint32_t getTTL() {
     uint32_t getTTL() {
         updateTTL();
         updateTTL();
-        return rrset_->getTTL().getValue();
+        return (rrset_->getTTL().getValue());
     }
     }
 
 
     /// \return return hash key
     /// \return return hash key
     HashKey hashKey() const{
     HashKey hashKey() const{
-        return hash_key_;
+        return (hash_key_);
     }
     }
 
 
     /// \brief get RRset trustworthiness
     /// \brief get RRset trustworthiness
     RRsetTrustLevel getTrustLevel() const {
     RRsetTrustLevel getTrustLevel() const {
-        return trust_level_;
+        return (trust_level_);
     }
     }
 private:
 private:
     /// \brief Update TTL according to expiration time
     /// \brief Update TTL according to expiration time

BIN
src/lib/xfr/.libs/libxfr_python.a