From 648f813f8c89e6e7d0ed5bda2c2149bee2babb09 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 22 Jul 2022 18:33:38 +0100 Subject: Switch from NULL to nullptr. --- src/socketengine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/socketengine.cpp') diff --git a/src/socketengine.cpp b/src/socketengine.cpp index a63ea4c0b..e5c111e68 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -163,20 +163,20 @@ void SocketEngine::DelFdRef(EventHandler *eh) int fd = eh->GetFd(); if (GetRef(fd) == eh) { - ref[fd] = NULL; + ref[fd] = nullptr; CurrentSetSize--; } } bool SocketEngine::HasFd(int fd) { - return GetRef(fd) != NULL; + return GetRef(fd) != nullptr; } EventHandler* SocketEngine::GetRef(int fd) { if (fd < 0 || static_cast(fd) >= ref.size()) - return NULL; + return nullptr; return ref[fd]; } @@ -369,7 +369,7 @@ std::string SocketEngine::LastError() #else char szErrorString[500]; DWORD dwErrorCode = WSAGetLastError(); - if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)szErrorString, _countof(szErrorString), NULL) == 0) + if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)szErrorString, _countof(szErrorString), nullptr) == 0) sprintf_s(szErrorString, _countof(szErrorString), "Error code: %u", dwErrorCode); std::string::size_type p; -- cgit v1.3.1-10-gc9f91