diff options
author | Underground78 <underground78@users.sourceforge.net> | 2013-05-07 23:51:09 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2013-05-09 16:57:30 +0400 |
commit | 2acb3c5749326e59f6f2c6f48692a32dc7e705f5 (patch) | |
tree | 4b6985d401ea648b1562c3b4a6bb868e61c5105d /src/DSUtil/text.cpp | |
parent | ae3db48090dc9837fbb439503075521e356dcfa7 (diff) |
Use nullptr instead of NULL whenever possible.
Microsoft recommends to avoid using NULL or zero (0) as a null pointer constant since nullptr is less vulnerable to misuse and works better in most situations.
Also fix some cases where NULL was used instead of 0 or FALSE.
Diffstat (limited to 'src/DSUtil/text.cpp')
-rw-r--r-- | src/DSUtil/text.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/DSUtil/text.cpp b/src/DSUtil/text.cpp index d91774d4d..961b930f1 100644 --- a/src/DSUtil/text.cpp +++ b/src/DSUtil/text.cpp @@ -58,8 +58,8 @@ CStringA ConvertMBCS(CStringA str, DWORD SrcCharSet, DWORD DstCharSet) len,
mbcs,
str.GetLength() * 6,
- NULL,
- NULL);
+ nullptr,
+ nullptr);
str = mbcs;
@@ -204,14 +204,14 @@ CString FormatNumber(CString szNumber, bool bNoFractionalDigits /*= true*/) {
CString ret;
- int nChars = GetNumberFormat(LOCALE_USER_DEFAULT, 0, szNumber, NULL, NULL, 0);
- GetNumberFormat(LOCALE_USER_DEFAULT, 0, szNumber, NULL, ret.GetBuffer(nChars), nChars);
+ int nChars = GetNumberFormat(LOCALE_USER_DEFAULT, 0, szNumber, nullptr, nullptr, 0);
+ GetNumberFormat(LOCALE_USER_DEFAULT, 0, szNumber, nullptr, ret.GetBuffer(nChars), nChars);
ret.ReleaseBuffer();
if (bNoFractionalDigits) {
TCHAR szNumberFractionalDigits[2] = {0};
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDIGITS, szNumberFractionalDigits, _countof(szNumberFractionalDigits));
- int nNumberFractionalDigits = _tcstol(szNumberFractionalDigits, NULL, 10);
+ int nNumberFractionalDigits = _tcstol(szNumberFractionalDigits, nullptr, 10);
if (nNumberFractionalDigits) {
ret.Truncate(ret.GetLength() - nNumberFractionalDigits - 1);
}
|