mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-05 11:28:49 +02:00
scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL
-BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE(skiplist_test)
|
||||
|
||||
for (int i=0; i<SKIPLIST_LENGTH; i++) {
|
||||
vIndex[i].nHeight = i;
|
||||
vIndex[i].pprev = (i == 0) ? NULL : &vIndex[i - 1];
|
||||
vIndex[i].pprev = (i == 0) ? nullptr : &vIndex[i - 1];
|
||||
vIndex[i].BuildSkip();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(skiplist_test)
|
||||
BOOST_CHECK(vIndex[i].pskip == &vIndex[vIndex[i].pskip->nHeight]);
|
||||
BOOST_CHECK(vIndex[i].pskip->nHeight < i);
|
||||
} else {
|
||||
BOOST_CHECK(vIndex[i].pskip == NULL);
|
||||
BOOST_CHECK(vIndex[i].pskip == nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ BOOST_AUTO_TEST_CASE(getlocator_test)
|
||||
for (unsigned int i=0; i<vBlocksMain.size(); i++) {
|
||||
vHashMain[i] = ArithToUint256(i); // Set the hash equal to the height, so we can quickly check the distances.
|
||||
vBlocksMain[i].nHeight = i;
|
||||
vBlocksMain[i].pprev = i ? &vBlocksMain[i - 1] : NULL;
|
||||
vBlocksMain[i].pprev = i ? &vBlocksMain[i - 1] : nullptr;
|
||||
vBlocksMain[i].phashBlock = &vHashMain[i];
|
||||
vBlocksMain[i].BuildSkip();
|
||||
BOOST_CHECK_EQUAL((int)UintToArith256(vBlocksMain[i].GetBlockHash()).GetLow64(), vBlocksMain[i].nHeight);
|
||||
BOOST_CHECK(vBlocksMain[i].pprev == NULL || vBlocksMain[i].nHeight == vBlocksMain[i].pprev->nHeight + 1);
|
||||
BOOST_CHECK(vBlocksMain[i].pprev == nullptr || vBlocksMain[i].nHeight == vBlocksMain[i].pprev->nHeight + 1);
|
||||
}
|
||||
|
||||
// Build a branch that splits off at block 49999, 50000 blocks long.
|
||||
@@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE(getlocator_test)
|
||||
vBlocksSide[i].phashBlock = &vHashSide[i];
|
||||
vBlocksSide[i].BuildSkip();
|
||||
BOOST_CHECK_EQUAL((int)UintToArith256(vBlocksSide[i].GetBlockHash()).GetLow64(), vBlocksSide[i].nHeight);
|
||||
BOOST_CHECK(vBlocksSide[i].pprev == NULL || vBlocksSide[i].nHeight == vBlocksSide[i].pprev->nHeight + 1);
|
||||
BOOST_CHECK(vBlocksSide[i].pprev == nullptr || vBlocksSide[i].nHeight == vBlocksSide[i].pprev->nHeight + 1);
|
||||
}
|
||||
|
||||
// Build a CChain for the main branch.
|
||||
@@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(findearliestatleast_test)
|
||||
for (unsigned int i=0; i<vBlocksMain.size(); i++) {
|
||||
vHashMain[i] = ArithToUint256(i); // Set the hash equal to the height
|
||||
vBlocksMain[i].nHeight = i;
|
||||
vBlocksMain[i].pprev = i ? &vBlocksMain[i - 1] : NULL;
|
||||
vBlocksMain[i].pprev = i ? &vBlocksMain[i - 1] : nullptr;
|
||||
vBlocksMain[i].phashBlock = &vHashMain[i];
|
||||
vBlocksMain[i].BuildSkip();
|
||||
if (i < 10) {
|
||||
@@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(findearliestatleast_test)
|
||||
int64_t test_time = vBlocksMain[r].nTime;
|
||||
CBlockIndex *ret = chain.FindEarliestAtLeast(test_time);
|
||||
BOOST_CHECK(ret->nTimeMax >= test_time);
|
||||
BOOST_CHECK((ret->pprev==NULL) || ret->pprev->nTimeMax < test_time);
|
||||
BOOST_CHECK((ret->pprev==nullptr) || ret->pprev->nTimeMax < test_time);
|
||||
BOOST_CHECK(vBlocksMain[r].GetAncestor(ret->nHeight) == ret);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user