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/dynamic.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/dynamic.cpp') 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(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; -- cgit v1.3.1-10-gc9f91