fix nil name class in Snow Leopard (obs from Paulo Moura).
This commit is contained in:
parent
d6773df815
commit
adef8d4737
34
C/gprof.c
34
C/gprof.c
@ -213,7 +213,7 @@ static void
|
|||||||
LeftRotate(rb_red_blk_node* x) {
|
LeftRotate(rb_red_blk_node* x) {
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
rb_red_blk_node* y;
|
rb_red_blk_node* y;
|
||||||
rb_red_blk_node* nil=LOCAL_ProfilerNil;
|
rb_red_blk_node* rb_nil=LOCAL_ProfilerNil;
|
||||||
|
|
||||||
/* I originally wrote this function to use the sentinel for */
|
/* I originally wrote this function to use the sentinel for */
|
||||||
/* nil to avoid checking for nil. However this introduces a */
|
/* nil to avoid checking for nil. However this introduces a */
|
||||||
@ -228,7 +228,7 @@ LeftRotate(rb_red_blk_node* x) {
|
|||||||
y=x->right;
|
y=x->right;
|
||||||
x->right=y->left;
|
x->right=y->left;
|
||||||
|
|
||||||
if (y->left != nil) y->left->parent=x; /* used to use sentinel here */
|
if (y->left != rb_nil) y->left->parent=x; /* used to use sentinel here */
|
||||||
/* and do an unconditional assignment instead of testing for nil */
|
/* and do an unconditional assignment instead of testing for nil */
|
||||||
|
|
||||||
y->parent=x->parent;
|
y->parent=x->parent;
|
||||||
@ -270,7 +270,7 @@ static void
|
|||||||
RightRotate(rb_red_blk_node* y) {
|
RightRotate(rb_red_blk_node* y) {
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
rb_red_blk_node* x;
|
rb_red_blk_node* x;
|
||||||
rb_red_blk_node* nil=LOCAL_ProfilerNil;
|
rb_red_blk_node* rb_nil=LOCAL_ProfilerNil;
|
||||||
|
|
||||||
/* I originally wrote this function to use the sentinel for */
|
/* I originally wrote this function to use the sentinel for */
|
||||||
/* nil to avoid checking for nil. However this introduces a */
|
/* nil to avoid checking for nil. However this introduces a */
|
||||||
@ -285,7 +285,7 @@ RightRotate(rb_red_blk_node* y) {
|
|||||||
x=y->left;
|
x=y->left;
|
||||||
y->left=x->right;
|
y->left=x->right;
|
||||||
|
|
||||||
if (nil != x->right) x->right->parent=y; /*used to use sentinel here */
|
if (rb_nil != x->right) x->right->parent=y; /*used to use sentinel here */
|
||||||
/* and do an unconditional assignment instead of testing for nil */
|
/* and do an unconditional assignment instead of testing for nil */
|
||||||
|
|
||||||
/* instead of checking if x->parent is the root as in the book, we */
|
/* instead of checking if x->parent is the root as in the book, we */
|
||||||
@ -325,12 +325,12 @@ TreeInsertHelp(rb_red_blk_node* z) {
|
|||||||
/* This function should only be called by InsertRBTree (see above) */
|
/* This function should only be called by InsertRBTree (see above) */
|
||||||
rb_red_blk_node* x;
|
rb_red_blk_node* x;
|
||||||
rb_red_blk_node* y;
|
rb_red_blk_node* y;
|
||||||
rb_red_blk_node* nil=LOCAL_ProfilerNil;
|
rb_red_blk_node* rb_nil=LOCAL_ProfilerNil;
|
||||||
|
|
||||||
z->left=z->right=nil;
|
z->left=z->right=rb_nil;
|
||||||
y=LOCAL_ProfilerRoot;
|
y=LOCAL_ProfilerRoot;
|
||||||
x=LOCAL_ProfilerRoot->left;
|
x=LOCAL_ProfilerRoot->left;
|
||||||
while( x != nil) {
|
while( x != rb_nil) {
|
||||||
y=x;
|
y=x;
|
||||||
if (x->key > z->key) { /* x.key > z.key */
|
if (x->key > z->key) { /* x.key > z.key */
|
||||||
x=x->left;
|
x=x->left;
|
||||||
@ -447,18 +447,18 @@ static rb_red_blk_node*
|
|||||||
RBExactQuery(yamop* q) {
|
RBExactQuery(yamop* q) {
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
rb_red_blk_node* x;
|
rb_red_blk_node* x;
|
||||||
rb_red_blk_node* nil=LOCAL_ProfilerNil;
|
rb_red_blk_node* rb_nil=LOCAL_ProfilerNil;
|
||||||
|
|
||||||
if (!LOCAL_ProfilerRoot) return NULL;
|
if (!LOCAL_ProfilerRoot) return NULL;
|
||||||
x=LOCAL_ProfilerRoot->left;
|
x=LOCAL_ProfilerRoot->left;
|
||||||
if (x == nil) return NULL;
|
if (x == rb_nil) return NULL;
|
||||||
while(x->key != q) {/*assignemnt*/
|
while(x->key != q) {/*assignemnt*/
|
||||||
if (x->key > q) { /* x->key > q */
|
if (x->key > q) { /* x->key > q */
|
||||||
x=x->left;
|
x=x->left;
|
||||||
} else {
|
} else {
|
||||||
x=x->right;
|
x=x->right;
|
||||||
}
|
}
|
||||||
if ( x == nil) return NULL;
|
if ( x == rb_nil) return NULL;
|
||||||
}
|
}
|
||||||
return(x);
|
return(x);
|
||||||
}
|
}
|
||||||
@ -584,11 +584,11 @@ static rb_red_blk_node*
|
|||||||
TreeSuccessor(rb_red_blk_node* x) {
|
TreeSuccessor(rb_red_blk_node* x) {
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
rb_red_blk_node* y;
|
rb_red_blk_node* y;
|
||||||
rb_red_blk_node* nil=LOCAL_ProfilerNil;
|
rb_red_blk_node* rb_nil=LOCAL_ProfilerNil;
|
||||||
rb_red_blk_node* root=LOCAL_ProfilerRoot;
|
rb_red_blk_node* root=LOCAL_ProfilerRoot;
|
||||||
|
|
||||||
if (nil != (y = x->right)) { /* assignment to y is intentional */
|
if (rb_nil != (y = x->right)) { /* assignment to y is intentional */
|
||||||
while(y->left != nil) { /* returns the minium of the right subtree of x */
|
while(y->left != rb_nil) { /* returns the minium of the right subtree of x */
|
||||||
y=y->left;
|
y=y->left;
|
||||||
}
|
}
|
||||||
return(y);
|
return(y);
|
||||||
@ -598,7 +598,7 @@ TreeSuccessor(rb_red_blk_node* x) {
|
|||||||
x=y;
|
x=y;
|
||||||
y=y->parent;
|
y=y->parent;
|
||||||
}
|
}
|
||||||
if (y == root) return(nil);
|
if (y == root) return(rb_nil);
|
||||||
return(y);
|
return(y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -624,11 +624,11 @@ RBDelete(rb_red_blk_node* z){
|
|||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
rb_red_blk_node* y;
|
rb_red_blk_node* y;
|
||||||
rb_red_blk_node* x;
|
rb_red_blk_node* x;
|
||||||
rb_red_blk_node* nil=LOCAL_ProfilerNil;
|
rb_red_blk_node* rb_nil=LOCAL_ProfilerNil;
|
||||||
rb_red_blk_node* root=LOCAL_ProfilerRoot;
|
rb_red_blk_node* root=LOCAL_ProfilerRoot;
|
||||||
|
|
||||||
y= ((z->left == nil) || (z->right == nil)) ? z : TreeSuccessor(z);
|
y= ((z->left == rb_nil) || (z->right == rb_nil)) ? z : TreeSuccessor(z);
|
||||||
x= (y->left == nil) ? y->right : y->left;
|
x= (y->left == rb_nil) ? y->right : y->left;
|
||||||
if (root == (x->parent = y->parent)) { /* assignment of y->p to x->p is intentional */
|
if (root == (x->parent = y->parent)) { /* assignment of y->p to x->p is intentional */
|
||||||
root->left=x;
|
root->left=x;
|
||||||
} else {
|
} else {
|
||||||
|
14
C/heapgc.c
14
C/heapgc.c
@ -622,7 +622,7 @@ RBTreeCreate(void) {
|
|||||||
static void
|
static void
|
||||||
LeftRotate(rb_red_blk_node* x USES_REGS) {
|
LeftRotate(rb_red_blk_node* x USES_REGS) {
|
||||||
rb_red_blk_node* y;
|
rb_red_blk_node* y;
|
||||||
rb_red_blk_node* nil=LOCAL_db_nil;
|
rb_red_blk_node* rb_nil=LOCAL_db_nil;
|
||||||
|
|
||||||
/* I originally wrote this function to use the sentinel for */
|
/* I originally wrote this function to use the sentinel for */
|
||||||
/* nil to avoid checking for nil. However this introduces a */
|
/* nil to avoid checking for nil. However this introduces a */
|
||||||
@ -637,7 +637,7 @@ LeftRotate(rb_red_blk_node* x USES_REGS) {
|
|||||||
y=x->right;
|
y=x->right;
|
||||||
x->right=y->left;
|
x->right=y->left;
|
||||||
|
|
||||||
if (y->left != nil) y->left->parent=x; /* used to use sentinel here */
|
if (y->left != rb_nil) y->left->parent=x; /* used to use sentinel here */
|
||||||
/* and do an unconditional assignment instead of testing for nil */
|
/* and do an unconditional assignment instead of testing for nil */
|
||||||
|
|
||||||
y->parent=x->parent;
|
y->parent=x->parent;
|
||||||
@ -678,7 +678,7 @@ LeftRotate(rb_red_blk_node* x USES_REGS) {
|
|||||||
static void
|
static void
|
||||||
RightRotate(rb_red_blk_node* y USES_REGS) {
|
RightRotate(rb_red_blk_node* y USES_REGS) {
|
||||||
rb_red_blk_node* x;
|
rb_red_blk_node* x;
|
||||||
rb_red_blk_node* nil=LOCAL_db_nil;
|
rb_red_blk_node* rb_nil=LOCAL_db_nil;
|
||||||
|
|
||||||
/* I originally wrote this function to use the sentinel for */
|
/* I originally wrote this function to use the sentinel for */
|
||||||
/* nil to avoid checking for nil. However this introduces a */
|
/* nil to avoid checking for nil. However this introduces a */
|
||||||
@ -693,7 +693,7 @@ RightRotate(rb_red_blk_node* y USES_REGS) {
|
|||||||
x=y->left;
|
x=y->left;
|
||||||
y->left=x->right;
|
y->left=x->right;
|
||||||
|
|
||||||
if (nil != x->right) x->right->parent=y; /*used to use sentinel here */
|
if (rb_nil != x->right) x->right->parent=y; /*used to use sentinel here */
|
||||||
/* and do an unconditional assignment instead of testing for nil */
|
/* and do an unconditional assignment instead of testing for nil */
|
||||||
|
|
||||||
/* instead of checking if x->parent is the root as in the book, we */
|
/* instead of checking if x->parent is the root as in the book, we */
|
||||||
@ -732,12 +732,12 @@ TreeInsertHelp(rb_red_blk_node* z USES_REGS) {
|
|||||||
/* This function should only be called by InsertRBTree (see above) */
|
/* This function should only be called by InsertRBTree (see above) */
|
||||||
rb_red_blk_node* x;
|
rb_red_blk_node* x;
|
||||||
rb_red_blk_node* y;
|
rb_red_blk_node* y;
|
||||||
rb_red_blk_node* nil=LOCAL_db_nil;
|
rb_red_blk_node* rb_nil=LOCAL_db_nil;
|
||||||
|
|
||||||
z->left=z->right=nil;
|
z->left=z->right=rb_nil;
|
||||||
y=LOCAL_db_root;
|
y=LOCAL_db_root;
|
||||||
x=LOCAL_db_root->left;
|
x=LOCAL_db_root->left;
|
||||||
while( x != nil) {
|
while( x != rb_nil) {
|
||||||
y=x;
|
y=x;
|
||||||
if (x->key < z->key) { /* x.key > z.key */
|
if (x->key < z->key) { /* x.key > z.key */
|
||||||
x=x->left;
|
x=x->left;
|
||||||
|
Reference in New Issue
Block a user