Skip to content

Commit

Permalink
Merge pull request #3123 from lioncash/null
Browse files Browse the repository at this point in the history
Core: Replace 0 literals with nullptr
  • Loading branch information
phire committed Oct 3, 2015
2 parents ce6f89f + 0f6c465 commit bcee41b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Source/Core/Core/HW/BBA-TAP/TAP_Win32.cpp
Expand Up @@ -153,8 +153,8 @@ bool OpenTAP(HANDLE& adapter, const std::basic_string<TCHAR>& 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)
{
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/SI_GCAdapter.cpp
Expand Up @@ -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");
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Core/HW/WiimoteReal/IOWin.cpp
Expand Up @@ -540,7 +540,7 @@ bool WiimoteWindows::ConnectInternal()

if (m_dev_handle == INVALID_HANDLE_VALUE)
{
m_dev_handle = 0;
m_dev_handle = nullptr;
return false;
}

Expand Down Expand Up @@ -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<std::mutex> lk(g_connected_wiimotes_lock);
Expand All @@ -601,7 +601,7 @@ void WiimoteWindows::DisconnectInternal()

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_hid_overlap_read = OVERLAPPED();
Expand All @@ -620,7 +620,7 @@ WiimoteWindows::~WiimoteWindows()

bool WiimoteWindows::IsConnected() const
{
return m_dev_handle != 0;
return m_dev_handle != nullptr;
}

// positive = read packet
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/IPC_HLE/WII_Socket.cpp
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/MemTools.cpp
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/NetPlayServer.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit bcee41b

Please sign in to comment.