Use `nullptr` where it's possible
authorAndrey Okoshkin <a.okoshkin@samsung.com>
Thu, 8 Feb 2018 08:44:10 +0000 (11:44 +0300)
committerAndrey Okoshkin <a.okoshkin@samsung.com>
Thu, 8 Feb 2018 08:44:10 +0000 (11:44 +0300)
DereferenceAndUnboxValue(), PrintEnumValue(), PrintValue() and
Evaluator::WalkMembers() use `nullptr` instead of `NULL`.

src/debug/netcoredbg/valueprint.cpp
src/debug/netcoredbg/valueprint.h
src/debug/netcoredbg/valuewalk.cpp

index 46c378a..dfccac0 100644 (file)
@@ -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<ICorDebugReferenceValue> 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<ICorDebugValue> pValue;
-    IfFailRet(DereferenceAndUnboxValue(pInputValue, &pValue, NULL));
+    IfFailRet(DereferenceAndUnboxValue(pInputValue, &pValue, nullptr));
 
     mdTypeDef currentTypeDef;
     ToRelease<ICorDebugClass> pClass;
@@ -531,7 +531,7 @@ HRESULT PrintValue(ICorDebugValue *pInputValue, std::string &output, bool escape
     ULONG32 cbSize;
     IfFailRet(pValue->GetSize(&cbSize));
     ArrayHolder<BYTE> rgbValue = new (std::nothrow) BYTE[cbSize];
-    if (rgbValue == NULL)
+    if (rgbValue == nullptr)
     {
         return E_OUTOFMEMORY;
     }
index 1acad2c..34c43d2 100644 (file)
@@ -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);
index 8dad61d..da330ce 100644 (file)
@@ -549,7 +549,7 @@ HRESULT Evaluator::WalkMembers(
     ToRelease<ICorDebugType> pType;
     ToRelease<ICorDebugModule> pModule;
     IfFailRet(pValue->QueryInterface(IID_ICorDebugValue2, (LPVOID *) &pValue2));
-    if(pTypeCast == NULL)
+    if(pTypeCast == nullptr)
         IfFailRet(pValue2->GetExactType(&pType));
     else
     {