Browse Source

fix build warnings

pull/5/head
R4SAS 7 years ago
parent
commit
1cd62a79ee
  1. 4
      src/alert.cpp
  2. 2
      src/bitcoinrpc.cpp
  3. 2
      src/db.cpp
  4. 18
      src/init.cpp
  5. 2
      src/irc.cpp
  6. 34
      src/main.cpp
  7. 6
      src/main.h
  8. 2
      src/net.cpp
  9. 2
      src/net.h
  10. 2
      src/rpcnet.cpp
  11. 2
      src/rpcwallet.cpp
  12. 8
      src/util.cpp
  13. 2
      src/util.h
  14. 12
      src/wallet.cpp
  15. 8
      src/walletdb.cpp

4
src/alert.cpp

@ -51,8 +51,8 @@ std::string CUnsignedAlert::ToString() const @@ -51,8 +51,8 @@ std::string CUnsignedAlert::ToString() const
return strprintf(
"CAlert(\n"
" nVersion = %d\n"
" nRelayUntil = %"PRI64d"\n"
" nExpiration = %"PRI64d"\n"
" nRelayUntil = %" PRI64d "\n"
" nExpiration = %" PRI64d "\n"
" nID = %d\n"
" nCancel = %d\n"
" setCancel = %s\n"

2
src/bitcoinrpc.cpp

@ -354,7 +354,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive) @@ -354,7 +354,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
"HTTP/1.1 %d %s\r\n"
"Date: %s\r\n"
"Connection: %s\r\n"
"Content-Length: %"PRIszu"\r\n"
"Content-Length: %" PRIszu "\r\n"
"Content-Type: application/json\r\n"
"Server: anoncoin-json-rpc/%s\r\n"
"\r\n"

2
src/db.cpp

@ -457,7 +457,7 @@ void CDBEnv::Flush(bool fShutdown) @@ -457,7 +457,7 @@ void CDBEnv::Flush(bool fShutdown)
else
mi++;
}
printf("DBFlush(%s)%s ended %15"PRI64d"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
printf("DBFlush(%s)%s ended %15" PRI64d "ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
if (fShutdown)
{
char** listp;

18
src/init.cpp

@ -756,7 +756,7 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -756,7 +756,7 @@ bool AppInit2(boost::thread_group& threadGroup)
{
// try moving the database env out of the way
boost::filesystem::path pathDatabase = GetDataDir() / "database";
boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%"PRI64d".bak", GetTime());
boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%" PRI64d ".bak", GetTime());
try {
boost::filesystem::rename(pathDatabase, pathDatabaseBak);
printf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str());
@ -1048,7 +1048,7 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -1048,7 +1048,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Shutdown requested. Exiting.\n");
return false;
}
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" block index %15" PRI64d "ms\n", GetTimeMillis() - nStart);
if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
{
@ -1145,7 +1145,7 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -1145,7 +1145,7 @@ bool AppInit2(boost::thread_group& threadGroup)
}
printf("%s", strErrors.str().c_str());
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" wallet %15" PRI64d "ms\n", GetTimeMillis() - nStart);
RegisterWallet(pwalletMain);
@ -1167,7 +1167,7 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -1167,7 +1167,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" rescan %15" PRI64d "ms\n", GetTimeMillis() - nStart);
pwalletMain->SetBestChain(CBlockLocator(pindexBest));
nWalletDBUpdated++;
}
@ -1200,7 +1200,7 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -1200,7 +1200,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Invalid or missing peers.dat; recreating\n");
}
printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n",
printf("Loaded %i addresses from peers.dat %" PRI64d "ms\n",
addrman.size(), GetTimeMillis() - nStart);
// ********************************************************* Step 11: start node
@ -1214,11 +1214,11 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -1214,11 +1214,11 @@ bool AppInit2(boost::thread_group& threadGroup)
RandAddSeedPerfmon();
//// debug print
printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size());
printf("mapBlockIndex.size() = %" PRIszu "\n", mapBlockIndex.size());
printf("nBestHeight = %d\n", nBestHeight);
printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0);
printf("mapWallet.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapWallet.size() : 0);
printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0);
printf("setKeyPool.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0);
printf("mapWallet.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->mapWallet.size() : 0);
printf("mapAddressBook.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0);
StartNode(threadGroup);

2
src/irc.cpp

@ -314,7 +314,7 @@ void ThreadIRCSeed() @@ -314,7 +314,7 @@ void ThreadIRCSeed()
if (!fNoListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3)
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
if (strMyName == "")
strMyName = strprintf("x%"PRI64u"", GetRand(1000000000));
strMyName = strprintf("x%" PRI64u "", GetRand(1000000000));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str());

34
src/main.cpp

@ -308,7 +308,7 @@ bool AddOrphanTx(const CTransaction& tx) @@ -308,7 +308,7 @@ bool AddOrphanTx(const CTransaction& tx)
BOOST_FOREACH(const CTxIn& txin, tx.vin)
mapOrphanTransactionsByPrev[txin.prevout.hash].insert(hash);
printf("stored orphan tx %s (mapsz %"PRIszu")\n", hash.ToString().c_str(),
printf("stored orphan tx %s (mapsz %" PRIszu ")\n", hash.ToString().c_str(),
mapOrphanTransactions.size());
return true;
}
@ -759,7 +759,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn @@ -759,7 +759,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
// Don't accept it if it can't get into a block
int64 txMinFee = tx.GetMinFee(1000, true, GMF_RELAY);
if (fLimitFree && nFees < txMinFee)
return error("CTxMemPool::accept() : not enough fees %s, %"PRI64d" < %"PRI64d,
return error("CTxMemPool::accept() : not enough fees %s, %" PRI64d " < %" PRI64d,
hash.ToString().c_str(),
nFees, txMinFee);
@ -1247,7 +1247,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const @@ -1247,7 +1247,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
int64 nActualTimespanMax = fNewDifficultyProtocol ? (nTargetTimespanCurrent*4) : ((nTargetTimespanCurrent*99)/70);
int64 nActualTimespanMin = fNewDifficultyProtocol ? (nTargetTimespanCurrent/4) : ((nTargetTimespanCurrent*70)/99);
#ifdef __DEBUG
printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
printf(" nActualTimespan = %" PRI64d " before bounds\n", nActualTimespan);
#endif
if (pindexLast->nHeight+1 >= nDifficultySwitchHeight2) {
if (nActualTimespan < nActualTimespanMin)
@ -1282,7 +1282,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const @@ -1282,7 +1282,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
/// debug print
#ifdef __DEBUG
printf("OldGetNextWorkRequired RETARGET\n");
printf("nTargetTimespan = %"PRI64d" nActualTimespan = %"PRI64d"\n", nTargetTimespan, nActualTimespan);
printf("nTargetTimespan = %" PRI64d " nActualTimespan = %" PRI64d "\n", nTargetTimespan, nActualTimespan);
printf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());
printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());
#endif
@ -1844,7 +1844,7 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi @@ -1844,7 +1844,7 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi
printf("- Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin)\n", (unsigned)vtx.size(), 0.001 * nTime, 0.001 * nTime / vtx.size(), nInputs <= 1 ? 0 : 0.001 * nTime / (nInputs-1));
if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees))
return state.DoS(100, error("ConnectBlock() : coinbase pays too much (actual=%"PRI64d" vs limit=%"PRI64d")", vtx[0].GetValueOut(), GetBlockValue(pindex->nHeight, nFees)));
return state.DoS(100, error("ConnectBlock() : coinbase pays too much (actual=%" PRI64d " vs limit=%" PRI64d ")", vtx[0].GetValueOut(), GetBlockValue(pindex->nHeight, nFees)));
if (!control.Wait())
return state.DoS(100, false);
@ -1924,8 +1924,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew) @@ -1924,8 +1924,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
reverse(vConnect.begin(), vConnect.end());
if (vDisconnect.size() > 0) {
printf("REORGANIZE: Disconnect %"PRIszu" blocks; %s..\n", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Connect %"PRIszu" blocks; ..%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Disconnect %" PRIszu " blocks; %s..\n", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Connect %" PRIszu " blocks; ..%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str());
}
// Disconnect shorter branch
@ -3024,7 +3024,7 @@ void PrintBlockTree() @@ -3024,7 +3024,7 @@ void PrintBlockTree()
// print item
CBlock block;
block.ReadFromDisk(pindex);
printf("%d (blk%05u.dat:0x%x) %s tx %"PRIszu"",
printf("%d (blk%05u.dat:0x%x) %s tx %" PRIszu "",
pindex->nHeight,
pindex->GetBlockPos().nFile, pindex->GetBlockPos().nPos,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", block.GetBlockTime()).c_str(),
@ -3117,7 +3117,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) @@ -3117,7 +3117,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
AbortNode(_("Error: system error: ") + e.what());
}
if (nLoaded > 0)
printf("Loaded %i blocks from external file in %"PRI64d"ms\n", nLoaded, GetTimeMillis() - nStart);
printf("Loaded %i blocks from external file in %" PRI64d "ms\n", nLoaded, GetTimeMillis() - nStart);
return nLoaded > 0;
}
@ -3369,7 +3369,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) @@ -3369,7 +3369,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
RandAddSeedPerfmon();
if (fDebug)
printf("received: %s (%"PRIszu" bytes)\n", strCommand.c_str(), vRecv.size());
printf("received: %s (%" PRIszu " bytes)\n", strCommand.c_str(), vRecv.size());
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
{
printf("dropmessagestest DROPPING RECV MESSAGE\n");
@ -3515,7 +3515,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) @@ -3515,7 +3515,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vAddr.size() > 1000)
{
pfrom->Misbehaving(20);
return error("message addr size() = %"PRIszu"", vAddr.size());
return error("message addr size() = %" PRIszu "", vAddr.size());
}
// Store the new addresses
@ -3578,7 +3578,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) @@ -3578,7 +3578,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ)
{
pfrom->Misbehaving(20);
return error("message inv size() = %"PRIszu"", vInv.size());
return error("message inv size() = %" PRIszu "", vInv.size());
}
// find last block in inv vector
@ -3627,11 +3627,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) @@ -3627,11 +3627,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ)
{
pfrom->Misbehaving(20);
return error("message getdata size() = %"PRIszu"", vInv.size());
return error("message getdata size() = %" PRIszu "", vInv.size());
}
if (fDebugNet || (vInv.size() != 1))
printf("received getdata (%"PRIszu" invsz)\n", vInv.size());
printf("received getdata (%" PRIszu " invsz)\n", vInv.size());
if ((fDebugNet && vInv.size() > 0) || (vInv.size() == 1))
printf("received getdata for: %s\n", vInv[0].ToString().c_str());
@ -3732,7 +3732,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) @@ -3732,7 +3732,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
vWorkQueue.push_back(inv.hash);
vEraseQueue.push_back(inv.hash);
printf("AcceptToMemoryPool: %s %s : accepted %s (poolsz %"PRIszu")\n",
printf("AcceptToMemoryPool: %s %s : accepted %s (poolsz %" PRIszu ")\n",
pfrom->addr.ToString().c_str(), pfrom->strSubVer.c_str(),
tx.GetHash().ToString().c_str(),
mempool.mapTx.size());
@ -4581,7 +4581,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) @@ -4581,7 +4581,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
printf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize);
printf("CreateNewBlock(): total size %" PRI64u "\n", nBlockSize);
pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
pblocktemplate->vTxFees[0] = -nFees;
@ -4745,7 +4745,7 @@ void static GostcoinMiner(CWallet *pwallet) @@ -4745,7 +4745,7 @@ void static GostcoinMiner(CWallet *pwallet)
CBlock *pblock = &pblocktemplate->block;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
printf("Running GostcoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(),
printf("Running GostcoinMiner with %" PRIszu " transactions in block (%u bytes)\n", pblock->vtx.size(),
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));
//

6
src/main.h

@ -449,7 +449,7 @@ public: @@ -449,7 +449,7 @@ public:
{
if (scriptPubKey.size() < 6)
return "CTxOut(error)";
return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
return strprintf("CTxOut(nValue=%" PRI64d ".%08" PRI64d ", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
}
void print() const
@ -645,7 +645,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach @@ -645,7 +645,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
std::string ToString() const
{
std::string str;
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n",
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%" PRIszu ", vout.size=%" PRIszu ", nLockTime=%u)\n",
GetHash().ToString().c_str(),
nVersion,
vin.size(),
@ -1482,7 +1482,7 @@ public: @@ -1482,7 +1482,7 @@ public:
void print() const
{
printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n",
printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%" PRIszu ")\n",
GetHash().ToString().c_str(),
HexStr(BEGIN(nVersion),BEGIN(nVersion)+80,false).c_str(),
GetHash().ToString().c_str(),

2
src/net.cpp

@ -1490,7 +1490,7 @@ void DumpAddresses() @@ -1490,7 +1490,7 @@ void DumpAddresses()
CAddrDB adb;
adb.Write(addrman);
printf("Flushed %d addresses to peers.dat %"PRI64d"ms\n",
printf("Flushed %d addresses to peers.dat %" PRI64d "ms\n",
addrman.size(), GetTimeMillis() - nStart);
}

2
src/net.h

@ -404,7 +404,7 @@ public: @@ -404,7 +404,7 @@ public:
else
nRequestTime = 0;
if (fDebugNet)
printf("askfor %s %"PRI64d" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
printf("askfor %s %" PRI64d " (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
// Make sure not to reuse time indexes to keep things in the same order
int64 nNow = (GetTime() - 1) * 1000000;

2
src/rpcnet.cpp

@ -48,7 +48,7 @@ Value getpeerinfo(const Array& params, bool fHelp) @@ -48,7 +48,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
Object obj;
obj.push_back(Pair("addr", stats.addrName));
obj.push_back(Pair("services", strprintf("%08"PRI64x, stats.nServices)));
obj.push_back(Pair("services", strprintf("%08" PRI64x, stats.nServices)));
obj.push_back(Pair("lastsend", (boost::int64_t)stats.nLastSend));
obj.push_back(Pair("lastrecv", (boost::int64_t)stats.nLastRecv));
obj.push_back(Pair("bytessent", (boost::int64_t)stats.nSendBytes));

2
src/rpcwallet.cpp

@ -743,7 +743,7 @@ static CScript _createmultisig(const Array& params) @@ -743,7 +743,7 @@ static CScript _createmultisig(const Array& params)
if ((int)keys.size() < nRequired)
throw runtime_error(
strprintf("not enough keys supplied "
"(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired));
"(got %" PRIszu " keys, but need at least %d to redeem)", keys.size(), nRequired));
std::vector<CPubKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)

8
src/util.cpp

@ -400,7 +400,7 @@ string FormatMoney(int64 n, bool fPlus) @@ -400,7 +400,7 @@ string FormatMoney(int64 n, bool fPlus)
int64 n_abs = (n > 0 ? n : -n);
int64 quotient = n_abs/COIN;
int64 remainder = n_abs%COIN;
string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder);
string str = strprintf("%" PRI64d ".%08" PRI64d, quotient, remainder);
// Right-trim excess zeros before the decimal point:
int nTrim = 0;
@ -1370,7 +1370,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime) @@ -1370,7 +1370,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
// Add data
vTimeOffsets.input(nOffsetSample);
printf("Added time data, samples %d, offset %+"PRI64d" (%+"PRI64d" minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60);
printf("Added time data, samples %d, offset %+" PRI64d" (%+" PRI64d " minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60);
if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1)
{
int64 nMedian = vTimeOffsets.median();
@ -1405,10 +1405,10 @@ void AddTimeData(const CNetAddr& ip, int64 nTime) @@ -1405,10 +1405,10 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
}
if (fDebug) {
BOOST_FOREACH(int64 n, vSorted)
printf("%+"PRI64d" ", n);
printf("%+" PRI64d " ", n);
printf("| ");
}
printf("nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
printf("nTimeOffset = %+" PRI64d " (%+" PRI64d " minutes)\n", nTimeOffset, nTimeOffset/60);
}
}

2
src/util.h

@ -247,7 +247,7 @@ std::string FormatI2PNativeFullVersion(); @@ -247,7 +247,7 @@ std::string FormatI2PNativeFullVersion();
inline std::string i64tostr(int64 n)
{
return strprintf("%"PRI64d, n);
return strprintf("%" PRI64d, n);
}
inline std::string itostr(int n)

12
src/wallet.cpp

@ -1480,7 +1480,7 @@ void CWallet::PrintWallet(const CBlock& block) @@ -1480,7 +1480,7 @@ void CWallet::PrintWallet(const CBlock& block)
if (mapWallet.count(block.vtx[0].GetHash()))
{
CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
printf(" mine: %d %d %"PRI64d"", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
printf(" mine: %d %d %" PRI64d "", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
}
}
printf("\n");
@ -1542,7 +1542,7 @@ bool CWallet::NewKeyPool() @@ -1542,7 +1542,7 @@ bool CWallet::NewKeyPool()
walletdb.WritePool(nIndex, CKeyPool(GenerateNewKey()));
setKeyPool.insert(nIndex);
}
printf("CWallet::NewKeyPool wrote %"PRI64d" new keys\n", nKeys);
printf("CWallet::NewKeyPool wrote %" PRI64d " new keys\n", nKeys);
}
return true;
}
@ -1567,7 +1567,7 @@ bool CWallet::TopUpKeyPool() @@ -1567,7 +1567,7 @@ bool CWallet::TopUpKeyPool()
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey())))
throw runtime_error("TopUpKeyPool() : writing generated key failed");
setKeyPool.insert(nEnd);
printf("keypool added key %"PRI64d", size=%"PRIszu"\n", nEnd, setKeyPool.size());
printf("keypool added key %" PRI64d ", size=%" PRIszu "\n", nEnd, setKeyPool.size());
}
}
return true;
@ -1596,7 +1596,7 @@ void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool) @@ -1596,7 +1596,7 @@ void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
if (!HaveKey(keypool.vchPubKey.GetID()))
throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
assert(keypool.vchPubKey.IsValid());
printf("keypool reserve %"PRI64d"\n", nIndex);
printf("keypool reserve %" PRI64d "\n", nIndex);
}
}
@ -1623,7 +1623,7 @@ void CWallet::KeepKey(int64 nIndex) @@ -1623,7 +1623,7 @@ void CWallet::KeepKey(int64 nIndex)
CWalletDB walletdb(strWalletFile);
walletdb.ErasePool(nIndex);
}
printf("keypool keep %"PRI64d"\n", nIndex);
printf("keypool keep %" PRI64d "\n", nIndex);
}
void CWallet::ReturnKey(int64 nIndex)
@ -1633,7 +1633,7 @@ void CWallet::ReturnKey(int64 nIndex) @@ -1633,7 +1633,7 @@ void CWallet::ReturnKey(int64 nIndex)
LOCK(cs_wallet);
setKeyPool.insert(nIndex);
}
printf("keypool return %"PRI64d"\n", nIndex);
printf("keypool return %" PRI64d "\n", nIndex);
}
bool CWallet::GetKeyFromPool(CPubKey& result, bool fAllowReuse)

8
src/walletdb.cpp

@ -237,7 +237,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, @@ -237,7 +237,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
//// debug print
//printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str());
//printf(" %12"PRI64d" %s %s %s\n",
//printf(" %12" PRI64d " %s %s %s\n",
// wtx.vout[0].nValue,
// DateTimeStrFormat("%Y-%m-%d %H:%M:%S", wtx.GetBlockTime()).c_str(),
// wtx.hashBlock.ToString().c_str(),
@ -519,7 +519,7 @@ void ThreadFlushWalletDB(const string& strFile) @@ -519,7 +519,7 @@ void ThreadFlushWalletDB(const string& strFile)
bitdb.CheckpointLSN(strFile);
bitdb.mapFileUseCount.erase(mi++);
printf("Flushed wallet.dat %"PRI64d"ms\n", GetTimeMillis() - nStart);
printf("Flushed wallet.dat %" PRI64d "ms\n", GetTimeMillis() - nStart);
}
}
}
@ -580,7 +580,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) @@ -580,7 +580,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
// Set -rescan so any missing transactions will be
// found.
int64 now = GetTime();
std::string newFilename = strprintf("wallet.%"PRI64d".bak", now);
std::string newFilename = strprintf("wallet.%" PRI64d ".bak", now);
int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL,
newFilename.c_str(), DB_AUTO_COMMIT);
@ -599,7 +599,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) @@ -599,7 +599,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
printf("Salvage(aggressive) found no records in %s.\n", newFilename.c_str());
return false;
}
printf("Salvage(aggressive) found %"PRIszu" records\n", salvagedData.size());
printf("Salvage(aggressive) found %" PRIszu " records\n", salvagedData.size());
bool fSuccess = allOK;
Db* pdbCopy = new Db(&dbenv.dbenv, 0);

Loading…
Cancel
Save