BIND 10 trac2090, updated. f9ff329aa2fd6573f98201e4d3435dcc827f0820 [2090] use offset_ptr::get() for comparison with raw pointers by !=
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jul 20 17:49:45 UTC 2012
The branch, trac2090 has been updated
via f9ff329aa2fd6573f98201e4d3435dcc827f0820 (commit)
from 09dd3c3bfbea07a37971985f773235872d5a9057 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f9ff329aa2fd6573f98201e4d3435dcc827f0820
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Fri Jul 20 10:25:42 2012 -0700
[2090] use offset_ptr::get() for comparison with raw pointers by !=
at least my version of boost doesn't seem to allow the direct comparison
with != between offset_ptr and raw pointers.
also made some trivial style fixes.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/rbtree.h | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/rbtree.h b/src/lib/datasrc/rbtree.h
index 3ff3833..126aa6e 100644
--- a/src/lib/datasrc/rbtree.h
+++ b/src/lib/datasrc/rbtree.h
@@ -417,7 +417,7 @@ RBNode<T>::abstractSuccessor(typename RBNode<T>::RBNodePtr RBNode<T>::*left,
const RBNode<T>* current = this;
// If it has right node, the successor is the left-most node of the right
// subtree.
- if (current->*right != RBNode<T>::NULL_NODE()) {
+ if ((current->*right).get() != RBNode<T>::NULL_NODE()) {
current = (current->*right).get();
const RBNode<T>* left_n;
while ((left_n = (current->*left).get()) != RBNode<T>::NULL_NODE()) {
@@ -1199,7 +1199,7 @@ RBTree<T>::nextNode(RBTreeNodeChain<T>& node_path) const {
const RBNode<T>* down = node->getDown();
if (down != NULLNODE) {
const RBNode<T>* left_most = down;
- while (left_most->left_ != NULLNODE) {
+ while (left_most->getLeft() != NULLNODE) {
left_most = left_most->getLeft();
}
node_path.push(left_most);
@@ -1478,7 +1478,7 @@ RBTree<T>::insertRebalance(typename RBNode<T>::RBNodePtr* root,
{
RBNode<T>* uncle;
RBNode<T>* parent;
- while (node != *root &&
+ while (node != (*root).get() &&
(parent = node->getParent())->color_ == RBNode<T>::RED) {
if (parent == parent->getParent()->getLeft()) {
uncle = parent->getParent()->getRight();
@@ -1525,13 +1525,14 @@ RBTree<T>::insertRebalance(typename RBNode<T>::RBNodePtr* root,
template <typename T>
RBNode<T>*
RBTree<T>::leftRotate(typename RBNode<T>::RBNodePtr* root, RBNode<T>* node) {
- RBNode<T>* right = node->getRight();
- RBNode<T>* rleft = right->getLeft();
+ RBNode<T>* const right = node->getRight();
+ RBNode<T>* const rleft = right->getLeft();
node->right_ = rleft;
- if (rleft != NULLNODE)
+ if (rleft != NULLNODE) {
rleft->parent_ = node;
+ }
- RBNode<T>* parent = node->getParent();
+ RBNode<T>* const parent = node->getParent();
right->parent_ = parent;
if (parent != NULLNODE) {
@@ -1552,16 +1553,17 @@ RBTree<T>::leftRotate(typename RBNode<T>::RBNodePtr* root, RBNode<T>* node) {
template <typename T>
RBNode<T>*
RBTree<T>::rightRotate(typename RBNode<T>::RBNodePtr* root, RBNode<T>* node) {
- RBNode<T>* left = node->getLeft();
- RBNode<T>* lright = left->getRight();
+ RBNode<T>* const left = node->getLeft();
+ RBNode<T>* const lright = left->getRight();
node->left_ = lright;
- if (lright != NULLNODE)
+ if (lright != NULLNODE) {
lright->parent_ = node;
+ }
- RBNode<T>* parent = node->getParent();
+ RBNode<T>* const parent = node->getParent();
left->parent_ = parent;
- if (node->parent_ != NULLNODE) {
+ if (node->getParent() != NULLNODE) {
if (node == parent->getRight()) {
parent->right_ = left;
} else {
More information about the bind10-changes
mailing list