You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/02/04 03:13:28 UTC

[2/3] mesos git commit: Cleaned up usage of qualified identifiers in libprocess.

Cleaned up usage of qualified identifiers in libprocess.

For example, avoid using `std::string` in a `.cpp` file that already has
a using declaration: `using std::string`.

Review: https://reviews.apache.org/r/42616/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cd3d5cbf
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cd3d5cbf
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cd3d5cbf

Branch: refs/heads/master
Commit: cd3d5cbff253bdea9bc5a8c1dacb06cb17c79837
Parents: 000c617
Author: Neil Conway <ne...@gmail.com>
Authored: Wed Feb 3 16:50:07 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Feb 3 18:12:58 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/authenticator.cpp       |  8 +++----
 3rdparty/libprocess/src/http.cpp                | 24 ++++++++++----------
 3rdparty/libprocess/src/io.cpp                  |  2 +-
 3rdparty/libprocess/src/libevent_ssl_socket.cpp |  2 +-
 3rdparty/libprocess/src/metrics/metrics.cpp     |  2 +-
 3rdparty/libprocess/src/pid.cpp                 |  2 +-
 3rdparty/libprocess/src/process.cpp             |  4 ++--
 3rdparty/libprocess/src/socket.cpp              |  2 +-
 3rdparty/libprocess/src/tests/process_tests.cpp |  2 +-
 9 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/authenticator.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/authenticator.cpp b/3rdparty/libprocess/src/authenticator.cpp
index 16b48cd..55e8558 100644
--- a/3rdparty/libprocess/src/authenticator.cpp
+++ b/3rdparty/libprocess/src/authenticator.cpp
@@ -38,15 +38,15 @@ class BasicAuthenticatorProcess : public Process<BasicAuthenticatorProcess>
 {
 public:
   BasicAuthenticatorProcess(
-      const std::string& realm,
-      const hashmap<std::string, std::string>& credentials);
+      const string& realm,
+      const hashmap<string, string>& credentials);
 
   virtual Future<AuthenticationResult> authenticate(
       const http::Request& request);
 
 private:
-  const std::string realm_;
-  const hashmap<std::string, std::string> credentials_;
+  const string realm_;
+  const hashmap<string, string> credentials_;
 };
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/http.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/http.cpp b/3rdparty/libprocess/src/http.cpp
index 762da9a..a19cd12 100644
--- a/3rdparty/libprocess/src/http.cpp
+++ b/3rdparty/libprocess/src/http.cpp
@@ -567,7 +567,7 @@ OK::OK(const JSON::Value& value, const Option<string>& jsonp)
 }
 
 
-OK::OK(JSON::Proxy&& value, const Option<std::string>& jsonp)
+OK::OK(JSON::Proxy&& value, const Option<string>& jsonp)
   : Response(Status::OK)
 {
   type = BODY;
@@ -749,24 +749,24 @@ Try<vector<Response>> decodeResponses(const string& s)
 
 namespace query {
 
-Try<hashmap<std::string, std::string>> decode(const std::string& query)
+Try<hashmap<string, string>> decode(const string& query)
 {
-  hashmap<std::string, std::string> result;
+  hashmap<string, string> result;
 
-  const std::vector<std::string> tokens = strings::tokenize(query, ";&");
-  foreach (const std::string& token, tokens) {
-    const std::vector<std::string> pairs = strings::split(token, "=", 2);
+  const vector<string> tokens = strings::tokenize(query, ";&");
+  foreach (const string& token, tokens) {
+    const vector<string> pairs = strings::split(token, "=", 2);
     if (pairs.size() == 0) {
       continue;
     }
 
-    Try<std::string> key = http::decode(pairs[0]);
+    Try<string> key = http::decode(pairs[0]);
     if (key.isError()) {
       return Error(key.error());
     }
 
     if (pairs.size() == 2) {
-      Try<std::string> value = http::decode(pairs[1]);
+      Try<string> value = http::decode(pairs[1]);
       if (value.isError()) {
         return Error(value.error());
       }
@@ -781,11 +781,11 @@ Try<hashmap<std::string, std::string>> decode(const std::string& query)
 }
 
 
-std::string encode(const hashmap<std::string, std::string>& query)
+string encode(const hashmap<string, string>& query)
 {
-  std::string output;
+  string output;
 
-  foreachpair (const std::string& key, const std::string& value, query) {
+  foreachpair (const string& key, const string& value, query) {
     output += http::encode(key);
     if (!value.empty()) {
       output += "=" + http::encode(value);
@@ -999,7 +999,7 @@ public:
     return response;
   }
 
-  Future<Nothing> disconnect(const Option<std::string>& message = None())
+  Future<Nothing> disconnect(const Option<string>& message = None())
   {
     Try<Nothing> shutdown = socket.shutdown();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/io.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/io.cpp b/3rdparty/libprocess/src/io.cpp
index 9530192..4a58d6d 100644
--- a/3rdparty/libprocess/src/io.cpp
+++ b/3rdparty/libprocess/src/io.cpp
@@ -425,7 +425,7 @@ Future<string> read(int fd)
 }
 
 
-Future<Nothing> write(int fd, const std::string& data)
+Future<Nothing> write(int fd, const string& data)
 {
   process::initialize();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/libevent_ssl_socket.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent_ssl_socket.cpp b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
index 9321ce6..5a987ea 100644
--- a/3rdparty/libprocess/src/libevent_ssl_socket.cpp
+++ b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
@@ -455,7 +455,7 @@ LibeventSSLSocketImpl::LibeventSSLSocketImpl(int _s)
 LibeventSSLSocketImpl::LibeventSSLSocketImpl(
     int _s,
     bufferevent* _bev,
-    Option<std::string>&& _peer_hostname)
+    Option<string>&& _peer_hostname)
   : Socket::Impl(_s),
     bev(_bev),
     listener(NULL),

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/metrics/metrics.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/metrics/metrics.cpp b/3rdparty/libprocess/src/metrics/metrics.cpp
index 3083b92..a984008 100644
--- a/3rdparty/libprocess/src/metrics/metrics.cpp
+++ b/3rdparty/libprocess/src/metrics/metrics.cpp
@@ -89,7 +89,7 @@ Future<Nothing> MetricsProcess::add(Owned<Metric> metric)
 }
 
 
-Future<Nothing> MetricsProcess::remove(const std::string& name)
+Future<Nothing> MetricsProcess::remove(const string& name)
 {
   if (!metrics.contains(name)) {
     return Failure("Metric '" + name + "' not found.");

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/pid.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/pid.cpp b/3rdparty/libprocess/src/pid.cpp
index 3cd04ec..9387f59 100644
--- a/3rdparty/libprocess/src/pid.cpp
+++ b/3rdparty/libprocess/src/pid.cpp
@@ -63,7 +63,7 @@ UPID::UPID(const ProcessBase& process)
 }
 
 
-UPID::operator std::string() const
+UPID::operator string() const
 {
   ostringstream out;
   out << *this;

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 65a247a..1672e08 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -501,7 +501,7 @@ namespace http {
 namespace authentication {
 
 Future<Nothing> setAuthenticator(
-    const std::string& realm,
+    const string& realm,
     Owned<Authenticator> authenticator)
 {
   process::initialize();
@@ -3313,7 +3313,7 @@ void ProcessBase::route(
 
 void ProcessBase::route(
     const string& name,
-    const std::string& realm,
+    const string& realm,
     const Option<string>& help_,
     const AuthenticatedHttpRequestHandler& handler)
 {

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/socket.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/socket.cpp b/3rdparty/libprocess/src/socket.cpp
index 6c1b16f..ab73814 100644
--- a/3rdparty/libprocess/src/socket.cpp
+++ b/3rdparty/libprocess/src/socket.cpp
@@ -235,7 +235,7 @@ static Future<Nothing> _send(
 }
 
 
-Future<Nothing> Socket::Impl::send(const std::string& _data)
+Future<Nothing> Socket::Impl::send(const string& _data)
 {
   Owned<string> data(new string(_data));
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3d5cbf/3rdparty/libprocess/src/tests/process_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/process_tests.cpp b/3rdparty/libprocess/src/tests/process_tests.cpp
index df1c7b3..e9bf80e 100644
--- a/3rdparty/libprocess/src/tests/process_tests.cpp
+++ b/3rdparty/libprocess/src/tests/process_tests.cpp
@@ -1835,7 +1835,7 @@ TEST(ProcessTest, PercentEncodedURLs)
 class HTTPEndpointProcess : public Process<HTTPEndpointProcess>
 {
 public:
-  explicit HTTPEndpointProcess(const std::string& id)
+  explicit HTTPEndpointProcess(const string& id)
     : ProcessBase(id) {}
 
   virtual void initialize()