From 9b6b1fd44a589c3725947280ff5a2ce8fc50a387 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Thu, 18 Apr 2013 11:27:20 -0700 Subject: drop std:: qualifiers on more stl datatypes We "using namespace std" anywhere we need a std::string or a std::vector. --- src/build.h | 3 +-- src/edit_distance.cc | 4 ++-- src/line_printer.cc | 2 +- src/line_printer.h | 5 +++-- src/manifest_parser_test.cc | 2 +- src/ninja_test.cc | 2 +- src/util_test.cc | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/build.h b/src/build.h index 5cbd2a6..2715c0c 100644 --- a/src/build.h +++ b/src/build.h @@ -268,7 +268,7 @@ struct BuildStatus { double rate_; Stopwatch stopwatch_; const size_t N; - std::queue times_; + queue times_; int last_update_; }; @@ -277,4 +277,3 @@ struct BuildStatus { }; #endif // NINJA_BUILD_H_ - diff --git a/src/edit_distance.cc b/src/edit_distance.cc index 22db4fe..cc4483f 100644 --- a/src/edit_distance.cc +++ b/src/edit_distance.cc @@ -32,8 +32,8 @@ int EditDistance(const StringPiece& s1, int m = s1.len_; int n = s2.len_; - std::vector previous(n + 1); - std::vector current(n + 1); + vector previous(n + 1); + vector current(n + 1); for (int i = 0; i <= n; ++i) previous[i] = i; diff --git a/src/line_printer.cc b/src/line_printer.cc index 751fb07..a75eb05 100644 --- a/src/line_printer.cc +++ b/src/line_printer.cc @@ -42,7 +42,7 @@ LinePrinter::LinePrinter() : have_blank_line_(true) { #endif } -void LinePrinter::Print(std::string to_print, LineType type) { +void LinePrinter::Print(string to_print, LineType type) { #ifdef _WIN32 CONSOLE_SCREEN_BUFFER_INFO csbi; GetConsoleScreenBufferInfo(console_, &csbi); diff --git a/src/line_printer.h b/src/line_printer.h index 4226c92..c292464 100644 --- a/src/line_printer.h +++ b/src/line_printer.h @@ -16,6 +16,7 @@ #define NINJA_LINE_PRINTER_H_ #include +using namespace std; /// Prints lines of text, possibly overprinting previously printed lines /// if the terminal supports it. @@ -32,10 +33,10 @@ class LinePrinter { }; /// Overprints the current line. If type is ELIDE, elides to_print to fit on /// one line. - void Print(std::string to_print, LineType type); + void Print(string to_print, LineType type); /// Prints a string on a new line, not overprinting previous output. - void PrintOnNewLine(const std::string& to_print); + void PrintOnNewLine(const string& to_print); private: /// Whether we can do fancy terminal control codes. diff --git a/src/manifest_parser_test.cc b/src/manifest_parser_test.cc index 76d235d..be749f2 100644 --- a/src/manifest_parser_test.cc +++ b/src/manifest_parser_test.cc @@ -701,7 +701,7 @@ TEST_F(ParserTest, DefaultStatements) { "default $third\n")); string err; - std::vector nodes = state.DefaultNodes(&err); + vector nodes = state.DefaultNodes(&err); EXPECT_EQ("", err); ASSERT_EQ(3u, nodes.size()); EXPECT_EQ("a", nodes[0]->path()); diff --git a/src/ninja_test.cc b/src/ninja_test.cc index f091cc8..31754f2 100644 --- a/src/ninja_test.cc +++ b/src/ninja_test.cc @@ -18,7 +18,7 @@ #include "gtest/gtest.h" #include "line_printer.h" -std::string StringPrintf(const char* format, ...) { +string StringPrintf(const char* format, ...) { const int N = 1024; char buf[N]; diff --git a/src/util_test.cc b/src/util_test.cc index 4776546..1e29053 100644 --- a/src/util_test.cc +++ b/src/util_test.cc @@ -101,7 +101,7 @@ TEST(CanonicalizePath, EmptyResult) { } TEST(CanonicalizePath, UpDir) { - std::string path, err; + string path, err; path = "../../foo/bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("../../foo/bar.h", path); -- cgit v0.12