diff options
author | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2024-08-27 13:30:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2024-08-27 14:56:38 (GMT) |
commit | 58da4aa47df7d12c54c2d3f26722eca5dd8ee10f (patch) | |
tree | c5d9bf243c3ec1526fd9e171f28d581a6af57e70 /Source/cmVSSetupHelper.h | |
parent | 72607d3402b91c3a9f4579c86175e4ca1ce6aa4e (diff) | |
download | CMake-58da4aa47df7d12c54c2d3f26722eca5dd8ee10f.zip CMake-58da4aa47df7d12c54c2d3f26722eca5dd8ee10f.tar.gz CMake-58da4aa47df7d12c54c2d3f26722eca5dd8ee10f.tar.bz2 |
Source: Avoid comparing pointers to nullptr
Diffstat (limited to 'Source/cmVSSetupHelper.h')
-rw-r--r-- | Source/cmVSSetupHelper.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h index b8be9b9..cc4d696 100644 --- a/Source/cmVSSetupHelper.h +++ b/Source/cmVSSetupHelper.h @@ -21,14 +21,14 @@ public: SmartCOMPtr(T* p) { ptr = p; - if (ptr != nullptr) { + if (ptr) { ptr->AddRef(); } } SmartCOMPtr(const SmartCOMPtr<T>& sptr) { ptr = sptr.ptr; - if (ptr != nullptr) { + if (ptr) { ptr->AddRef(); } } @@ -38,7 +38,7 @@ public: { if (*this != p) { ptr = p; - if (ptr != nullptr) { + if (ptr) { ptr->AddRef(); } } @@ -48,7 +48,7 @@ public: template <class I> HRESULT QueryInterface(REFCLSID rclsid, I** pp) { - if (pp != nullptr) { + if (pp) { return ptr->QueryInterface(rclsid, (void**)pp); } return E_FAIL; @@ -62,7 +62,7 @@ public: } ~SmartCOMPtr() { - if (ptr != nullptr) { + if (ptr) { ptr->Release(); } } |