diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/WhenWasIt/src/utils.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/WhenWasIt/src/utils.cpp')
-rw-r--r-- | plugins/WhenWasIt/src/utils.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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);
}
|