summaryrefslogtreecommitdiffstats
path: root/experimental/tqtinterface/qt4/src/3rdparty/sqlite/btree_rb.c
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/tqtinterface/qt4/src/3rdparty/sqlite/btree_rb.c')
-rw-r--r--experimental/tqtinterface/qt4/src/3rdparty/sqlite/btree_rb.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/experimental/tqtinterface/qt4/src/3rdparty/sqlite/btree_rb.c b/experimental/tqtinterface/qt4/src/3rdparty/sqlite/btree_rb.c
index fd81df24a..e952b7ae1 100644
--- a/experimental/tqtinterface/qt4/src/3rdparty/sqlite/btree_rb.c
+++ b/experimental/tqtinterface/qt4/src/3rdparty/sqlite/btree_rb.c
@@ -123,7 +123,7 @@ struct BtRbNode {
int nData;
void *pData;
u8 isBlack; /* true for a black node, 0 for a red node */
- BtRbNode *pParent; /* Nodes tqparent node, NULL for the tree head */
+ BtRbNode *pParent; /* Nodes parent node, NULL for the tree head */
BtRbNode *pLeft; /* Nodes left child, or NULL */
BtRbNode *pRight; /* Nodes right child, or NULL */
@@ -329,7 +329,7 @@ static void check_redblack_tree(BtRbTree * tree, char ** msg)
{
BtRbNode *pNode;
- /* 0 -> came from tqparent
+ /* 0 -> came from parent
* 1 -> came from left
* 2 -> came from right */
int prev_step = 0;
@@ -400,34 +400,34 @@ static void check_redblack_tree(BtRbTree * tree, char ** msg)
/*
* Node pX has just been inserted into pTree (by code in sqliteRbtreeInsert()).
- * It is possible that pX is a red node with a red tqparent, which is a violation
+ * It is possible that pX is a red node with a red parent, which is a violation
* of the red-black tree properties. This function performs rotations and
* color changes to rebalance the tree
*/
static void do_insert_balancing(BtRbTree *pTree, BtRbNode *pX)
{
/* In the first iteration of this loop, pX points to the red node just
- * inserted in the tree. If the tqparent of pX exists (pX is not the root
+ * inserted in the tree. If the parent of pX exists (pX is not the root
* node) and is red, then the properties of the red-black tree are
* violated.
*
* At the start of any subsequent iterations, pX points to a red node
- * with a red tqparent. In all other respects the tree is a legal red-black
+ * with a red parent. In all other respects the tree is a legal red-black
* binary tree. */
while( pX != pTree->pHead && !pX->pParent->isBlack ){
BtRbNode *pUncle;
- BtRbNode *pGrandtqparent;
+ BtRbNode *pGrandparent;
- /* Grandtqparent of pX must exist and must be black. */
- pGrandtqparent = pX->pParent->pParent;
- assert( pGrandtqparent );
- assert( pGrandtqparent->isBlack );
+ /* Grandparent of pX must exist and must be black. */
+ pGrandparent = pX->pParent->pParent;
+ assert( pGrandparent );
+ assert( pGrandparent->isBlack );
/* Uncle of pX may or may not exist. */
- if( pX->pParent == pGrandtqparent->pLeft )
- pUncle = pGrandtqparent->pRight;
+ if( pX->pParent == pGrandparent->pLeft )
+ pUncle = pGrandparent->pRight;
else
- pUncle = pGrandtqparent->pLeft;
+ pUncle = pGrandparent->pLeft;
/* If the uncle of pX exists and is red, we do the following:
* | |
@@ -438,16 +438,16 @@ static void do_insert_balancing(BtRbTree *pTree, BtRbNode *pX)
* X(r) X(r)
*
* BEFORE AFTER
- * pX is then set to G. If the tqparent of G is red, then the while loop
+ * pX is then set to G. If the parent of G is red, then the while loop
* will run again. */
if( pUncle && !pUncle->isBlack ){
- pGrandtqparent->isBlack = 0;
+ pGrandparent->isBlack = 0;
pUncle->isBlack = 1;
pX->pParent->isBlack = 1;
- pX = pGrandtqparent;
+ pX = pGrandparent;
}else{
- if( pX->pParent == pGrandtqparent->pLeft ){
+ if( pX->pParent == pGrandparent->pLeft ){
if( pX == pX->pParent->pRight ){
/* If pX is a right-child, do the following transform, essentially
* to change pX into a left-child:
@@ -474,10 +474,10 @@ static void do_insert_balancing(BtRbTree *pTree, BtRbNode *pX)
*
* BEFORE AFTER
*/
- assert( pGrandtqparent == pX->pParent->pParent );
- pGrandtqparent->isBlack = 0;
+ assert( pGrandparent == pX->pParent->pParent );
+ pGrandparent->isBlack = 0;
pX->pParent->isBlack = 1;
- rightRotate( pTree, pGrandtqparent );
+ rightRotate( pTree, pGrandparent );
}else{
/* This code is symetric to the illustrated case above. */
@@ -485,10 +485,10 @@ static void do_insert_balancing(BtRbTree *pTree, BtRbNode *pX)
pX = pX->pParent;
rightRotate(pTree, pX);
}
- assert( pGrandtqparent == pX->pParent->pParent );
- pGrandtqparent->isBlack = 0;
+ assert( pGrandparent == pX->pParent->pParent );
+ pGrandparent->isBlack = 0;
pX->pParent->isBlack = 1;
- leftRotate( pTree, pGrandtqparent );
+ leftRotate( pTree, pGrandparent );
}
}
}