From 9c5aded8743ebac5c4f76a26e7fface04058bcda Mon Sep 17 00:00:00 2001 From: Tetsuo Kiso Date: Sun, 10 Jan 2016 05:23:35 -0800 Subject: [PATCH] Remove unnecessary `std::` --- src/includes_normalize_test.cc | 10 +++++----- src/ninja.cc | 4 ++-- src/subprocess-win32.cc | 2 +- src/subprocess_test.cc | 4 ++-- src/test.cc | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/includes_normalize_test.cc b/src/includes_normalize_test.cc index aba25d0..f18795c 100644 --- a/src/includes_normalize_test.cc +++ b/src/includes_normalize_test.cc @@ -30,15 +30,15 @@ string GetCurDir() { return parts[parts.size() - 1]; } -string NormalizeAndCheckNoError(const std::string& input) { +string NormalizeAndCheckNoError(const string& input) { string result, err; EXPECT_TRUE(IncludesNormalize::Normalize(input.c_str(), NULL, &result, &err)); EXPECT_EQ("", err); return result; } -string NormalizeRelativeAndCheckNoError(const std::string& input, - const std::string& relative_to) { +string NormalizeRelativeAndCheckNoError(const string& input, + const string& relative_to) { string result, err; EXPECT_TRUE(IncludesNormalize::Normalize(input.c_str(), relative_to.c_str(), &result, &err)); @@ -160,8 +160,8 @@ TEST(IncludesNormalize, LongInvalidPath) { "012345678\\" "012345678\\" "0123456789"; - std::string forward_slashes(kExactlyMaxPath); - std::replace(forward_slashes.begin(), forward_slashes.end(), '\\', '/'); + string forward_slashes(kExactlyMaxPath); + replace(forward_slashes.begin(), forward_slashes.end(), '\\', '/'); // Make sure a path that's exactly _MAX_PATH long is canonicalized. EXPECT_EQ(forward_slashes, NormalizeAndCheckNoError(kExactlyMaxPath)); diff --git a/src/ninja.cc b/src/ninja.cc index a73f83c..691afad 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -701,7 +701,7 @@ int NinjaMain::ToolUrtle(int argc, char** argv) { if ('0' <= *p && *p <= '9') { count = count*10 + *p - '0'; } else { - for (int i = 0; i < std::max(count, 1); ++i) + for (int i = 0; i < max(count, 1); ++i) printf("%c", *p); count = 0; } @@ -1163,7 +1163,7 @@ int main(int argc, char** argv) { #if defined(_MSC_VER) // Set a handler to catch crashes not caught by the __try..__except // block (e.g. an exception in a stack-unwind-block). - std::set_terminate(TerminateHandler); + set_terminate(TerminateHandler); __try { // Running inside __try ... __except suppresses any Windows error // dialogs for errors such as bad_alloc. diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc index fad66e8..4bab719 100644 --- a/src/subprocess-win32.cc +++ b/src/subprocess-win32.cc @@ -255,7 +255,7 @@ bool SubprocessSet::DoWork() { if (subproc->Done()) { vector::iterator end = - std::remove(running_.begin(), running_.end(), subproc); + remove(running_.begin(), running_.end(), subproc); if (running_.end() != end) { finished_.push(subproc); running_.resize(end - running_.begin()); diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc index 066bbb7..2fe4bce 100644 --- a/src/subprocess_test.cc +++ b/src/subprocess_test.cc @@ -159,8 +159,8 @@ TEST_F(SubprocessTest, Console) { // Test that stdin, stdout and stderr are a terminal. // Also check that the current process is connected to a terminal. Subprocess* subproc = - subprocs_.Add(std::string("test -t 0 -a -t 1 -a -t 2 && ") + - std::string(kIsConnectedToTerminal), + subprocs_.Add(string("test -t 0 -a -t 1 -a -t 2 && ") + + string(kIsConnectedToTerminal), /*use_console=*/true); ASSERT_NE((Subprocess*)0, subproc); diff --git a/src/test.cc b/src/test.cc index aed8db7..d231b90 100644 --- a/src/test.cc +++ b/src/test.cc @@ -115,7 +115,7 @@ void VerifyGraph(const State& state) { for (vector::const_iterator in_node = (*e)->inputs_.begin(); in_node != (*e)->inputs_.end(); ++in_node) { const vector& out_edges = (*in_node)->out_edges(); - EXPECT_NE(std::find(out_edges.begin(), out_edges.end(), *e), + EXPECT_NE(find(out_edges.begin(), out_edges.end(), *e), out_edges.end()); } // Check that the edge's outputs have the edge as in-edge. -- 2.7.4