Core: Replace 0 literals with nullptr

This commit is contained in:
Lioncash 2015-10-02 22:06:17 -04:00
parent ce493b897d
commit 0f6c4653a4
6 changed files with 11 additions and 11 deletions

View File

@ -153,8 +153,8 @@ bool OpenTAP(HANDLE& adapter, const std::basic_string<TCHAR>& device_guid)
{ {
auto const device_path = USERMODEDEVICEDIR + device_guid + TAPSUFFIX; auto const device_path = USERMODEDEVICEDIR + device_guid + TAPSUFFIX;
adapter = CreateFile(device_path.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, adapter = CreateFile(device_path.c_str(), GENERIC_READ | GENERIC_WRITE, 0, nullptr,
OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0); OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, nullptr);
if (adapter == INVALID_HANDLE_VALUE) if (adapter == INVALID_HANDLE_VALUE)
{ {
@ -250,7 +250,7 @@ bool CEXIETHERNET::SendFrame(u8 *frame, u32 size)
ZeroMemory(&overlap, sizeof(overlap)); ZeroMemory(&overlap, sizeof(overlap));
// WriteFile will always return false because the TAP handle is async // 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(); DWORD res = GetLastError();
if (res != ERROR_IO_PENDING) if (res != ERROR_IO_PENDING)

View File

@ -94,7 +94,7 @@ static void ScanThreadFunc()
s_libusb_hotplug_enabled = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) != 0; s_libusb_hotplug_enabled = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) != 0;
if (s_libusb_hotplug_enabled) 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; s_libusb_hotplug_enabled = false;
if (s_libusb_hotplug_enabled) if (s_libusb_hotplug_enabled)
NOTICE_LOG(SERIALINTERFACE, "Using libUSB hotplug detection"); NOTICE_LOG(SERIALINTERFACE, "Using libUSB hotplug detection");

View File

@ -540,7 +540,7 @@ bool WiimoteWindows::ConnectInternal()
if (m_dev_handle == INVALID_HANDLE_VALUE) if (m_dev_handle == INVALID_HANDLE_VALUE)
{ {
m_dev_handle = 0; m_dev_handle = nullptr;
return false; return false;
} }
@ -591,7 +591,7 @@ void WiimoteWindows::DisconnectInternal()
return; return;
CloseHandle(m_dev_handle); CloseHandle(m_dev_handle);
m_dev_handle = 0; m_dev_handle = nullptr;
#ifdef SHARE_WRITE_WIIMOTES #ifdef SHARE_WRITE_WIIMOTES
std::lock_guard<std::mutex> lk(g_connected_wiimotes_lock); std::lock_guard<std::mutex> lk(g_connected_wiimotes_lock);
@ -601,7 +601,7 @@ void WiimoteWindows::DisconnectInternal()
WiimoteWindows::WiimoteWindows(const std::basic_string<TCHAR>& path) : m_devicepath(path) WiimoteWindows::WiimoteWindows(const std::basic_string<TCHAR>& path) : m_devicepath(path)
{ {
m_dev_handle = 0; m_dev_handle = nullptr;
m_stack = MSBT_STACK_UNKNOWN; m_stack = MSBT_STACK_UNKNOWN;
m_hid_overlap_read = OVERLAPPED(); m_hid_overlap_read = OVERLAPPED();
@ -620,7 +620,7 @@ WiimoteWindows::~WiimoteWindows()
bool WiimoteWindows::IsConnected() const bool WiimoteWindows::IsConnected() const
{ {
return m_dev_handle != 0; return m_dev_handle != nullptr;
} }
// positive = read packet // positive = read packet

View File

@ -244,7 +244,7 @@ void WiiSocket::Update(bool read, bool write, bool except)
} }
else else
{ {
int ret = (s32)accept(fd, nullptr, 0); int ret = (s32)accept(fd, nullptr, nullptr);
ReturnValue = WiiSockMan::GetNetErrorCode(ret, "SO_ACCEPT", true); ReturnValue = WiiSockMan::GetNetErrorCode(ret, "SO_ACCEPT", true);
} }

View File

@ -57,7 +57,7 @@ LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs)
} }
case EXCEPTION_STACK_OVERFLOW: case EXCEPTION_STACK_OVERFLOW:
MessageBox(0, _T("Stack overflow!"), 0,0); MessageBox(nullptr, _T("Stack overflow!"), nullptr, 0);
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
case EXCEPTION_ILLEGAL_INSTRUCTION: case EXCEPTION_ILLEGAL_INSTRUCTION:

View File

@ -231,7 +231,7 @@ unsigned int NetPlayServer::OnConnect(ENetPeer* socket)
ENetPacket* epack; ENetPacket* epack;
do do
{ {
epack = enet_peer_receive(socket, 0); epack = enet_peer_receive(socket, nullptr);
} while (epack == nullptr); } while (epack == nullptr);
rpac.append(epack->data, epack->dataLength); rpac.append(epack->data, epack->dataLength);