aboutsummaryrefslogtreecommitdiff
path: root/src/dynamic.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/dynamic.cpp
parentUpdate author list. (diff)
Switch from NULL to nullptr.
Diffstat (limited to 'src/dynamic.cpp')
-rw-r--r--src/dynamic.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dynamic.cpp b/src/dynamic.cpp
index 94f93d4f4..6f1e5dce6 100644
--- a/src/dynamic.cpp
+++ b/src/dynamic.cpp
@@ -68,13 +68,13 @@ DLLManager::~DLLManager()
Module* DLLManager::CallInit()
{
if (!lib)
- return NULL;
+ return nullptr;
const unsigned long* abi = GetSymbol<const unsigned long>(MODULE_STR_ABI);
if (!abi)
{
err.assign(libname + " is not a module (no ABI symbol)");
- return NULL;
+ return nullptr;
}
else if (*abi != MODULE_ABI)
{
@@ -82,7 +82,7 @@ Module* DLLManager::CallInit()
err.assign(InspIRCd::Format("%s was built against %s (%lu) which is too %s to use with %s (%lu).",
libname.c_str(), version ? version : "an unknown version", *abi,
*abi < MODULE_ABI ? "old" : "new", INSPIRCD_VERSION, MODULE_ABI));
- return NULL;
+ return nullptr;
}
union
@@ -95,7 +95,7 @@ Module* DLLManager::CallInit()
if (!vptr)
{
err.assign(libname + " is not a module (no init symbol)");
- return NULL;
+ return nullptr;
}
return (*fptr)();
@@ -104,7 +104,7 @@ Module* DLLManager::CallInit()
void* DLLManager::GetSymbol(const char* name) const
{
if (!lib)
- return NULL;
+ return nullptr;
#if defined _WIN32
return GetProcAddress(lib, name);
@@ -118,7 +118,7 @@ void DLLManager::RetrieveLastError()
#if defined _WIN32
char errmsg[500];
DWORD dwErrorCode = GetLastError();
- if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)errmsg, _countof(errmsg), NULL) == 0)
+ if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)errmsg, _countof(errmsg), nullptr) == 0)
sprintf_s(errmsg, _countof(errmsg), "Error code: %u", dwErrorCode);
SetLastError(ERROR_SUCCESS);
err = errmsg;