drop std:: qualifiers on more stl datatypes
authorEvan Martin <martine@danga.com>
Thu, 18 Apr 2013 18:27:20 +0000 (11:27 -0700)
committerEvan Martin <martine@danga.com>
Thu, 18 Apr 2013 18:27:24 +0000 (11:27 -0700)
We "using namespace std" anywhere we need a std::string or a std::vector.

src/build.h
src/edit_distance.cc
src/line_printer.cc
src/line_printer.h
src/manifest_parser_test.cc
src/ninja_test.cc
src/util_test.cc

index 5cbd2a6..2715c0c 100644 (file)
@@ -268,7 +268,7 @@ struct BuildStatus {
     double rate_;
     Stopwatch stopwatch_;
     const size_t N;
-    std::queue<double> times_;
+    queue<double> times_;
     int last_update_;
   };
 
@@ -277,4 +277,3 @@ struct BuildStatus {
 };
 
 #endif  // NINJA_BUILD_H_
-
index 22db4fe..cc4483f 100644 (file)
@@ -32,8 +32,8 @@ int EditDistance(const StringPiece& s1,
   int m = s1.len_;
   int n = s2.len_;
 
-  std::vector<int> previous(n + 1);
-  std::vector<int> current(n + 1);
+  vector<int> previous(n + 1);
+  vector<int> current(n + 1);
 
   for (int i = 0; i <= n; ++i)
     previous[i] = i;
index 751fb07..a75eb05 100644 (file)
@@ -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);
index 4226c92..c292464 100644 (file)
@@ -16,6 +16,7 @@
 #define NINJA_LINE_PRINTER_H_
 
 #include <string>
+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.
index 76d235d..be749f2 100644 (file)
@@ -701,7 +701,7 @@ TEST_F(ParserTest, DefaultStatements) {
 "default $third\n"));
 
   string err;
-  std::vector<Node*> nodes = state.DefaultNodes(&err);
+  vector<Node*> nodes = state.DefaultNodes(&err);
   EXPECT_EQ("", err);
   ASSERT_EQ(3u, nodes.size());
   EXPECT_EQ("a", nodes[0]->path());
index f091cc8..31754f2 100644 (file)
@@ -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];
 
index 4776546..1e29053 100644 (file)
@@ -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);