From e10fa48ea2c24f9647668aafa1f9caa48a51de2f Mon Sep 17 00:00:00 2001 From: svost Date: Sat, 20 Feb 2016 11:35:07 +0300 Subject: [PATCH] Get rid of some LONG variables --- src/db.cpp | 6 +++--- src/main.h | 2 +- src/script.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index 81d519a..757a18e 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -118,13 +118,13 @@ bool CDBEnv::Open(boost::filesystem::path pathEnv_) nBlocks = nMaxLocks / 48768; nDeepReorg = (nBlocks - 1) / 2; - printf("Final lk_max_locks is %lu, sufficient for (worst case) %d block%s in a single transaction (up to a %d-deep reorganization)\n", (unsigned long)nMaxLocks, nBlocks, (nBlocks == 1) ? "" : "s", nDeepReorg); + printf("Final lk_max_locks is %u, sufficient for (worst case) %d block%s in a single transaction (up to a %d-deep reorganization)\n", nMaxLocks, nBlocks, (nBlocks == 1) ? "" : "s", nDeepReorg); if (nDeepReorg < 3) { if (nBlocks < 1) - strMessage = strprintf(_("Warning: DB_CONFIG has set_lk_max_locks %lu, which may be too low for a single block. If this limit is reached, NovaCoin may stop working."), (unsigned long)nMaxLocks); + strMessage = strprintf(_("Warning: DB_CONFIG has set_lk_max_locks %u, which may be too low for a single block. If this limit is reached, NovaCoin may stop working."), nMaxLocks); else - strMessage = strprintf(_("Warning: DB_CONFIG has set_lk_max_locks %lu, which may be too low for a common blockchain reorganization. If this limit is reached, NovaCoin may stop working."), (unsigned long)nMaxLocks); + strMessage = strprintf(_("Warning: DB_CONFIG has set_lk_max_locks %u, which may be too low for a common blockchain reorganization. If this limit is reached, NovaCoin may stop working."), nMaxLocks); strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); diff --git a/src/main.h b/src/main.h index b418709..da8d602 100644 --- a/src/main.h +++ b/src/main.h @@ -962,7 +962,7 @@ public: if (nHeight >= 9689 || fTestNet) { // Take last bit of block hash as entropy bit - unsigned int nEntropyBit = ((GetHash().Get64()) & 1ULL); + unsigned int nEntropyBit = (GetHash().Get64()) & (uint64_t)1; if (fDebug && GetBoolArg("-printstakemodifier")) printf("GetStakeEntropyBit: nTime=%u hashBlock=%s nEntropyBit=%u\n", nTime, GetHash().ToString().c_str(), nEntropyBit); return nEntropyBit; diff --git a/src/script.cpp b/src/script.cpp index c7c2b29..c97c894 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -294,7 +294,7 @@ bool IsDERSignature(const valtype &vchSig, bool fWithHashType, bool fCheckLow) { if (5 + nLenR >= vchSig.size()) return error("Non-canonical signature: S length misplaced"); unsigned int nLenS = vchSig[5+nLenR]; - if ((unsigned long)(nLenR + nLenS + (fWithHashType ? 7 : 6)) != vchSig.size()) + if ((nLenR + nLenS + (fWithHashType ? 7 : 6)) != vchSig.size()) return error("Non-canonical signature: R+S length mismatch"); const unsigned char *R = &vchSig[4]; -- 1.7.1