From 5d2b449b4f0b3d13c75e540c834c550ed38c0912 Mon Sep 17 00:00:00 2001 From: "mhm@chromium.org" Date: Tue, 1 Mar 2011 02:48:05 +0000 Subject: More DCHECK() updates. A mixture of _EQ and _GE. Bug=58409 Review URL: http://codereview.chromium.org/6469070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76343 0039d316-1c4b-4281-b951-d872f2087c98 --- base/win/scoped_bstr.cc | 2 +- base/win/scoped_comptr.h | 6 +++--- base/win/scoped_variant.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'base/win') diff --git a/base/win/scoped_bstr.cc b/base/win/scoped_bstr.cc index 18ffe6a..63ade0c 100644 --- a/base/win/scoped_bstr.cc +++ b/base/win/scoped_bstr.cc @@ -39,7 +39,7 @@ void ScopedBstr::Swap(ScopedBstr& bstr2) { } BSTR* ScopedBstr::Receive() { - DCHECK(bstr_ == NULL) << "BSTR leak."; + DCHECK(!bstr_) << "BSTR leak."; return &bstr_; } diff --git a/base/win/scoped_comptr.h b/base/win/scoped_comptr.h index 6375218..e508ef2 100644 --- a/base/win/scoped_comptr.h +++ b/base/win/scoped_comptr.h @@ -69,7 +69,7 @@ class ScopedComPtr : public scoped_refptr { // Accepts an interface pointer that has already been addref-ed. void Attach(Interface* p) { - DCHECK(ptr_ == NULL); + DCHECK(!ptr_); ptr_ = p; } @@ -78,7 +78,7 @@ class ScopedComPtr : public scoped_refptr { // The function DCHECKs on the current value being NULL. // Usage: Foo(p.Receive()); Interface** Receive() { - DCHECK(ptr_ == NULL) << "Object leak. Pointer must be NULL"; + DCHECK(!ptr_) << "Object leak. Pointer must be NULL"; return &ptr_; } @@ -114,7 +114,7 @@ class ScopedComPtr : public scoped_refptr { // Convenience wrapper around CoCreateInstance HRESULT CreateInstance(const CLSID& clsid, IUnknown* outer = NULL, DWORD context = CLSCTX_ALL) { - DCHECK(ptr_ == NULL); + DCHECK(!ptr_); HRESULT hr = ::CoCreateInstance(clsid, outer, context, *interface_id, reinterpret_cast(&ptr_)); return hr; diff --git a/base/win/scoped_variant.cc b/base/win/scoped_variant.cc index 40ccdf2..f57ab93 100644 --- a/base/win/scoped_variant.cc +++ b/base/win/scoped_variant.cc @@ -211,7 +211,7 @@ void ScopedVariant::Set(SAFEARRAY* array) { var_.vt |= VT_ARRAY; var_.parray = array; } else { - DCHECK(array == NULL) << "Unable to determine safearray vartype"; + DCHECK(!array) << "Unable to determine safearray vartype"; var_.vt = VT_EMPTY; } } -- cgit v1.1