Commit ddc91dbd authored by Ashot's avatar Ashot
Browse files

Fixed warning messages

Showing with 11 additions and 9 deletions
+11 -9
......@@ -101,7 +101,7 @@ void MemTable::Add(SequenceNumber s, ValueType type,
p += 8;
p = EncodeVarint32(p, val_size);
memcpy(p, value.data(), val_size);
assert((p + val_size) - buf == encoded_len);
assert(p + val_size == buf + encoded_len);
table_.Insert(buf);
}
......
......@@ -47,7 +47,7 @@ class BloomFilterPolicy : public FilterPolicy {
dst->resize(init_size + bytes, 0);
dst->push_back(static_cast<char>(k_)); // Remember # of probes in filter
char* array = &(*dst)[init_size];
for (size_t i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
// Use double-hashing to generate a sequence of hash values.
// See analysis in [Kirsch,Mitzenmacher 2006].
uint32_t h = BloomHash(keys[i]);
......
......@@ -52,7 +52,7 @@ bool ConsumeDecimalNumber(Slice* in, uint64_t* val) {
char c = (*in)[0];
if (c >= '0' && c <= '9') {
++digits;
const int delta = (c - '0');
const unsigned int delta = (c - '0');
static const uint64_t kMaxUint64 = ~static_cast<uint64_t>(0);
if (v > kMaxUint64/10 ||
(v == kMaxUint64/10 && delta > kMaxUint64%10)) {
......
......@@ -2251,7 +2251,7 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
// The cache is large and we're within 10% and 100 MiB of the limit, but we have time now (not in the middle of a block processing).
bool fCacheLarge = mode == FLUSH_STATE_PERIODIC && cacheSize > std::max((9 * nTotalSpace) / 10, nTotalSpace - 100 * 1024 * 1024);
// The cache is over the limit, we have to write now.
bool fCacheCritical = mode == FLUSH_STATE_IF_NEEDED && cacheSize > nCoinCacheUsage;
bool fCacheCritical = mode == FLUSH_STATE_IF_NEEDED && static_cast<size_t>(cacheSize) > nCoinCacheUsage;
// It's been a while since we wrote the block index to disk. Do this frequently, so we don't need to redownload after a crash.
bool fPeriodicWrite = mode == FLUSH_STATE_PERIODIC && nNow > nLastWrite + (int64_t)DATABASE_WRITE_INTERVAL * 1000000;
// It's been very long since we flushed the cache. Do this infrequently, to optimize cache usage.
......@@ -4776,7 +4776,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
bool ignoreFees = false;
CTxIn vin;
vector<unsigned char> vchSig;
int64_t sigTime;
vRecv >> tx;
......
......@@ -1659,12 +1659,12 @@ CFinalizedBudget::CFinalizedBudget()
}
CFinalizedBudget::CFinalizedBudget(std::string strBudgetName, int nBlockStart, std::vector<CTxBudgetPayment> vecBudgetPayments, uint256 nFeeTXHash)
: strBudgetName(strBudgetName)
, nBlockStart(nBlockStart)
: fAutoChecked(false)
, vecBudgetPayments(vecBudgetPayments)
, strBudgetName(strBudgetName)
, nBlockStart(nBlockStart)
, nFeeTXHash(nFeeTXHash)
, fValid(true)
, fAutoChecked(false)
, nTime(0)
{
boost::sort(this->vecBudgetPayments, ComparePayments);
......@@ -1689,7 +1689,6 @@ bool CFinalizedBudget::AddOrUpdateVote(const CFinalizedBudgetVote& vote, std::st
LOCK(cs);
uint256 masternodeHash = vote.vin.prevout.GetHash();
uint256 voteHash = vote.GetHash();
map<uint256, CFinalizedBudgetVote>::iterator found = mapVotes.find(masternodeHash);
if(found != mapVotes.end()){
......@@ -1732,6 +1731,8 @@ public:
return a->GetHash() < b->GetHash();
else if (a->GetPayee() != b->GetPayee())
return a->GetPayee() < b->GetPayee();
return false;
}
};
......
......@@ -247,6 +247,8 @@ protected:
return a.nProposalHash < b.nProposalHash;
else if (a.payee != b.payee)
return a.payee < b.payee;
return false;
}
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment