From a7c24ca48995cf2bf436156302f96b91bf135409 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Mon, 13 Nov 2017 15:03:31 +0100 Subject: Code modernize ... * replace 0/NULL with nullptr [using clang-tidy] --- plugins/MimCmd/src/MimCmd.cpp | 2 +- plugins/MimCmd/src/commands.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/MimCmd/src') diff --git a/plugins/MimCmd/src/MimCmd.cpp b/plugins/MimCmd/src/MimCmd.cpp index f4cfed40e2..88d2dcd2db 100644 --- a/plugins/MimCmd/src/MimCmd.cpp +++ b/plugins/MimCmd/src/MimCmd.cpp @@ -37,7 +37,7 @@ int lpprintf(const char *format, ...) char* GetProgramName(char *programName, int size) { char name[512]; - GetModuleFileNameA(GetModuleHandle(NULL), name, sizeof(name)); + GetModuleFileNameA(GetModuleHandle(nullptr), name, sizeof(name)); char *p = strrchr(name, '\\'); if (p) strncpy_s(programName, size, p + 1, _TRUNCATE); diff --git a/plugins/MimCmd/src/commands.cpp b/plugins/MimCmd/src/commands.cpp index d066dab4af..db79ddbe7c 100644 --- a/plugins/MimCmd/src/commands.cpp +++ b/plugins/MimCmd/src/commands.cpp @@ -20,12 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -LISTCOMMANDS ListCommands = NULL; +LISTCOMMANDS ListCommands = nullptr; -PCommand knownCommands = NULL; +PCommand knownCommands = nullptr; int cKnownCommands = 0; -HMODULE hCmdLineDLL = NULL; +HMODULE hCmdLineDLL = nullptr; char *GetMirandaFolder(char *mimFolder, int size) { @@ -36,14 +36,14 @@ char *GetMirandaFolder(char *mimFolder, int size) int ConnectToMiranda() { wchar_t tszPath[MAX_PATH]; - GetModuleFileName(NULL, tszPath, _countof(tszPath)); + GetModuleFileName(nullptr, tszPath, _countof(tszPath)); wchar_t *p = wcsrchr(tszPath, '\\'); if (p) p[1] = 0; wcsncat_s(tszPath, L"libs", _TRUNCATE); DWORD cbPath = (DWORD)wcslen(tszPath); - DWORD cbSize = GetEnvironmentVariable(L"PATH", NULL, 0); + DWORD cbSize = GetEnvironmentVariable(L"PATH", nullptr, 0); wchar_t *ptszVal = new wchar_t[cbSize + MAX_PATH + 2]; wcscpy(ptszVal, tszPath); wcscat(ptszVal, L";"); @@ -55,7 +55,7 @@ int ConnectToMiranda() GetMirandaFolder(pluginPath, sizeof(pluginPath)); mir_strcat(pluginPath, "\\plugins\\cmdline.dll"); - ListCommands = NULL; + ListCommands = nullptr; hCmdLineDLL = LoadLibraryA(pluginPath); @@ -77,7 +77,7 @@ int DisconnectFromMiranda() int GetKnownCommands() { ListCommands(&knownCommands, &cKnownCommands); - return (knownCommands == NULL); + return (knownCommands == nullptr); } int DestroyKnownCommands() @@ -102,7 +102,7 @@ PCommand GetCommand(char *command) if (knownCommands[i].ID == MIMCMD_HELP) return &knownCommands[i]; - return NULL; + return nullptr; } void HandleHelpCommand(PCommand, char *argv[], int argc, PReply reply) @@ -139,7 +139,7 @@ PReply ParseCommand(char *argv[], int argc) { PCommand command = GetCommand(argv[1]); if (!command) - return NULL; + return nullptr; PReply reply = &sdCmdLine->reply; if (command->ID == MIMCMD_HELP) -- cgit v1.2.3