Make it clear which functions that are intended to be translation unit local

Do not share functions that are meant to be translation unit local with
other translation units. Use internal linkage for those consistently.
This commit is contained in:
practicalswift
2018-05-02 17:14:48 +02:00
parent 7eb7076f70
commit c3f34d06be
43 changed files with 226 additions and 226 deletions

View File

@@ -8,12 +8,12 @@
/* Equality between doubles is imprecise. Comparison should be done
* with a small threshold of tolerance, rather than exact equality.
*/
bool DoubleEquals(double a, double b, double epsilon)
static bool DoubleEquals(double a, double b, double epsilon)
{
return std::abs(a - b) < epsilon;
}
CBlockIndex* CreateBlockIndexWithNbits(uint32_t nbits)
static CBlockIndex* CreateBlockIndexWithNbits(uint32_t nbits)
{
CBlockIndex* block_index = new CBlockIndex();
block_index->nHeight = 46367;
@@ -22,7 +22,7 @@ CBlockIndex* CreateBlockIndexWithNbits(uint32_t nbits)
return block_index;
}
CChain CreateChainWithNbits(uint32_t nbits)
static CChain CreateChainWithNbits(uint32_t nbits)
{
CBlockIndex* block_index = CreateBlockIndexWithNbits(nbits);
CChain chain;
@@ -30,7 +30,7 @@ CChain CreateChainWithNbits(uint32_t nbits)
return chain;
}
void RejectDifficultyMismatch(double difficulty, double expected_difficulty) {
static void RejectDifficultyMismatch(double difficulty, double expected_difficulty) {
BOOST_CHECK_MESSAGE(
DoubleEquals(difficulty, expected_difficulty, 0.00001),
"Difficulty was " + std::to_string(difficulty)
@@ -40,7 +40,7 @@ void RejectDifficultyMismatch(double difficulty, double expected_difficulty) {
/* Given a BlockIndex with the provided nbits,
* verify that the expected difficulty results.
*/
void TestDifficulty(uint32_t nbits, double expected_difficulty)
static void TestDifficulty(uint32_t nbits, double expected_difficulty)
{
CBlockIndex* block_index = CreateBlockIndexWithNbits(nbits);
/* Since we are passing in block index explicitly,