8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 18:03:04 +01:00

backported fix for unsigned comparison

This commit is contained in:
alexpeshkoff 2008-12-29 08:35:29 +00:00
parent a2b7e431b7
commit 3a686c83dd

View File

@ -660,13 +660,13 @@ bool BePlusTree<Value, Key, Allocator, KeyOfValue, Cmp, LeafCount, NodeCount>::a
// Start building recovery map.
// This array contains index of the element we try to add on page of each level
// -1 means that element is on new page
// ~0 means that element is on new page
// In case of low memory condition we use this data to recover to innocent state
size_t recovery_map[MAX_TREE_LEVEL];
if (pos == LeafCount) {
newLeaf->insert(0, item);
recovery_map[0] = -1;
recovery_map[0] = ~0;
}
else {
newLeaf->insert(0, (*leaf)[LeafCount - 1]);
@ -735,7 +735,7 @@ bool BePlusTree<Value, Key, Allocator, KeyOfValue, Cmp, LeafCount, NodeCount>::a
if (pos == NodeCount) {
NodeList::setNodeParentAndLevel(newNode, curLevel, newList);
newList->insert(0, newNode);
recovery_map[curLevel + 1] = -1;
recovery_map[curLevel + 1] = ~0;
}
else {
void *t = (*nodeList)[NodeCount - 1];
@ -767,7 +767,7 @@ bool BePlusTree<Value, Key, Allocator, KeyOfValue, Cmp, LeafCount, NodeCount>::a
while (curLevel) {
NodeList *itemL = reinterpret_cast<NodeList*>(newNode);
void *lower;
if (recovery_map[curLevel] < 0) {
if (recovery_map[curLevel] == size_t(~0)) {
lower = (*itemL)[0];
}
else {
@ -782,7 +782,7 @@ bool BePlusTree<Value, Key, Allocator, KeyOfValue, Cmp, LeafCount, NodeCount>::a
curLevel--;
}
ItemList *itemL2 = reinterpret_cast<ItemList*>(newNode);
if (recovery_map[0] >= 0) {
if (recovery_map[0] != size_t(~0)) {
itemL2->prev->remove(recovery_map[0]);
itemL2->prev->insert(itemL2->prev->getCount(), (*itemL2)[0]);
}