Skip to content

Commit

Permalink
Use NULL for Win32 API instead of nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Sep 16, 2021
1 parent d035fb6 commit 24ba022
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions components/brave_vpn/brave_vpn_os_connection_api_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ void BraveVPNOSConnectionAPIWin::OnRemoved(const std::string& name,
void BraveVPNOSConnectionAPIWin::StartVPNConnectionChangeMonitoring() {
DCHECK(!event_handle_for_connected_ && !event_handle_for_disconnected_);

event_handle_for_connected_ = CreateEvent(nullptr, false, false, nullptr);
event_handle_for_disconnected_ = CreateEvent(nullptr, false, false, nullptr);
event_handle_for_connected_ = CreateEvent(NULL, false, false, NULL);
event_handle_for_disconnected_ = CreateEvent(NULL, false, false, NULL);

// We don't need to check current connection state again if monitor each event
// separately.
Expand Down
4 changes: 2 additions & 2 deletions components/brave_vpn/brave_vpn_os_connection_api_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class BraveVPNOSConnectionAPIWin : public BraveVPNOSConnectionAPI,

void StartVPNConnectionChangeMonitoring();

HANDLE event_handle_for_connected_ = nullptr;
HANDLE event_handle_for_disconnected_ = nullptr;
HANDLE event_handle_for_connected_ = NULL;
HANDLE event_handle_for_disconnected_ = NULL;
base::win::ObjectWatcher connected_event_watcher_;
base::win::ObjectWatcher connecting_event_watcher_;
base::win::ObjectWatcher disconnected_event_watcher_;
Expand Down
6 changes: 3 additions & 3 deletions components/brave_vpn/utils_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace brave_vpn {

namespace {

HANDLE g_event_handle = nullptr;
HANDLE g_event_handle = NULL;

void WINAPI RasDialFunc(UINT, RASCONNSTATE rasconnstate, DWORD error) {
if (error) {
Expand Down Expand Up @@ -78,14 +78,14 @@ namespace internal {

HANDLE GetEventHandleForConnecting() {
if (!g_event_handle)
g_event_handle = CreateEvent(nullptr, false, false, nullptr);
g_event_handle = CreateEvent(NULL, false, false, NULL);
return g_event_handle;
}

void CloseEventHandleForConnecting() {
if (g_event_handle) {
CloseHandle(g_event_handle);
g_event_handle = nullptr;
g_event_handle = NULL;
}
}

Expand Down

0 comments on commit 24ba022

Please sign in to comment.