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/HistoryStats/src/mu_common.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'plugins/HistoryStats/src/mu_common.cpp') diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 62c9e21bb0..212485233a 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -56,7 +56,7 @@ namespace mu void addIcon(const wchar_t* szSection, const wchar_t* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex) { - SKINICONDESC sid = { 0 }; + SKINICONDESC sid = {}; sid.section.w = const_cast(szSection); sid.description.w = const_cast(szDescription); sid.pszName = const_cast(szIconName); @@ -148,14 +148,14 @@ namespace mu char* wideToAnsiDup(const WCHAR* pszWide, UINT uCP /* = CP_ACP */) { if (!pszWide) - return NULL; + return nullptr; - int len = WideCharToMultiByte(uCP, 0, pszWide, -1, NULL, 0, NULL, NULL); + int len = WideCharToMultiByte(uCP, 0, pszWide, -1, nullptr, 0, nullptr, nullptr); char* result = reinterpret_cast(malloc(sizeof(char)* len)); if (!result) - return NULL; + return nullptr; - WideCharToMultiByte(uCP, 0, pszWide, -1, result, len, NULL, NULL); + WideCharToMultiByte(uCP, 0, pszWide, -1, result, len, nullptr, nullptr); result[len - 1] = 0; return result; } @@ -163,12 +163,12 @@ namespace mu WCHAR* ansiToWideDup(const char* pszAnsi, UINT uCP /* = CP_ACP */) { if (!pszAnsi) - return NULL; + return nullptr; - int len = MultiByteToWideChar(uCP, 0, pszAnsi, -1, NULL, 0); + int len = MultiByteToWideChar(uCP, 0, pszAnsi, -1, nullptr, 0); WCHAR* result = reinterpret_cast(malloc(sizeof(WCHAR)* len)); if (!result) - return NULL; + return nullptr; MultiByteToWideChar(uCP, 0, pszAnsi, -1, result, len); result[len - 1] = 0; @@ -178,16 +178,16 @@ namespace mu char* wideToAnsi(const WCHAR* pszWide, char* pszRes, int maxLen, UINT uCP /* = CP_ACP */) { if (!pszWide) - return NULL; + return nullptr; - WideCharToMultiByte(uCP, 0, pszWide, -1, pszRes, maxLen, NULL, NULL); + WideCharToMultiByte(uCP, 0, pszWide, -1, pszRes, maxLen, nullptr, nullptr); return pszRes; } WCHAR* ansiToWide(const char* pszAnsi, WCHAR* pszRes, int maxLen, UINT uCP /* = CP_ACP */) { if (!pszAnsi) - return NULL; + return nullptr; MultiByteToWideChar(uCP, 0, pszAnsi, -1, pszRes, maxLen); return pszRes; -- cgit v1.2.3