Skip to content

Commit 0959d37

Browse files
Don't use global (external) symbols for symbols that are used in only one translation unit
1 parent 03858b2 commit 0959d37

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,8 +2287,8 @@ class CNetCleanup
22872287
WSACleanup();
22882288
#endif
22892289
}
2290-
}
2291-
instance_of_cnetcleanup;
2290+
};
2291+
static CNetCleanup instance_of_cnetcleanup;
22922292

22932293
void CConnman::Interrupt()
22942294
{

src/net_processing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4023,4 +4023,5 @@ class CNetProcessingCleanup
40234023
mapOrphanTransactions.clear();
40244024
mapOrphanTransactionsByPrev.clear();
40254025
}
4026-
} instance_of_cnetprocessingcleanup;
4026+
};
4027+
static CNetProcessingCleanup instance_of_cnetprocessingcleanup;

src/ui_interface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ struct UISignals {
2222
boost::signals2::signal<CClientUIInterface::NotifyBlockTipSig> NotifyBlockTip;
2323
boost::signals2::signal<CClientUIInterface::NotifyHeaderTipSig> NotifyHeaderTip;
2424
boost::signals2::signal<CClientUIInterface::BannedListChangedSig> BannedListChanged;
25-
} g_ui_signals;
25+
};
26+
static UISignals g_ui_signals;
2627

2728
#define ADD_SIGNALS_IMPL_WRAPPER(signal_name) \
2829
boost::signals2::connection CClientUIInterface::signal_name##_connect(std::function<signal_name##Sig> fn) \

src/validation.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool CBlockIndexWorkComparator::operator()(const CBlockIndex *pa, const CBlockIn
7878
return false;
7979
}
8080

81-
CChainState g_chainstate;
81+
static CChainState g_chainstate;
8282

8383
CChainState& ChainstateActive() { return g_chainstate; }
8484

@@ -1049,7 +1049,7 @@ bool CChainState::IsInitialBlockDownload() const
10491049
return false;
10501050
}
10511051

1052-
CBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr;
1052+
static CBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr;
10531053

10541054
static void AlertNotify(const std::string& strMessage)
10551055
{
@@ -4762,4 +4762,5 @@ class CMainCleanup
47624762
delete (*it1).second;
47634763
mapBlockIndex.clear();
47644764
}
4765-
} instance_of_cmaincleanup;
4765+
};
4766+
static CMainCleanup instance_of_cmaincleanup;

0 commit comments

Comments
 (0)