mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 12:03:04 +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:
@@ -479,7 +479,7 @@ public:
|
||||
{
|
||||
if (file) {
|
||||
::fclose(file);
|
||||
file = NULL;
|
||||
file = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ public:
|
||||
* @note This will invalidate the CAutoFile object, and makes it the responsibility of the caller
|
||||
* of this function to clean up the returned FILE*.
|
||||
*/
|
||||
FILE* release() { FILE* ret = file; file = NULL; return ret; }
|
||||
FILE* release() { FILE* ret = file; file = nullptr; return ret; }
|
||||
|
||||
/** Get wrapped FILE* without transfer of ownership.
|
||||
* @note Ownership of the FILE* will remain with this class. Use this only if the scope of the
|
||||
@@ -495,9 +495,9 @@ public:
|
||||
*/
|
||||
FILE* Get() const { return file; }
|
||||
|
||||
/** Return true if the wrapped FILE* is NULL, false otherwise.
|
||||
/** Return true if the wrapped FILE* is nullptr, false otherwise.
|
||||
*/
|
||||
bool IsNull() const { return (file == NULL); }
|
||||
bool IsNull() const { return (file == nullptr); }
|
||||
|
||||
//
|
||||
// Stream subset
|
||||
@@ -508,7 +508,7 @@ public:
|
||||
void read(char* pch, size_t nSize)
|
||||
{
|
||||
if (!file)
|
||||
throw std::ios_base::failure("CAutoFile::read: file handle is NULL");
|
||||
throw std::ios_base::failure("CAutoFile::read: file handle is nullptr");
|
||||
if (fread(pch, 1, nSize, file) != nSize)
|
||||
throw std::ios_base::failure(feof(file) ? "CAutoFile::read: end of file" : "CAutoFile::read: fread failed");
|
||||
}
|
||||
@@ -516,7 +516,7 @@ public:
|
||||
void ignore(size_t nSize)
|
||||
{
|
||||
if (!file)
|
||||
throw std::ios_base::failure("CAutoFile::ignore: file handle is NULL");
|
||||
throw std::ios_base::failure("CAutoFile::ignore: file handle is nullptr");
|
||||
unsigned char data[4096];
|
||||
while (nSize > 0) {
|
||||
size_t nNow = std::min<size_t>(nSize, sizeof(data));
|
||||
@@ -529,7 +529,7 @@ public:
|
||||
void write(const char* pch, size_t nSize)
|
||||
{
|
||||
if (!file)
|
||||
throw std::ios_base::failure("CAutoFile::write: file handle is NULL");
|
||||
throw std::ios_base::failure("CAutoFile::write: file handle is nullptr");
|
||||
if (fwrite(pch, 1, nSize, file) != nSize)
|
||||
throw std::ios_base::failure("CAutoFile::write: write failed");
|
||||
}
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
{
|
||||
// Serialize to this stream
|
||||
if (!file)
|
||||
throw std::ios_base::failure("CAutoFile::operator<<: file handle is NULL");
|
||||
throw std::ios_base::failure("CAutoFile::operator<<: file handle is nullptr");
|
||||
::Serialize(*this, obj);
|
||||
return (*this);
|
||||
}
|
||||
@@ -549,7 +549,7 @@ public:
|
||||
{
|
||||
// Unserialize from this stream
|
||||
if (!file)
|
||||
throw std::ios_base::failure("CAutoFile::operator>>: file handle is NULL");
|
||||
throw std::ios_base::failure("CAutoFile::operator>>: file handle is nullptr");
|
||||
::Unserialize(*this, obj);
|
||||
return (*this);
|
||||
}
|
||||
@@ -616,7 +616,7 @@ public:
|
||||
{
|
||||
if (src) {
|
||||
::fclose(src);
|
||||
src = NULL;
|
||||
src = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user