[svn] commit: r2032 - in /branches/trac192/src/lib/datasrc: cache.cc cache.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Jun 2 01:08:42 UTC 2010
Author: jinmei
Date: Wed Jun 2 01:08:42 2010
New Revision: 2032
Log:
cleanup: remove unnecessary const from declarations, and add possible (and desirable) const to definitions.
Modified:
branches/trac192/src/lib/datasrc/cache.cc
branches/trac192/src/lib/datasrc/cache.h
Modified: branches/trac192/src/lib/datasrc/cache.cc
==============================================================================
--- branches/trac192/src/lib/datasrc/cache.cc (original)
+++ branches/trac192/src/lib/datasrc/cache.cc Wed Jun 2 01:08:42 2010
@@ -25,8 +25,8 @@
namespace datasrc {
// CacheNode constructors
-CacheNode::CacheNode(const isc::dns::RRsetPtr rrset, uint32_t flags,
- time_t interval) :
+CacheNode::CacheNode(const isc::dns::RRsetPtr rrset, const uint32_t flags,
+ const time_t interval) :
qname(rrset->getName()), qclass(rrset->getClass()), qtype(rrset->getType())
{
time_t now = time(NULL);
@@ -43,7 +43,7 @@
CacheNode::CacheNode(const isc::dns::Name& name,
const isc::dns::RRClass& rrclass,
const isc::dns::RRType& rrtype,
- uint32_t flags,
+ const uint32_t flags,
const time_t interval) :
qname(name), qclass(rrclass), qtype(rrtype)
{
@@ -152,7 +152,7 @@
}
void
-HotCache::setSlots(int slots) {
+HotCache::setSlots(const int slots) {
slots_ = slots;
while (slots_ != 0 && count_ > slots_ && lru_tail_) {
Modified: branches/trac192/src/lib/datasrc/cache.h
==============================================================================
--- branches/trac192/src/lib/datasrc/cache.h (original)
+++ branches/trac192/src/lib/datasrc/cache.h Wed Jun 2 01:08:42 2010
@@ -56,9 +56,7 @@
/// \param flags The query response flags returned from the low-level
/// data source when this \c RRset was looked up.
/// \param interval How long the cache node is to be considered valid.
- CacheNode(const isc::dns::RRsetPtr rrset,
- const uint32_t flags,
- time_t interval);
+ CacheNode(const isc::dns::RRsetPtr rrset, uint32_t flags, time_t interval);
/// \brief Constructor for negative cache entry.
///
@@ -72,8 +70,8 @@
CacheNode(const isc::dns::Name& name,
const isc::dns::RRClass& rrclass,
const isc::dns::RRType& rrtype,
- const uint32_t flags,
- const time_t interval);
+ uint32_t flags,
+ time_t interval);
// \brief Destructor
~CacheNode();
@@ -171,7 +169,7 @@
/// \brief Constructor
///
/// \param slots The number of slots. If zero, the cache is unlimited.
- HotCache(int slots = 0) : slots_(slots), count_(0) {}
+ HotCache(const int slots = 0) : slots_(slots), count_(0) {}
// \brief Destructor
~HotCache();
@@ -187,8 +185,8 @@
/// \param interval How long the cache node is to be considered valid;
/// defaulting to 30 seconds.
void cache(isc::dns::RRsetPtr rrset,
- const uint32_t flags,
- const time_t interval = 30);
+ uint32_t flags,
+ time_t interval = 30);
/// \brief Enter a negative cache entry.
///
@@ -208,8 +206,8 @@
void ncache(const isc::dns::Name& name,
const isc::dns::RRClass& rrclass,
const isc::dns::RRType& rrtype,
- const uint32_t flags,
- const time_t interval = 30);
+ uint32_t flags,
+ time_t interval = 30);
/// \brief Retrieve a record from the cache
///
More information about the bind10-changes
mailing list