mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01: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:
@@ -138,8 +138,8 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx)
|
||||
size_t n_read_out = 0;
|
||||
char *line;
|
||||
assert(input);
|
||||
// If there is not a whole line to read, evbuffer_readln returns NULL
|
||||
while((line = evbuffer_readln(input, &n_read_out, EVBUFFER_EOL_CRLF)) != NULL)
|
||||
// If there is not a whole line to read, evbuffer_readln returns nullptr
|
||||
while((line = evbuffer_readln(input, &n_read_out, EVBUFFER_EOL_CRLF)) != nullptr)
|
||||
{
|
||||
std::string s(line, n_read_out);
|
||||
free(line);
|
||||
@@ -210,7 +210,7 @@ bool TorControlConnection::Connect(const std::string &target, const ConnectionCB
|
||||
b_conn = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);
|
||||
if (!b_conn)
|
||||
return false;
|
||||
bufferevent_setcb(b_conn, TorControlConnection::readcb, NULL, TorControlConnection::eventcb, this);
|
||||
bufferevent_setcb(b_conn, TorControlConnection::readcb, nullptr, TorControlConnection::eventcb, this);
|
||||
bufferevent_enable(b_conn, EV_READ|EV_WRITE);
|
||||
this->connected = _connected;
|
||||
this->disconnected = _disconnected;
|
||||
@@ -333,7 +333,7 @@ static std::map<std::string,std::string> ParseTorReplyMapping(const std::string
|
||||
if (j == 3 && value[i] > '3') {
|
||||
j--;
|
||||
}
|
||||
escaped_value.push_back(strtol(value.substr(i, j).c_str(), NULL, 8));
|
||||
escaped_value.push_back(strtol(value.substr(i, j).c_str(), nullptr, 8));
|
||||
// Account for automatic incrementing at loop end
|
||||
i += j - 1;
|
||||
} else {
|
||||
@@ -367,7 +367,7 @@ static std::map<std::string,std::string> ParseTorReplyMapping(const std::string
|
||||
static std::pair<bool,std::string> ReadBinaryFile(const fs::path &filename, size_t maxsize=std::numeric_limits<size_t>::max())
|
||||
{
|
||||
FILE *f = fsbridge::fopen(filename, "rb");
|
||||
if (f == NULL)
|
||||
if (f == nullptr)
|
||||
return std::make_pair(false,"");
|
||||
std::string retval;
|
||||
char buffer[128];
|
||||
@@ -393,7 +393,7 @@ static std::pair<bool,std::string> ReadBinaryFile(const fs::path &filename, size
|
||||
static bool WriteBinaryFile(const fs::path &filename, const std::string &data)
|
||||
{
|
||||
FILE *f = fsbridge::fopen(filename, "wb");
|
||||
if (f == NULL)
|
||||
if (f == nullptr)
|
||||
return false;
|
||||
if (fwrite(data.data(), 1, data.size(), f) != data.size()) {
|
||||
fclose(f);
|
||||
|
||||
Reference in New Issue
Block a user