diff options
author | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2019-06-14 16:42:10 -0400 |
---|---|---|
committer | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2019-06-14 19:23:18 -0400 |
commit | 47b380f03e8898f4706ff01fa2be64dfb72e0dba (patch) | |
tree | fb3508758c9abd0e297afee43ac847bf5aebcbbb /src/mongo/db/repl/isself.cpp | |
parent | b3c26131f6ab3f919beca658341e737de5d45683 (diff) | |
download | mongo-47b380f03e8898f4706ff01fa2be64dfb72e0dba.tar.gz |
SERVER-41071 Replace NULL and 0 with nullptr
Diffstat (limited to 'src/mongo/db/repl/isself.cpp')
-rw-r--r-- | src/mongo/db/repl/isself.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/repl/isself.cpp b/src/mongo/db/repl/isself.cpp index a78298933fd..f864cbb13de 100644 --- a/src/mongo/db/repl/isself.cpp +++ b/src/mongo/db/repl/isself.cpp @@ -107,7 +107,7 @@ std::string stringifyError(int code) { std::vector<std::string> getAddrsForHost(const std::string& iporhost, const int port, const bool ipv6enabled) { - addrinfo* addrs = NULL; + addrinfo* addrs = nullptr; addrinfo hints = {0}; hints.ai_socktype = SOCK_STREAM; hints.ai_family = (ipv6enabled ? AF_UNSPEC : AF_INET); @@ -126,13 +126,13 @@ std::vector<std::string> getAddrsForHost(const std::string& iporhost, ON_BLOCK_EXIT([&] { freeaddrinfo(addrs); }); - for (addrinfo* addr = addrs; addr != NULL; addr = addr->ai_next) { + for (addrinfo* addr = addrs; addr != nullptr; addr = addr->ai_next) { int family = addr->ai_family; char host[NI_MAXHOST]; if (family == AF_INET || family == AF_INET6) { err = getnameinfo( - addr->ai_addr, addr->ai_addrlen, host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); + addr->ai_addr, addr->ai_addrlen, host, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST); if (err) { warning() << "getnameinfo() failed: " << stringifyError(err) << std::endl; continue; @@ -235,8 +235,8 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) { ON_BLOCK_EXIT([&] { freeifaddrs(addrs); }); // based on example code from linux getifaddrs manpage - for (ifaddrs* addr = addrs; addr != NULL; addr = addr->ifa_next) { - if (addr->ifa_addr == NULL) + for (ifaddrs* addr = addrs; addr != nullptr; addr = addr->ifa_next) { + if (addr->ifa_addr == nullptr) continue; int family = addr->ifa_addr->sa_family; char host[NI_MAXHOST]; @@ -247,7 +247,7 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) { (family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)), host, NI_MAXHOST, - NULL, + nullptr, 0, NI_NUMERICHOST); if (err) { |