From f23f9a03c86f789ab41d75b91f75393e3156ec39 Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 14:30:15 -0500 Subject: Only include irc.h when needed --- src/headers.h | 1 - src/irc.cpp | 1 + src/net.cpp | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index d40c5ed0a9..7cc6d3b906 100644 --- a/src/headers.h +++ b/src/headers.h @@ -120,7 +120,6 @@ #include "script.h" #include "db.h" #include "net.h" -#include "irc.h" #include "main.h" #include "rpc.h" #ifdef GUI diff --git a/src/irc.cpp b/src/irc.cpp index 099d9e0735..b245546378 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "irc.h" using namespace std; using namespace boost; diff --git a/src/net.cpp b/src/net.cpp index 1320781cb2..3339b7718b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "irc.h" #ifdef USE_UPNP #include -- cgit v1.2.3 From 1512d5ce64b9a53260f5aa695bc79a0e48d6294f Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 15:57:34 -0500 Subject: Only include db.h when we have to. --- src/db.cpp | 1 + src/headers.h | 1 - src/init.cpp | 1 + src/main.cpp | 1 + src/main.h | 3 +++ src/net.cpp | 1 + src/rpc.cpp | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/db.cpp b/src/db.cpp index 52c0f5b4c3..7152033c49 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "db.h" using namespace std; using namespace boost; diff --git a/src/headers.h b/src/headers.h index 7cc6d3b906..2d309f959b 100644 --- a/src/headers.h +++ b/src/headers.h @@ -118,7 +118,6 @@ #include "bignum.h" #include "base58.h" #include "script.h" -#include "db.h" #include "net.h" #include "main.h" #include "rpc.h" diff --git a/src/init.cpp b/src/init.cpp index 431c533a83..14f4904f5b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2,6 +2,7 @@ // 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" using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index 68b6b4ee1b..dda366a1f4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ // 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 "cryptopp/sha.h" using namespace std; diff --git a/src/main.h b/src/main.h index 92b73fe5ad..411777349a 100644 --- a/src/main.h +++ b/src/main.h @@ -77,6 +77,9 @@ extern int fUseUPnP; +class CReserveKey; +class CTxDB; +class CTxIndex; bool CheckDiskSpace(uint64 nAdditionalBytes=0); diff --git a/src/net.cpp b/src/net.cpp index 3339b7718b..7a1c137c75 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "irc.h" +#include "db.h" #ifdef USE_UPNP #include diff --git a/src/rpc.cpp b/src/rpc.cpp index 9efcbbb15a..e826d0b447 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "cryptopp/sha.h" +#include "db.h" #undef printf #include #include -- cgit v1.2.3 From ed0c143242d734365b0e3d09b0e52e07819ffcdd Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 16:10:07 -0500 Subject: Only included rpc.h when necessary --- src/headers.h | 1 - src/init.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index 2d309f959b..ee10c53eca 100644 --- a/src/headers.h +++ b/src/headers.h @@ -120,7 +120,6 @@ #include "script.h" #include "net.h" #include "main.h" -#include "rpc.h" #ifdef GUI #include "uibase.h" #include "ui.h" diff --git a/src/init.cpp b/src/init.cpp index 14f4904f5b..b12c5eecf8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "db.h" +#include "rpc.h" using namespace std; using namespace boost; -- cgit v1.2.3 From 40c2614ef43a59ec0c8dc4338bbe27862243f2bb Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 16:20:30 -0500 Subject: Only include net.h when we have to --- src/db.cpp | 1 + src/headers.h | 1 - src/init.cpp | 1 + src/irc.cpp | 1 + src/main.cpp | 1 + src/main.h | 7 +++++++ src/net.cpp | 1 + src/rpc.cpp | 1 + 8 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/db.cpp b/src/db.cpp index 7152033c49..b3ce00a04f 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "db.h" +#include "net.h" using namespace std; using namespace boost; diff --git a/src/headers.h b/src/headers.h index ee10c53eca..67165c464e 100644 --- a/src/headers.h +++ b/src/headers.h @@ -118,7 +118,6 @@ #include "bignum.h" #include "base58.h" #include "script.h" -#include "net.h" #include "main.h" #ifdef GUI #include "uibase.h" diff --git a/src/init.cpp b/src/init.cpp index b12c5eecf8..149110f409 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "db.h" #include "rpc.h" +#include "net.h" using namespace std; using namespace boost; diff --git a/src/irc.cpp b/src/irc.cpp index b245546378..5c9e0a9602 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "irc.h" +#include "net.h" using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index dda366a1f4..5c6cb678c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "db.h" +#include "net.h" #include "cryptopp/sha.h" using namespace std; diff --git a/src/main.h b/src/main.h index 411777349a..33c4892732 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; diff --git a/src/net.cpp b/src/net.cpp index 7a1c137c75..60a91dffda 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "irc.h" #include "db.h" +#include "net.h" #ifdef USE_UPNP #include diff --git a/src/rpc.cpp b/src/rpc.cpp index e826d0b447..9ab7710ad9 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "cryptopp/sha.h" #include "db.h" +#include "net.h" #undef printf #include #include -- cgit v1.2.3 From edd309e5373022f9737cb97b7f38872e46a53cd4 Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sun, 15 May 2011 16:52:31 -0500 Subject: Only include init.h when we have to --- src/headers.h | 1 - src/init.cpp | 1 + src/main.cpp | 1 + src/net.cpp | 1 + src/rpc.cpp | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index 67165c464e..3665e584f6 100644 --- a/src/headers.h +++ b/src/headers.h @@ -125,7 +125,6 @@ #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 149110f409..3eab8e1c8c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -5,6 +5,7 @@ #include "db.h" #include "rpc.h" #include "net.h" +#include "init.h" using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index 5c6cb678c0..18f36eb3a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "db.h" #include "net.h" +#include "init.h" #include "cryptopp/sha.h" using namespace std; diff --git a/src/net.cpp b/src/net.cpp index 60a91dffda..51d29022be 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -6,6 +6,7 @@ #include "irc.h" #include "db.h" #include "net.h" +#include "init.h" #ifdef USE_UPNP #include diff --git a/src/rpc.cpp b/src/rpc.cpp index 9ab7710ad9..8731b6d57e 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -6,6 +6,7 @@ #include "cryptopp/sha.h" #include "db.h" #include "net.h" +#include "init.h" #undef printf #include #include -- cgit v1.2.3 From fdd7d047443b3f4ce1e4433ec28289a11ba4a94b Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sun, 15 May 2011 17:08:35 -0500 Subject: Only include strlcpy.h when we have to --- src/headers.h | 1 - src/init.cpp | 1 + src/irc.cpp | 1 + src/net.cpp | 1 + src/util.cpp | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index 3665e584f6..785d5bcf30 100644 --- a/src/headers.h +++ b/src/headers.h @@ -110,7 +110,6 @@ #pragma hdrstop -#include "strlcpy.h" #include "serialize.h" #include "uint256.h" #include "util.h" diff --git a/src/init.cpp b/src/init.cpp index 3eab8e1c8c..a94ea9b7b7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -6,6 +6,7 @@ #include "rpc.h" #include "net.h" #include "init.h" +#include "strlcpy.h" using namespace std; using namespace boost; diff --git a/src/irc.cpp b/src/irc.cpp index 5c9e0a9602..a262eaba41 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "irc.h" #include "net.h" +#include "strlcpy.h" using namespace std; using namespace boost; diff --git a/src/net.cpp b/src/net.cpp index 51d29022be..2d896271f1 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -7,6 +7,7 @@ #include "db.h" #include "net.h" #include "init.h" +#include "strlcpy.h" #ifdef USE_UPNP #include diff --git a/src/util.cpp b/src/util.cpp index 4e93f625de..1b6ba016af 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2,6 +2,7 @@ // 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" using namespace std; using namespace boost; -- cgit v1.2.3 From 6b783965c4c9dbce3c782f3f70b7b6342b7e56da Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 14:29:54 -0500 Subject: Remove some globally unused headers from headers.h --- src/headers.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/headers.h b/src/headers.h index 785d5bcf30..a242c9c15e 100644 --- a/src/headers.h +++ b/src/headers.h @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -56,14 +55,8 @@ #include #include #include -#include -#include -#include + #include -#include -#include -#include -#include #include #include #include @@ -74,9 +67,6 @@ #include #include #include -#include -#include -#include #include #include -- cgit v1.2.3 From 31f293128177e0f53331ddb3f1f5ea22176bf91c Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sun, 15 May 2011 22:45:35 -0500 Subject: Only include certain boost headers if necessary. --- src/db.cpp | 1 + src/headers.h | 12 ------------ src/init.cpp | 2 ++ src/main.cpp | 1 + src/rpc.cpp | 2 ++ src/ui.cpp | 4 ++++ src/util.cpp | 6 ++++++ src/util.h | 1 - 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index b3ce00a04f..0e5522298b 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "db.h" #include "net.h" +#include using namespace std; using namespace boost; diff --git a/src/headers.h b/src/headers.h index a242c9c15e..9e81e27d1d 100644 --- a/src/headers.h +++ b/src/headers.h @@ -57,18 +57,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef __WXMSW__ #include diff --git a/src/init.cpp b/src/init.cpp index a94ea9b7b7..73f4e207cd 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -7,6 +7,8 @@ #include "net.h" #include "init.h" #include "strlcpy.h" +#include +#include using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index 18f36eb3a4..0ecbeafd93 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include "net.h" #include "init.h" #include "cryptopp/sha.h" +#include using namespace std; using namespace boost; diff --git a/src/rpc.cpp b/src/rpc.cpp index 8731b6d57e..b05a13e23b 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -11,8 +11,10 @@ #include #include #include +#include #ifdef USE_SSL #include +#include typedef boost::asio::ssl::stream SSLStream; #endif #include "json/json_spirit_reader_template.h" diff --git a/src/ui.cpp b/src/ui.cpp index 6e28435a35..f24449cccb 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 +#include #ifdef _MSC_VER #include #endif diff --git a/src/util.cpp b/src/util.cpp index 1b6ba016af..32f4b27fd6 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3,6 +3,12 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "strlcpy.h" +#include +#include +#include +#include +#include +#include using namespace std; using namespace boost; diff --git a/src/util.h b/src/util.h index e4bf0fb10d..3244595164 100644 --- a/src/util.h +++ b/src/util.h @@ -15,7 +15,6 @@ #include #include -#include #include #include #include -- cgit v1.2.3