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

Unified Diff: webrtc/base/ifaddrs-android.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/httpserver_unittest.cc ('k') | webrtc/base/logging.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/ifaddrs-android.cc
diff --git a/webrtc/base/ifaddrs-android.cc b/webrtc/base/ifaddrs-android.cc
index d8d28a5ba3e6dec3e1fd33d2666e8b13683928df..f3c783834cd9f1760c75a07368e6468946fa2bac 100644
--- a/webrtc/base/ifaddrs-android.cc
+++ b/webrtc/base/ifaddrs-android.cc
@@ -39,7 +39,7 @@ namespace rtc {
int set_ifname(struct ifaddrs* ifaddr, int interface) {
char buf[IFNAMSIZ] = {0};
char* name = if_indextoname(interface, buf);
- if (name == NULL) {
+ if (name == nullptr) {
return -1;
}
ifaddr->ifa_name = new char[strlen(name) + 1];
@@ -84,7 +84,7 @@ int set_addresses(struct ifaddrs* ifaddr, ifaddrmsg* msg, void* data,
}
int make_prefixes(struct ifaddrs* ifaddr, int family, int prefixlen) {
- char* prefix = NULL;
+ char* prefix = nullptr;
if (family == AF_INET) {
sockaddr_in* mask = new sockaddr_in;
mask->sin_family = AF_INET;
@@ -149,8 +149,8 @@ int getifaddrs(struct ifaddrs** result) {
close(fd);
return -1;
}
- struct ifaddrs* start = NULL;
- struct ifaddrs* current = NULL;
+ struct ifaddrs* start = nullptr;
+ struct ifaddrs* current = nullptr;
char buf[kMaxReadSize];
ssize_t amount_read = recv(fd, &buf, kMaxReadSize, 0);
while (amount_read > 0) {
@@ -187,7 +187,7 @@ int getifaddrs(struct ifaddrs** result) {
if (populate_ifaddrs(newest, address_msg, RTA_DATA(rta),
RTA_PAYLOAD(rta)) != 0) {
freeifaddrs(start);
- *result = NULL;
+ *result = nullptr;
return -1;
}
current = newest;
@@ -207,7 +207,7 @@ int getifaddrs(struct ifaddrs** result) {
}
void freeifaddrs(struct ifaddrs* addrs) {
- struct ifaddrs* last = NULL;
+ struct ifaddrs* last = nullptr;
struct ifaddrs* cursor = addrs;
while (cursor) {
delete[] cursor->ifa_name;
« no previous file with comments | « webrtc/base/httpserver_unittest.cc ('k') | webrtc/base/logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698