aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2011-06-14 02:05:57 -0700
committerJeff Garzik <jgarzik@exmulti.com>2011-06-14 02:05:57 -0700
commit19ea44208f7c2cf335c654126deb81406036e328 (patch)
treeb3551e39efea8a96cac2513b08a97a040500168d
parentc02ec542691baff7517a10ab99bec0cead3ad3ee (diff)
parent31f293128177e0f53331ddb3f1f5ea22176bf91c (diff)
Merge pull request #226 from jordanlewis/betterheaders
Optimize header dependencies; improve Makefile dependency graph
-rw-r--r--src/db.cpp3
-rw-r--r--src/headers.h30
-rw-r--r--src/init.cpp7
-rw-r--r--src/irc.cpp3
-rw-r--r--src/main.cpp4
-rw-r--r--src/main.h10
-rw-r--r--src/net.cpp5
-rw-r--r--src/rpc.cpp5
-rw-r--r--src/ui.cpp4
-rw-r--r--src/util.cpp7
-rw-r--r--src/util.h1
11 files changed, 49 insertions, 30 deletions
diff --git a/src/db.cpp b/src/db.cpp
index c2c239db2f..b67e2a6452 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -3,6 +3,9 @@
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "db.h"
+#include "net.h"
+#include <boost/filesystem/fstream.hpp>
using namespace std;
using namespace boost;
diff --git a/src/headers.h b/src/headers.h
index d40c5ed0a9..9e81e27d1d 100644
--- a/src/headers.h
+++ b/src/headers.h
@@ -48,7 +48,6 @@
#include <limits.h>
#include <float.h>
#include <assert.h>
-#include <memory>
#include <iostream>
#include <sstream>
#include <string>
@@ -56,29 +55,8 @@
#include <list>
#include <deque>
#include <map>
-#include <set>
-#include <algorithm>
-#include <numeric>
+
#include <boost/foreach.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
-#include <boost/tuple/tuple_io.hpp>
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/filesystem/fstream.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/thread.hpp>
-#include <boost/interprocess/sync/file_lock.hpp>
-#include <boost/interprocess/sync/interprocess_mutex.hpp>
-#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
-#include <boost/date_time/gregorian/gregorian_types.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/config.hpp>
-#include <boost/program_options/detail/config_file.hpp>
-#include <boost/program_options/parsers.hpp>
#ifdef __WXMSW__
#include <windows.h>
@@ -110,7 +88,6 @@
#pragma hdrstop
-#include "strlcpy.h"
#include "serialize.h"
#include "uint256.h"
#include "util.h"
@@ -118,18 +95,13 @@
#include "bignum.h"
#include "base58.h"
#include "script.h"
-#include "db.h"
-#include "net.h"
-#include "irc.h"
#include "main.h"
-#include "rpc.h"
#ifdef GUI
#include "uibase.h"
#include "ui.h"
#else
#include "noui.h"
#endif
-#include "init.h"
#ifdef GUI
#include "xpm/addressbook16.xpm"
diff --git a/src/init.cpp b/src/init.cpp
index 0e2113e7cb..b683e66782 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -2,6 +2,13 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "db.h"
+#include "rpc.h"
+#include "net.h"
+#include "init.h"
+#include "strlcpy.h"
+#include <boost/filesystem/fstream.hpp>
+#include <boost/interprocess/sync/file_lock.hpp>
using namespace std;
using namespace boost;
diff --git a/src/irc.cpp b/src/irc.cpp
index a76374d143..cde934e80c 100644
--- a/src/irc.cpp
+++ b/src/irc.cpp
@@ -3,6 +3,9 @@
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "irc.h"
+#include "net.h"
+#include "strlcpy.h"
using namespace std;
using namespace boost;
diff --git a/src/main.cpp b/src/main.cpp
index 0456041ee5..108842f3a1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,7 +2,11 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "db.h"
+#include "net.h"
+#include "init.h"
#include "cryptopp/sha.h"
+#include <boost/filesystem/fstream.hpp>
using namespace std;
using namespace boost;
diff --git a/src/main.h b/src/main.h
index 436ffbecbd..7aa6d41c30 100644
--- a/src/main.h
+++ b/src/main.h
@@ -24,6 +24,13 @@ class CBlockIndex;
class CWalletTx;
class CKeyItem;
+class CMessageHeader;
+class CAddress;
+class CInv;
+class CRequestTracker;
+class CNode;
+class CBlockIndex;
+
static const unsigned int MAX_BLOCK_SIZE = 1000000;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
static const int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
@@ -78,6 +85,9 @@ extern int fUseUPnP;
+class CReserveKey;
+class CTxDB;
+class CTxIndex;
bool CheckDiskSpace(uint64 nAdditionalBytes=0);
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
diff --git a/src/net.cpp b/src/net.cpp
index ca6380fc76..8b439efdca 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -3,6 +3,11 @@
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "irc.h"
+#include "db.h"
+#include "net.h"
+#include "init.h"
+#include "strlcpy.h"
#ifdef USE_UPNP
#include <miniupnpc/miniwget.h>
diff --git a/src/rpc.cpp b/src/rpc.cpp
index 530bef4a43..ad1abe333e 100644
--- a/src/rpc.cpp
+++ b/src/rpc.cpp
@@ -4,12 +4,17 @@
#include "headers.h"
#include "cryptopp/sha.h"
+#include "db.h"
+#include "net.h"
+#include "init.h"
#undef printf
#include <boost/asio.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
+#include <boost/algorithm/string.hpp>
#ifdef USE_SSL
#include <boost/asio/ssl.hpp>
+#include <boost/filesystem/fstream.hpp>
typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> SSLStream;
#endif
#include "json/json_spirit_reader_template.h"
diff --git a/src/ui.cpp b/src/ui.cpp
index cca473d82b..0a7d45578f 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -3,6 +3,10 @@
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "init.h"
+#include "strlcpy.h"
+#include <boost/filesystem/fstream.hpp>
+#include <boost/filesystem/convenience.hpp>
#ifdef _MSC_VER
#include <crtdbg.h>
#endif
diff --git a/src/util.cpp b/src/util.cpp
index 8d839e1cab..b95e236167 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -2,6 +2,13 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "strlcpy.h"
+#include <boost/program_options/detail/config_file.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/interprocess/sync/interprocess_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
+#include <boost/foreach.hpp>
using namespace std;
using namespace boost;
diff --git a/src/util.h b/src/util.h
index cd0761ee39..e7110570c6 100644
--- a/src/util.h
+++ b/src/util.h
@@ -15,7 +15,6 @@
#include <vector>
#include <string>
-#include <boost/foreach.hpp>
#include <boost/thread.hpp>
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
#include <boost/date_time/gregorian/gregorian_types.hpp>