aboutsummaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-07-22 18:33:38 +0100
committerGravatar Sadie Powell2022-07-22 18:53:21 +0100
commit648f813f8c89e6e7d0ed5bda2c2149bee2babb09 (patch)
tree5357669e57bb381c80bfdbd24ed4057a99db8e5b /src/socketengine.cpp
parentUpdate author list. (diff)
Switch from NULL to nullptr.
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp8
1 files changed, 4 insertions, 4 deletions
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<unsigned int>(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;