From: Andrey Okoshkin Date: Thu, 8 Feb 2018 08:44:10 +0000 (+0300) Subject: Use `nullptr` where it's possible X-Git-Tag: submit/tizen/20180620.071641~19^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da85722857d7608534be62f327ed2ac705d29cf5;p=sdk%2Ftools%2Fnetcoredbg.git Use `nullptr` where it's possible DereferenceAndUnboxValue(), PrintEnumValue(), PrintValue() and Evaluator::WalkMembers() use `nullptr` instead of `NULL`. --- diff --git a/src/debug/netcoredbg/valueprint.cpp b/src/debug/netcoredbg/valueprint.cpp index 46c378a..dfccac0 100644 --- a/src/debug/netcoredbg/valueprint.cpp +++ b/src/debug/netcoredbg/valueprint.cpp @@ -23,8 +23,8 @@ HRESULT DereferenceAndUnboxValue(ICorDebugValue * pValue, ICorDebugValue** ppOutputValue, BOOL * pIsNull) { HRESULT Status = S_OK; - *ppOutputValue = NULL; - if (pIsNull != NULL) *pIsNull = FALSE; + *ppOutputValue = nullptr; + if (pIsNull != nullptr) *pIsNull = FALSE; ToRelease pReferenceValue; Status = pValue->QueryInterface(IID_ICorDebugReferenceValue, (LPVOID*) &pReferenceValue); @@ -40,7 +40,7 @@ HRESULT DereferenceAndUnboxValue(ICorDebugValue * pValue, ICorDebugValue** ppOut } else { - if(pIsNull != NULL) *pIsNull = TRUE; + if(pIsNull != nullptr) *pIsNull = TRUE; *ppOutputValue = pValue; (*ppOutputValue)->AddRef(); return S_OK; @@ -83,7 +83,7 @@ static HRESULT PrintEnumValue(ICorDebugValue* pInputValue, BYTE* enumValue, std: HRESULT Status = S_OK; ToRelease pValue; - IfFailRet(DereferenceAndUnboxValue(pInputValue, &pValue, NULL)); + IfFailRet(DereferenceAndUnboxValue(pInputValue, &pValue, nullptr)); mdTypeDef currentTypeDef; ToRelease pClass; @@ -531,7 +531,7 @@ HRESULT PrintValue(ICorDebugValue *pInputValue, std::string &output, bool escape ULONG32 cbSize; IfFailRet(pValue->GetSize(&cbSize)); ArrayHolder rgbValue = new (std::nothrow) BYTE[cbSize]; - if (rgbValue == NULL) + if (rgbValue == nullptr) { return E_OUTOFMEMORY; } diff --git a/src/debug/netcoredbg/valueprint.h b/src/debug/netcoredbg/valueprint.h index 1acad2c..34c43d2 100644 --- a/src/debug/netcoredbg/valueprint.h +++ b/src/debug/netcoredbg/valueprint.h @@ -3,4 +3,4 @@ // See the LICENSE file in the project root for more information. HRESULT PrintValue(ICorDebugValue *pInputValue, std::string &output, bool escape = true); -HRESULT DereferenceAndUnboxValue(ICorDebugValue * pValue, ICorDebugValue** ppOutputValue, BOOL * pIsNull = NULL); +HRESULT DereferenceAndUnboxValue(ICorDebugValue * pValue, ICorDebugValue** ppOutputValue, BOOL * pIsNull = nullptr); diff --git a/src/debug/netcoredbg/valuewalk.cpp b/src/debug/netcoredbg/valuewalk.cpp index 8dad61d..da330ce 100644 --- a/src/debug/netcoredbg/valuewalk.cpp +++ b/src/debug/netcoredbg/valuewalk.cpp @@ -549,7 +549,7 @@ HRESULT Evaluator::WalkMembers( ToRelease pType; ToRelease pModule; IfFailRet(pValue->QueryInterface(IID_ICorDebugValue2, (LPVOID *) &pValue2)); - if(pTypeCast == NULL) + if(pTypeCast == nullptr) IfFailRet(pValue2->GetExactType(&pType)); else {