This commit is contained in:
JoelKatz
2012-05-07 16:27:18 -07:00
parent a626706638
commit 133ee09297
2 changed files with 89 additions and 89 deletions

View File

@@ -51,7 +51,7 @@ void SHAMap::dirtyUp(std::stack<SHAMapTreeNode::pointer>& stack, const uint256&
{ // walk the tree up from through the inner nodes to the root
// update linking hashes and add nodes to dirty list
assert(mState!=Synching && mState!=Immutable);
assert((mState != Synching) && (mState != Immutable));
while (!stack.empty())
{
@@ -166,7 +166,7 @@ SHAMapItem::pointer SHAMap::firstBelow(SHAMapTreeNode::pointer node)
if (node->hasItem()) return node->peekItem();
bool foundNode = false;
for(int i=0; i<16; i++)
for (int i = 0; i < 16; ++i)
if (!node->isEmptyBranch(i))
{
#ifdef ST_DEBUG
@@ -194,7 +194,7 @@ SHAMapItem::pointer SHAMap::lastBelow(SHAMapTreeNode::pointer node)
if (node->hasItem()) return node->peekItem();
bool foundNode = false;
for(int i=15; i>=0; i++)
for (int i = 15; i >= 0; ++i)
if (!node->isEmptyBranch(i))
{
node = getNode(node->getChildNodeID(i), node->getChildHash(i), false);
@@ -215,7 +215,7 @@ SHAMapItem::pointer SHAMap::onlyBelow(SHAMapTreeNode::pointer node)
found = false;
SHAMapTreeNode::pointer nextNode;
for(int i=0; i<16; i++)
for (int i = 0; i < 16; ++i)
if (!node->isEmptyBranch(i))
{
if( found) return SHAMapItem::pointer(); // two leaves below
@@ -618,11 +618,11 @@ void SHAMap::dump(bool hash)
}
static std::vector<unsigned char>IntToVUC(int i)
static std::vector<unsigned char>IntToVUC(int v)
{
std::vector<unsigned char> vuc;
for(int i=0; i<32; i++)
vuc.push_back((unsigned char) i);
for (int i = 0; i < 32; ++i)
vuc.push_back(static_cast<unsigned char>(v));
return vuc;
}

View File

@@ -295,7 +295,7 @@ public:
// status functions
void setImmutable(void) { assert(mState != Invalid); mState = Immutable; }
void clearImmutable(void) { mState = Modifying; }
bool isSynching(void) const { return mState == Floating || mState == Synching; }
bool isSynching(void) const { return (mState == Floating) || (mState == Synching); }
void setSynching(void) { mState = Synching; }
void setFloating(void) { mState = Floating; }
void clearSynching(void) { mState = Modifying; }