diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 04:28:52 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 04:28:52 +0000 |
commit | cec36a7bfa7411a4992820ce8639310b2b426eeb (patch) | |
tree | 1fe0819019c3140e40ed153ceaee5b773095dba8 /base | |
parent | 3f812633db95e933db035aab0fa2a237bdd8c20a (diff) | |
download | chromium_src-cec36a7bfa7411a4992820ce8639310b2b426eeb.zip chromium_src-cec36a7bfa7411a4992820ce8639310b2b426eeb.tar.gz chromium_src-cec36a7bfa7411a4992820ce8639310b2b426eeb.tar.bz2 |
Make ScopedGenericObj compile with strict warnings when used with non-pointers.
No intended functionality change. Required for a future clang roll.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10310183
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/memory/scoped_generic_obj.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/base/memory/scoped_generic_obj.h b/base/memory/scoped_generic_obj.h index f266bb8..b4f28cf 100644 --- a/base/memory/scoped_generic_obj.h +++ b/base/memory/scoped_generic_obj.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,7 +41,7 @@ class ScopedGenericObj { // There is no way to create an uninitialized ScopedGenericObj. // The input parameter must be allocated with an allocator that matches the // Free functor. - explicit ScopedGenericObj(C p = NULL): obj_(p) {} + explicit ScopedGenericObj(C p = C()): obj_(p) {} // Destructor. If there is a C object, call the Free functor. ~ScopedGenericObj() { @@ -51,7 +51,7 @@ class ScopedGenericObj { // Reset. Calls the Free functor on the current owned object, if any. // Then takes ownership of a new object, if given. // this->reset(this->get()) works. - void reset(C p = NULL) { + void reset(C p = C()) { if (obj_ != p) { FreeProc free_proc; free_proc(obj_); |