diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 19:24:42 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 19:24:42 +0000 |
commit | d22d873921f2f657b483a01a398ddce3001747a1 (patch) | |
tree | 4190718501c4cae47302ea1a8be8ee7b6f4c41cd /base | |
parent | 30cf2bf9a44e5f97ddd497113bce74feb6b4b517 (diff) | |
download | chromium_src-d22d873921f2f657b483a01a398ddce3001747a1.zip chromium_src-d22d873921f2f657b483a01a398ddce3001747a1.tar.gz chromium_src-d22d873921f2f657b483a01a398ddce3001747a1.tar.bz2 |
Fix various uses of release() that did not check its value
BUG=42904
TEST=compile, unit tests
Review URL: http://codereview.chromium.org/1730024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46376 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/basictypes.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/base/basictypes.h b/base/basictypes.h index f6b92ec..e7d79a5 100644 --- a/base/basictypes.h +++ b/base/basictypes.h @@ -333,10 +333,11 @@ inline Dest bit_cast(const Source& source) { // // scoped_ptr<MyType> my_var = ...; // if (TakeOwnership(my_var.get()) == SUCCESS) -// IGNORE_RESULT(my_var.release()); +// ignore_result(my_var.release()); // -#define IGNORE_RESULT(x) \ - do { size_t unused = sizeof(x); unused = 0; } while (false) +template<typename T> +inline void ignore_result(const T& ignored) { +} // The following enum should be used only as a constructor argument to indicate // that the variable has static storage class, and that the constructor should |