From 0959d37e3e0f80010a78d175e3846dabf5d35919 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 26 May 2019 11:01:58 +0200 Subject: [PATCH] Don't use global (external) symbols for symbols that are used in only one translation unit --- src/net.cpp | 4 ++-- src/net_processing.cpp | 3 ++- src/ui_interface.cpp | 3 ++- src/validation.cpp | 7 ++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 3c6f5a05f..75a47d7ad 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2287,8 +2287,8 @@ public: WSACleanup(); #endif } -} -instance_of_cnetcleanup; +}; +static CNetCleanup instance_of_cnetcleanup; void CConnman::Interrupt() { diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 3d0a9b192..2ac4f9d68 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -4023,4 +4023,5 @@ public: mapOrphanTransactions.clear(); mapOrphanTransactionsByPrev.clear(); } -} instance_of_cnetprocessingcleanup; +}; +static CNetProcessingCleanup instance_of_cnetprocessingcleanup; diff --git a/src/ui_interface.cpp b/src/ui_interface.cpp index 31a95486d..41017fe46 100644 --- a/src/ui_interface.cpp +++ b/src/ui_interface.cpp @@ -22,7 +22,8 @@ struct UISignals { boost::signals2::signal NotifyBlockTip; boost::signals2::signal NotifyHeaderTip; boost::signals2::signal BannedListChanged; -} g_ui_signals; +}; +static UISignals g_ui_signals; #define ADD_SIGNALS_IMPL_WRAPPER(signal_name) \ boost::signals2::connection CClientUIInterface::signal_name##_connect(std::function fn) \ diff --git a/src/validation.cpp b/src/validation.cpp index 6fd796464..31b2eb397 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -78,7 +78,7 @@ bool CBlockIndexWorkComparator::operator()(const CBlockIndex *pa, const CBlockIn return false; } -CChainState g_chainstate; +static CChainState g_chainstate; CChainState& ChainstateActive() { return g_chainstate; } @@ -1049,7 +1049,7 @@ bool CChainState::IsInitialBlockDownload() const return false; } -CBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr; +static CBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr; static void AlertNotify(const std::string& strMessage) { @@ -4762,4 +4762,5 @@ public: delete (*it1).second; mapBlockIndex.clear(); } -} instance_of_cmaincleanup; +}; +static CMainCleanup instance_of_cmaincleanup;