summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christopher Wiley <wiley@google.com> 2015-08-24 14:07:32 -0700
committer Christopher Wiley <wiley@google.com> 2015-08-24 14:28:36 -0700
commit1eaa9ed33488bbc8fe3d9185fd053e5aa1246681 (patch)
tree936c45c175fc992885768e9fcf290221b2cde63b
parent582d16681bf46eb2f11c24132ffbcd9f7cc4b74d (diff)
Do not merge namespaces
It is good practice to not include the whole std:: namespace into the global namespace. This is doubly true in headers. TEST=aidl compiles Change-Id: I910ca8082f61cce4f23f8564b8a12c2828b75b3c
-rw-r--r--tools/aidl/AST.h4
-rw-r--r--tools/aidl/Type.h3
-rw-r--r--tools/aidl/aidl.cpp5
-rw-r--r--tools/aidl/generate_java.h3
-rw-r--r--tools/aidl/options.h3
-rw-r--r--tools/aidl/options_test.cpp3
-rw-r--r--tools/aidl/search_path.h5
7 files changed, 19 insertions, 7 deletions
diff --git a/tools/aidl/AST.h b/tools/aidl/AST.h
index ead5e7ae3439..8eaf0adea775 100644
--- a/tools/aidl/AST.h
+++ b/tools/aidl/AST.h
@@ -7,7 +7,9 @@
#include <stdarg.h>
#include <stdio.h>
-using namespace std;
+using std::set;
+using std::string;
+using std::vector;
class Type;
diff --git a/tools/aidl/Type.h b/tools/aidl/Type.h
index ae12720142e8..dfb80accc49e 100644
--- a/tools/aidl/Type.h
+++ b/tools/aidl/Type.h
@@ -5,7 +5,8 @@
#include <string>
#include <vector>
-using namespace std;
+using std::string;
+using std::vector;
class Type
{
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp
index 438007f527d5..2d8f0acf8bb5 100644
--- a/tools/aidl/aidl.cpp
+++ b/tools/aidl/aidl.cpp
@@ -31,7 +31,10 @@
#define MIN_USER_SET_METHOD_ID 0
#define MAX_USER_SET_METHOD_ID 16777214
-using namespace std;
+using std::map;
+using std::set;
+using std::string;
+using std::vector;
static void
test_document(document_item_type* d)
diff --git a/tools/aidl/generate_java.h b/tools/aidl/generate_java.h
index 4bfcfeba07c8..be32364410a3 100644
--- a/tools/aidl/generate_java.h
+++ b/tools/aidl/generate_java.h
@@ -6,7 +6,8 @@
#include <string>
-using namespace std;
+using std::string;
+using std::vector;
int generate_java(const string& filename, const string& originalSrc,
interface_type* iface);
diff --git a/tools/aidl/options.h b/tools/aidl/options.h
index 387e37d08732..53ac47813dce 100644
--- a/tools/aidl/options.h
+++ b/tools/aidl/options.h
@@ -5,7 +5,8 @@
#include <string>
#include <vector>
-using namespace std;
+using std::string;
+using std::vector;
enum {
COMPILE_AIDL,
diff --git a/tools/aidl/options_test.cpp b/tools/aidl/options_test.cpp
index bd106ce54f2d..7ac527dc9e4f 100644
--- a/tools/aidl/options_test.cpp
+++ b/tools/aidl/options_test.cpp
@@ -3,7 +3,8 @@
const bool VERBOSE = false;
-using namespace std;
+using std::string;
+using std::vector;
struct Answer {
const char* argv[8];
diff --git a/tools/aidl/search_path.h b/tools/aidl/search_path.h
index 2bf94b12bbf1..9dd199ebf886 100644
--- a/tools/aidl/search_path.h
+++ b/tools/aidl/search_path.h
@@ -6,7 +6,10 @@
#if __cplusplus
#include <vector>
#include <string>
-using namespace std;
+
+using std::string;
+using std::vector;
+
extern "C" {
#endif