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

Unified Diff: webrtc/base/win32.h

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/weak_ptr.cc ('k') | webrtc/base/win32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/win32.h
diff --git a/webrtc/base/win32.h b/webrtc/base/win32.h
index dba9b773b5dc7a970251ff28949e0aabf58e3976..22a17c518bc400e048cb467d6ea9c3a87a4676ee 100644
--- a/webrtc/base/win32.h
+++ b/webrtc/base/win32.h
@@ -48,7 +48,7 @@ int win32_inet_pton(int af, const char* src, void *dst);
inline std::wstring ToUtf16(const char* utf8, size_t len) {
int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len),
- NULL, 0);
+ nullptr, 0);
wchar_t* ws = STACK_ARRAY(wchar_t, len16);
::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len), ws, len16);
return std::wstring(ws, len16);
@@ -60,10 +60,10 @@ inline std::wstring ToUtf16(const std::string& str) {
inline std::string ToUtf8(const wchar_t* wide, size_t len) {
int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len),
- NULL, 0, NULL, NULL);
+ nullptr, 0, nullptr, nullptr);
char* ns = STACK_ARRAY(char, len8);
::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len), ns, len8,
- NULL, NULL);
+ nullptr, nullptr);
return std::string(ns, len8);
}
@@ -98,21 +98,19 @@ bool GetOsVersion(int* major, int* minor, int* build);
inline bool IsWindowsVistaOrLater() {
int major;
- return (GetOsVersion(&major, NULL, NULL) && major >= kWindowsVista);
+ return (GetOsVersion(&major, nullptr, nullptr) && major >= kWindowsVista);
}
inline bool IsWindowsXpOrLater() {
int major, minor;
- return (GetOsVersion(&major, &minor, NULL) &&
- (major >= kWindowsVista ||
- (major == kWindows2000 && minor >= 1)));
+ return (GetOsVersion(&major, &minor, nullptr) &&
+ (major >= kWindowsVista || (major == kWindows2000 && minor >= 1)));
}
inline bool IsWindows8OrLater() {
int major, minor;
- return (GetOsVersion(&major, &minor, NULL) &&
- (major > kWindowsVista ||
- (major == kWindowsVista && minor >= 2)));
+ return (GetOsVersion(&major, &minor, nullptr) &&
+ (major > kWindowsVista || (major == kWindowsVista && minor >= 2)));
}
// Determine the current integrity level of the process.
« no previous file with comments | « webrtc/base/weak_ptr.cc ('k') | webrtc/base/win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698