From 51ed9ec971614aebdbfbd9527aba365dd0afd437 Mon Sep 17 00:00:00 2001 From: Brandon Dahler Date: Sat, 13 Apr 2013 00:13:08 -0500 Subject: Cleanup code using forward declarations. Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files. --- src/init.cpp | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 80ba65f80..6749064ed 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -8,29 +8,30 @@ #endif #include "init.h" -#include "main.h" -#include "core.h" -#include "chainparams.h" -#include "txdb.h" -#include "walletdb.h" + +#include "addrman.h" #include "bitcoinrpc.h" -#include "net.h" -#include "util.h" +#include "checkpoints.h" #include "miner.h" +#include "net.h" +#include "txdb.h" #include "ui_interface.h" -#include "checkpoints.h" +#include "util.h" +#include "wallet.h" +#include "walletdb.h" -#include -#include -#include -#include -#include -#include +#include +#include #ifndef WIN32 #include #endif +#include +#include +#include +#include + using namespace std; using namespace boost; @@ -520,7 +521,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) // cost to you of processing a transaction. if (mapArgs.count("-mintxfee")) { - int64 n = 0; + int64_t n = 0; if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0) CTransaction::nMinTxFee = n; else @@ -528,7 +529,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) } if (mapArgs.count("-minrelaytxfee")) { - int64 n = 0; + int64_t n = 0; if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0) CTransaction::nMinRelayTxFee = n; else @@ -582,7 +583,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) threadGroup.create_thread(&ThreadScriptCheck); } - int64 nStart; + int64_t nStart; // ********************************************************* Step 5: verify wallet database integrity @@ -592,7 +593,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) { // 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.%"PRId64".bak", GetTime()); try { boost::filesystem::rename(pathDatabase, pathDatabaseBak); LogPrintf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str()); @@ -864,7 +865,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) LogPrintf("Shutdown requested. Exiting.\n"); return false; } - LogPrintf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart); + LogPrintf(" block index %15"PRId64"ms\n", GetTimeMillis() - nStart); if (GetBoolArg("-printblockindex", false) || GetBoolArg("-printblocktree", false)) { @@ -957,7 +958,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) } LogPrintf("%s", strErrors.str().c_str()); - LogPrintf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart); + LogPrintf(" wallet %15"PRId64"ms\n", GetTimeMillis() - nStart); RegisterWallet(pwalletMain); @@ -979,7 +980,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) LogPrintf("Rescanning last %i blocks (from block %i)...\n", chainActive.Height() - pindexRescan->nHeight, pindexRescan->nHeight); nStart = GetTimeMillis(); pwalletMain->ScanForWalletTransactions(pindexRescan, true); - LogPrintf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); + LogPrintf(" rescan %15"PRId64"ms\n", GetTimeMillis() - nStart); pwalletMain->SetBestChain(chainActive.GetLocator()); nWalletDBUpdated++; } @@ -1011,7 +1012,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) LogPrintf("Invalid or missing peers.dat; recreating\n"); } - LogPrintf("Loaded %i addresses from peers.dat %"PRI64d"ms\n", + LogPrintf("Loaded %i addresses from peers.dat %"PRId64"ms\n", addrman.size(), GetTimeMillis() - nStart); // ********************************************************* Step 11: start node -- cgit v1.2.3