From 40350b13714bed9c76d8bb0991c490b2ee14fe05 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Tue, 30 Mar 2010 17:29:27 +0000 Subject: Minor C++ fixes found by Clang. In cases where I've added an #include, it's generally due to Clang being more picky about templates being available during expansions. Review URL: http://codereview.chromium.org/1432003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43098 0039d316-1c4b-4281-b951-d872f2087c98 --- base/process_util_posix.cc | 8 ++++---- base/tuple_unittest.cc | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'base') diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index 25428fd..ec5f06c 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -221,12 +221,12 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { const int fd = static_cast(i); if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO) continue; - InjectiveMultimap::const_iterator i; - for (i = saved_mapping.begin(); i != saved_mapping.end(); i++) { - if (fd == i->dest) + InjectiveMultimap::const_iterator j; + for (j = saved_mapping.begin(); j != saved_mapping.end(); j++) { + if (fd == j->dest) break; } - if (i != saved_mapping.end()) + if (j != saved_mapping.end()) continue; // Since we're just trying to close anything we can find, diff --git a/base/tuple_unittest.cc b/base/tuple_unittest.cc index 65a3757..402394c 100644 --- a/base/tuple_unittest.cc +++ b/base/tuple_unittest.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "base/tuple.h" + +#include "base/compiler_specific.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -28,7 +30,7 @@ struct Addz { } // namespace TEST(TupleTest, Basic) { - Tuple0 t0 = MakeTuple(); + Tuple0 t0 ALLOW_UNUSED = MakeTuple(); Tuple1 t1(1); Tuple2 t2 = MakeTuple(1, static_cast("wee")); Tuple3 t3(1, 2, 3); -- cgit v1.1