Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: webrtc/base/network.cc

Issue 2718663005: Replace NULL with nullptr or null in webrtc/base/. (Closed)
Patch Set: Fixing Windows and formatting issues. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/nethelpers.cc ('k') | webrtc/base/openssladapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/network.cc
diff --git a/webrtc/base/network.cc b/webrtc/base/network.cc
index 1092a04ca2cfc8ac281b7b7c96ad562636d6b744..69dc28ccd200a6c53e61805f9083d2c0a7784349 100644
--- a/webrtc/base/network.cc
+++ b/webrtc/base/network.cc
@@ -392,9 +392,10 @@ Network* NetworkManagerBase::GetNetworkFromAddress(
}
BasicNetworkManager::BasicNetworkManager()
- : thread_(NULL), sent_first_update_(false), start_count_(0),
- ignore_non_default_routes_(false) {
-}
+ : thread_(nullptr),
+ sent_first_update_(false),
+ start_count_(0),
+ ignore_non_default_routes_(false) {}
BasicNetworkManager::~BasicNetworkManager() {
}
@@ -420,8 +421,8 @@ void BasicNetworkManager::ConvertIfAddrs(struct ifaddrs* interfaces,
NetworkList* networks) const {
NetworkMap current_networks;
- for (struct ifaddrs* cursor = interfaces;
- cursor != NULL; cursor = cursor->ifa_next) {
+ for (struct ifaddrs* cursor = interfaces; cursor != nullptr;
+ cursor = cursor->ifa_next) {
IPAddress prefix;
IPAddress mask;
InterfaceAddress ip;
@@ -518,7 +519,7 @@ unsigned int GetPrefix(PIP_ADAPTER_PREFIX prefixlist,
unsigned int best_length = 0;
while (prefixlist) {
// Look for the longest matching prefix in the prefixlist.
- if (prefixlist->Address.lpSockaddr == NULL ||
+ if (prefixlist->Address.lpSockaddr == nullptr ||
prefixlist->Address.lpSockaddr->sa_family != ip.family()) {
prefixlist = prefixlist->Next;
continue;
@@ -660,7 +661,7 @@ bool BasicNetworkManager::CreateNetworks(bool include_ignored,
#if defined(WEBRTC_LINUX)
bool IsDefaultRoute(const std::string& network_name) {
FileStream fs;
- if (!fs.Open("/proc/net/route", "r", NULL)) {
+ if (!fs.Open("/proc/net/route", "r", nullptr)) {
LOG(LS_WARNING) << "Couldn't read /proc/net/route, skipping default "
<< "route check (assuming everything is a default route).";
return true;
@@ -711,7 +712,7 @@ bool BasicNetworkManager::IsIgnoredNetwork(const Network& network) const {
// VMware Virtual Ethernet Adapter for VMnet1
// but don't ignore any GUEST side adapters with a description like:
// VMware Accelerated AMD PCNet Adapter #2
- if (strstr(network.description().c_str(), "VMnet") != NULL) {
+ if (strstr(network.description().c_str(), "VMnet") != nullptr) {
return true;
}
#endif
« no previous file with comments | « webrtc/base/nethelpers.cc ('k') | webrtc/base/openssladapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698