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/AvatarHistory/src/utils.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/AvatarHistory/src/utils.cpp')
-rw-r--r-- | plugins/AvatarHistory/src/utils.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 30f756839b..71214413a2 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -74,9 +74,9 @@ void ConvertToFilename(wchar_t *str, size_t size) wchar_t* GetExtension(wchar_t *file)
{
- if (file == NULL) return L"";
+ if (file == nullptr) return L"";
wchar_t *ext = wcsrchr(file, '.');
- if (ext != NULL)
+ if (ext != nullptr)
ext++;
else
ext = L"";
@@ -86,7 +86,7 @@ wchar_t* GetExtension(wchar_t *file) wchar_t* GetHistoryFolder(wchar_t *fn)
{
- if (fn == NULL) return NULL;
+ if (fn == nullptr) return nullptr;
FoldersGetCustomPathT(hFolder, fn, MAX_PATH, basedir);
CreateDirectoryTreeW(fn);
return fn;
@@ -96,7 +96,7 @@ wchar_t* GetProtocolFolder(wchar_t *fn, char *proto) {
GetHistoryFolder(fn);
- if (proto == NULL)
+ if (proto == nullptr)
proto = Translate("Unknown protocol");
mir_snwprintf(fn, MAX_PATH, L"%s\\%S", fn, proto);
@@ -163,7 +163,7 @@ BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file) wchar_t* GetCachedAvatar(char *proto, wchar_t *hash)
{
- wchar_t *ret = NULL;
+ wchar_t *ret = nullptr;
wchar_t file[1024] = L"";
wchar_t search[1024] = L"";
if (opts.log_keep_same_folder)
@@ -176,7 +176,7 @@ wchar_t* GetCachedAvatar(char *proto, wchar_t *hash) WIN32_FIND_DATA finddata;
HANDLE hFind = FindFirstFile(search, &finddata);
if (hFind == INVALID_HANDLE_VALUE)
- return NULL;
+ return nullptr;
do {
size_t len = mir_wstrlen(finddata.cFileName);
@@ -198,12 +198,12 @@ wchar_t* GetCachedAvatar(char *proto, wchar_t *hash) BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut)
{
- IShellLink *psl = NULL;
- HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl);
+ IShellLink *psl = nullptr;
+ HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl);
if (SUCCEEDED(hr)) {
psl->SetPath(file);
- IPersistFile *ppf = NULL;
+ IPersistFile *ppf = nullptr;
hr = psl->QueryInterface(IID_IPersistFile, (void **)&ppf);
if (SUCCEEDED(hr)) {
hr = ppf->Save(shortcut, TRUE);
@@ -218,18 +218,18 @@ BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut) BOOL ResolveShortcut(wchar_t *shortcut, wchar_t *file)
{
- IShellLink* psl = NULL;
+ IShellLink* psl = nullptr;
- HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl);
+ HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl);
if (SUCCEEDED(hr)) {
- IPersistFile* ppf = NULL;
+ IPersistFile* ppf = nullptr;
hr = psl->QueryInterface(IID_IPersistFile, (void **)&ppf);
if (SUCCEEDED(hr)) {
hr = ppf->Load(shortcut, STGM_READ);
if (SUCCEEDED(hr)) {
- hr = psl->Resolve(NULL, SLR_UPDATE);
+ hr = psl->Resolve(nullptr, SLR_UPDATE);
if (SUCCEEDED(hr)) {
WIN32_FIND_DATA wfd;
hr = psl->GetPath(file, MAX_PATH, &wfd, SLGP_RAWPATH);
|