From aee80fb67bcc3fc5209050c40bd8efc1bbcc0610 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 7 May 2015 21:38:41 -0700 Subject: [PATCH] Add some missing 'const's. Change-Id: I5bd26d4366e10fc8c6bc255b7ddb174a7a8b82a5 --- adb/adb.cpp | 6 +++--- adb/adb.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/adb/adb.cpp b/adb/adb.cpp index c78076d67..9abcc73f5 100644 --- a/adb/adb.cpp +++ b/adb/adb.cpp @@ -696,7 +696,7 @@ int launch_server(int server_port) // Try to handle a network forwarding request. // This returns 1 on success, 0 on failure, and -1 to indicate this is not // a forwarding-related request. -int handle_forward_request(const char* service, TransportType type, char* serial, int reply_fd) +int handle_forward_request(const char* service, TransportType type, const char* serial, int reply_fd) { if (!strcmp(service, "list-forward")) { // Create the list of forward redirections. @@ -796,7 +796,7 @@ int handle_forward_request(const char* service, TransportType type, char* serial return 0; } -int handle_host_request(char *service, TransportType type, char* serial, int reply_fd, asocket *s) +int handle_host_request(const char* service, TransportType type, const char* serial, int reply_fd, asocket *s) { if(!strcmp(service, "kill")) { fprintf(stderr,"adb server killed by remote request\n"); @@ -856,7 +856,7 @@ int handle_host_request(char *service, TransportType type, char* serial, int rep if (!strncmp(service, "disconnect:", 11)) { char buffer[4096]; memset(buffer, 0, sizeof(buffer)); - char* serial = service + 11; + const char* serial = service + 11; if (serial[0] == 0) { // disconnect from all TCP devices unregister_all_tcp_transports(); diff --git a/adb/adb.h b/adb/adb.h index 5d2016506..daabf8c41 100644 --- a/adb/adb.h +++ b/adb/adb.h @@ -284,7 +284,7 @@ asocket* create_jdwp_tracker_service_socket(); int create_jdwp_connection_fd(int jdwp_pid); #endif -int handle_forward_request(const char* service, TransportType type, char* serial, int reply_fd); +int handle_forward_request(const char* service, TransportType type, const char* serial, int reply_fd); #if !ADB_HOST void framebuffer_service(int fd, void *cookie); @@ -366,7 +366,7 @@ extern int SHELL_EXIT_NOTIFY_FD; #define USB_FFS_ADB_IN USB_FFS_ADB_EP(ep2) #endif -int handle_host_request(char *service, TransportType type, char* serial, int reply_fd, asocket *s); +int handle_host_request(const char* service, TransportType type, const char* serial, int reply_fd, asocket *s); void handle_online(atransport *t); void handle_offline(atransport *t);