aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorBrandon Dahler <brandon.dahler@gmail.com>2013-04-13 00:13:08 -0500
committerBrandon Dahler <brandon.dahler@gmail.com>2013-11-10 09:36:28 -0600
commit51ed9ec971614aebdbfbd9527aba365dd0afd437 (patch)
treed2f910390e55aef857023812fbdaefdd66cd99ff /src/db.cpp
parent7c4c207be8420d394a5abc4368d1bb69ad4f8067 (diff)
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.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 7e58ff45fb..a286d9f726 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -3,19 +3,24 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include "chainparams.h"
#include "db.h"
-#include "util.h"
-#include "hash.h"
+
#include "addrman.h"
-#include <boost/filesystem.hpp>
-#include <boost/filesystem/fstream.hpp>
-#include <openssl/rand.h>
+#include "hash.h"
+#include "protocol.h"
+#include "util.h"
+
+#include <inttypes.h>
+#include <stdint.h>
#ifndef WIN32
-#include "sys/stat.h"
+#include <sys/stat.h>
#endif
+#include <boost/filesystem.hpp>
+#include <boost/version.hpp>
+#include <openssl/rand.h>
+
using namespace std;
using namespace boost;
@@ -430,7 +435,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
void CDBEnv::Flush(bool fShutdown)
{
- int64 nStart = GetTimeMillis();
+ int64_t nStart = GetTimeMillis();
// Flush log data to the actual data file
// on all files that are not in use
LogPrint("db", "Flush(%s)%s\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started");
@@ -459,7 +464,7 @@ void CDBEnv::Flush(bool fShutdown)
else
mi++;
}
- LogPrint("db", "DBFlush(%s)%s ended %15"PRI64d"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
+ LogPrint("db", "DBFlush(%s)%s ended %15"PRId64"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
if (fShutdown)
{
char** listp;