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/HistoryStats/src/mu_common.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/HistoryStats/src/mu_common.cpp')
-rw-r--r-- | plugins/HistoryStats/src/mu_common.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
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<wchar_t*>(szSection);
sid.description.w = const_cast<wchar_t*>(szDescription);
sid.pszName = const_cast<char*>(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<char*>(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<WCHAR*>(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;
|