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/WhenWasIt/src/utils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/WhenWasIt/src/utils.cpp') diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 2b1a8e3551..c77578adee 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -39,7 +39,7 @@ int Log(char *format, ...) if (!fout) return -1; - time_t tNow = time(NULL); + time_t tNow = time(nullptr); struct tm *now = localtime(&tNow); strftime(str, sizeof(str), "%d %b %Y @ %H:%M:%S: ", now); fputs(str, fout); @@ -68,14 +68,14 @@ int Info(char *title, char *format, ...) if (tBytes > 0) str[tBytes] = 0; va_end(vararg); - return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION); + return MessageBoxA(nullptr, str, title, MB_OK | MB_ICONINFORMATION); } #define HEX_SIZE 8 char* BinToHex(int size, PBYTE data) { - char *szresult = NULL; + char *szresult = nullptr; char buffer[32] = { 0 }; //should be more than enough int maxSize = size * 2 + HEX_SIZE + 1; szresult = (char *) new char[maxSize]; @@ -140,13 +140,13 @@ int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, si wchar_t* GetContactID(MCONTACT hContact) { - return GetContactID(hContact, NULL); + return GetContactID(hContact, nullptr); } wchar_t* GetContactID(MCONTACT hContact, char *szProto) { ptrW res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto)); - return (res) ? wcsdup(res) : NULL; + return (res) ? wcsdup(res) : nullptr; } MCONTACT GetContactFromID(wchar_t *szID, char *szProto) @@ -167,7 +167,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto) MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto) { char protocol[1024]; - WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), nullptr, nullptr); return GetContactFromID(szID, protocol); } -- cgit v1.2.3