From 0f6c4653a4a838c8953e8c3546c430925c1212bb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 2 Oct 2015 22:06:17 -0400 Subject: [PATCH] Core: Replace 0 literals with nullptr --- Source/Core/Core/HW/BBA-TAP/TAP_Win32.cpp | 6 +++--- Source/Core/Core/HW/SI_GCAdapter.cpp | 2 +- Source/Core/Core/HW/WiimoteReal/IOWin.cpp | 8 ++++---- Source/Core/Core/IPC_HLE/WII_Socket.cpp | 2 +- Source/Core/Core/MemTools.cpp | 2 +- Source/Core/Core/NetPlayServer.cpp | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/HW/BBA-TAP/TAP_Win32.cpp b/Source/Core/Core/HW/BBA-TAP/TAP_Win32.cpp index c7caa20706..53825a4c7d 100644 --- a/Source/Core/Core/HW/BBA-TAP/TAP_Win32.cpp +++ b/Source/Core/Core/HW/BBA-TAP/TAP_Win32.cpp @@ -153,8 +153,8 @@ bool OpenTAP(HANDLE& adapter, const std::basic_string& device_guid) { auto const device_path = USERMODEDEVICEDIR + device_guid + TAPSUFFIX; - adapter = CreateFile(device_path.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, - OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0); + adapter = CreateFile(device_path.c_str(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, + OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, nullptr); if (adapter == INVALID_HANDLE_VALUE) { @@ -250,7 +250,7 @@ bool CEXIETHERNET::SendFrame(u8 *frame, u32 size) ZeroMemory(&overlap, sizeof(overlap)); // WriteFile will always return false because the TAP handle is async - WriteFile(mHAdapter, frame, size, NULL, &overlap); + WriteFile(mHAdapter, frame, size, nullptr, &overlap); DWORD res = GetLastError(); if (res != ERROR_IO_PENDING) diff --git a/Source/Core/Core/HW/SI_GCAdapter.cpp b/Source/Core/Core/HW/SI_GCAdapter.cpp index 8660f44d65..f018423d26 100644 --- a/Source/Core/Core/HW/SI_GCAdapter.cpp +++ b/Source/Core/Core/HW/SI_GCAdapter.cpp @@ -94,7 +94,7 @@ static void ScanThreadFunc() s_libusb_hotplug_enabled = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) != 0; if (s_libusb_hotplug_enabled) { - if (libusb_hotplug_register_callback(s_libusb_context, (libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT), LIBUSB_HOTPLUG_ENUMERATE, 0x057e, 0x0337, LIBUSB_HOTPLUG_MATCH_ANY, HotplugCallback, NULL, &s_hotplug_handle) != LIBUSB_SUCCESS) + if (libusb_hotplug_register_callback(s_libusb_context, (libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT), LIBUSB_HOTPLUG_ENUMERATE, 0x057e, 0x0337, LIBUSB_HOTPLUG_MATCH_ANY, HotplugCallback, nullptr, &s_hotplug_handle) != LIBUSB_SUCCESS) s_libusb_hotplug_enabled = false; if (s_libusb_hotplug_enabled) NOTICE_LOG(SERIALINTERFACE, "Using libUSB hotplug detection"); diff --git a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp index 3e3ce00c83..1b24d19965 100644 --- a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp +++ b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp @@ -540,7 +540,7 @@ bool WiimoteWindows::ConnectInternal() if (m_dev_handle == INVALID_HANDLE_VALUE) { - m_dev_handle = 0; + m_dev_handle = nullptr; return false; } @@ -591,7 +591,7 @@ void WiimoteWindows::DisconnectInternal() return; CloseHandle(m_dev_handle); - m_dev_handle = 0; + m_dev_handle = nullptr; #ifdef SHARE_WRITE_WIIMOTES std::lock_guard lk(g_connected_wiimotes_lock); @@ -601,7 +601,7 @@ void WiimoteWindows::DisconnectInternal() WiimoteWindows::WiimoteWindows(const std::basic_string& path) : m_devicepath(path) { - m_dev_handle = 0; + m_dev_handle = nullptr; m_stack = MSBT_STACK_UNKNOWN; m_hid_overlap_read = OVERLAPPED(); @@ -620,7 +620,7 @@ WiimoteWindows::~WiimoteWindows() bool WiimoteWindows::IsConnected() const { - return m_dev_handle != 0; + return m_dev_handle != nullptr; } // positive = read packet diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.cpp b/Source/Core/Core/IPC_HLE/WII_Socket.cpp index e5dea8728b..af621089be 100644 --- a/Source/Core/Core/IPC_HLE/WII_Socket.cpp +++ b/Source/Core/Core/IPC_HLE/WII_Socket.cpp @@ -244,7 +244,7 @@ void WiiSocket::Update(bool read, bool write, bool except) } else { - int ret = (s32)accept(fd, nullptr, 0); + int ret = (s32)accept(fd, nullptr, nullptr); ReturnValue = WiiSockMan::GetNetErrorCode(ret, "SO_ACCEPT", true); } diff --git a/Source/Core/Core/MemTools.cpp b/Source/Core/Core/MemTools.cpp index 5f96356e69..a9eca54464 100644 --- a/Source/Core/Core/MemTools.cpp +++ b/Source/Core/Core/MemTools.cpp @@ -57,7 +57,7 @@ LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs) } case EXCEPTION_STACK_OVERFLOW: - MessageBox(0, _T("Stack overflow!"), 0,0); + MessageBox(nullptr, _T("Stack overflow!"), nullptr, 0); return EXCEPTION_CONTINUE_SEARCH; case EXCEPTION_ILLEGAL_INSTRUCTION: diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 7ed283a4c0..ba702c07b1 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -231,7 +231,7 @@ unsigned int NetPlayServer::OnConnect(ENetPeer* socket) ENetPacket* epack; do { - epack = enet_peer_receive(socket, 0); + epack = enet_peer_receive(socket, nullptr); } while (epack == nullptr); rpac.append(epack->data, epack->dataLength);