From: Mukund Sivaraman Date: Mon, 24 Sep 2012 05:24:54 +0000 (+0530) Subject: [2218] Change node and level count types from size_t to uint32_t X-Git-Tag: trac2351_base~37^2~1^2~3^2~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55eaa4303d7bc462286b4a6b7f262976f1a346bb;p=thirdparty%2Fkea.git [2218] Change node and level count types from size_t to uint32_t Ideally, size_t should be used for most kinds of memory sizes, but in this case, we are trying to keep down the size of a DomainTree object. --- diff --git a/src/lib/datasrc/memory/domaintree.h b/src/lib/datasrc/memory/domaintree.h index 874c1777aa..96a4870c9c 100644 --- a/src/lib/datasrc/memory/domaintree.h +++ b/src/lib/datasrc/memory/domaintree.h @@ -770,7 +770,7 @@ public: /// chain, 0 will be returned. /// /// \exception None - size_t getLevelCount() const { return (level_count_); } + uint32_t getLevelCount() const { return (level_count_); } /// \brief return the absolute name for the node which this /// \c DomainTreeNodeChain currently refers to. @@ -788,7 +788,7 @@ public: const DomainTreeNode* top_node = top(); isc::dns::Name absolute_name = top_node->getName(); - size_t level = level_count_ - 1; + uint32_t level = level_count_ - 1; while (level > 0) { top_node = nodes_[level - 1]; absolute_name = absolute_name.concatenate(top_node->getName()); @@ -848,7 +848,7 @@ private: // it's also equal to the possible maximum level. const static int RBT_MAX_LEVEL = isc::dns::Name::MAX_LABELS; - size_t level_count_; + uint32_t level_count_; const DomainTreeNode* nodes_[RBT_MAX_LEVEL]; const DomainTreeNode* last_compared_; isc::dns::NameComparisonResult last_comparison_; @@ -1315,7 +1315,7 @@ public: /// It includes nodes internally created as a result of adding a domain /// name that is a subdomain of an existing node of the tree. /// This function is mainly intended to be used for debugging. - size_t getNodeCount() const { return (node_count_); } + uint32_t getNodeCount() const { return (node_count_); } /// \name Debug function //@{ @@ -1448,7 +1448,7 @@ private: typename DomainTreeNode::DomainTreeNodePtr root_; /// the node count of current tree - size_t node_count_; + uint32_t node_count_; /// search policy for domaintree const bool needsReturnEmptyNode_; };