summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorDan Austin <danielaustin@google.com>2016-03-30 17:40:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-03-30 17:40:15 +0000
commitb2cb35ef96b6d1cc03c6c39a57a4eb9b6484e100 (patch)
tree0bc4203e26540e133faee70ea0b2683995b1f3bb /adb
parenta2a13e3267850b4eaf2689b0e02cc499228b7bf5 (diff)
parentb4cff495a1f93b6c92f4327cbfb9e564b28913d8 (diff)
downloadcore-b2cb35ef96b6d1cc03c6c39a57a4eb9b6484e100.tar.gz
core-b2cb35ef96b6d1cc03c6c39a57a4eb9b6484e100.tar.bz2
core-b2cb35ef96b6d1cc03c6c39a57a4eb9b6484e100.zip
Merge "Address const issues in preparation for libcxx rebase."
Diffstat (limited to 'adb')
-rw-r--r--adb/socket.h2
-rw-r--r--adb/socket_test.cpp4
-rw-r--r--adb/sockets.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/adb/socket.h b/adb/socket.h
index 9eb1b1955..4acdf4a6d 100644
--- a/adb/socket.h
+++ b/adb/socket.h
@@ -118,7 +118,7 @@ void connect_to_smartsocket(asocket *s);
namespace internal {
#if ADB_HOST
-char* skip_host_serial(const char* service);
+char* skip_host_serial(char* service);
#endif
} // namespace internal
diff --git a/adb/socket_test.cpp b/adb/socket_test.cpp
index 5cbef6dcf..20a3bbbfc 100644
--- a/adb/socket_test.cpp
+++ b/adb/socket_test.cpp
@@ -275,8 +275,8 @@ TEST_F(LocalSocketTest, close_socket_in_CLOSE_WAIT_state) {
// Checks that skip_host_serial(serial) returns a pointer to the part of |serial| which matches
// |expected|, otherwise logs the failure to gtest.
-void VerifySkipHostSerial(const std::string& serial, const char* expected) {
- const char* result = internal::skip_host_serial(serial.c_str());
+void VerifySkipHostSerial(std::string serial, const char* expected) {
+ char* result = internal::skip_host_serial(&serial[0]);
if (expected == nullptr) {
EXPECT_EQ(nullptr, result);
} else {
diff --git a/adb/sockets.cpp b/adb/sockets.cpp
index c083ee144..aecaba224 100644
--- a/adb/sockets.cpp
+++ b/adb/sockets.cpp
@@ -634,7 +634,7 @@ namespace internal {
// Where <port> must be a base-10 number and <prefix> may be any of {usb,product,model,device}.
//
// The returned pointer will point to the ':' just before <command>, or nullptr if not found.
-char* skip_host_serial(const char* service) {
+char* skip_host_serial(char* service) {
static const std::vector<std::string>& prefixes =
*(new std::vector<std::string>{"usb:", "product:", "model:", "device:"});