diff options
author | Elliott Hughes <enh@google.com> | 2015-04-17 17:31:51 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-17 17:31:51 +0000 |
commit | 0b8ecb32908f0ccde550dd510f4a562239085806 (patch) | |
tree | f84f090131ce5ffe96290fc02bf000939f57773e /adb | |
parent | 9a22039be8bbfd5772e40d6f37b7ecc3c5d93e47 (diff) | |
parent | 2d4121c0dcc93382bcd7ea6476f433d8254919dd (diff) | |
download | system_core-0b8ecb32908f0ccde550dd510f4a562239085806.zip system_core-0b8ecb32908f0ccde550dd510f4a562239085806.tar.gz system_core-0b8ecb32908f0ccde550dd510f4a562239085806.tar.bz2 |
Merge "Remove extern "C" barriers to using C++."
Diffstat (limited to 'adb')
-rw-r--r-- | adb/adb.h | 26 | ||||
-rw-r--r-- | adb/adb_auth.h | 8 | ||||
-rw-r--r-- | adb/adb_client.h | 8 | ||||
-rw-r--r-- | adb/adb_io.h | 8 | ||||
-rw-r--r-- | adb/adb_listeners.h | 12 | ||||
-rw-r--r-- | adb/adb_trace.h | 12 | ||||
-rw-r--r-- | adb/fdevent.h | 10 | ||||
-rw-r--r-- | adb/file_sync_client.cpp | 8 | ||||
-rw-r--r-- | adb/file_sync_service.h | 12 | ||||
-rw-r--r-- | adb/jdwp_service.cpp | 13 | ||||
-rw-r--r-- | adb/qemu_tracing.h | 8 | ||||
-rw-r--r-- | adb/services.cpp | 2 | ||||
-rw-r--r-- | adb/sockets.cpp | 4 | ||||
-rw-r--r-- | adb/sysdeps.h | 12 | ||||
-rw-r--r-- | adb/transport.cpp | 2 |
15 files changed, 21 insertions, 124 deletions
@@ -23,10 +23,6 @@ #include "adb_trace.h" #include "fdevent.h" -#ifdef __cplusplus -extern "C" { -#endif - #define MAX_PAYLOAD 4096 #define A_SYNC 0x434e5953 @@ -47,14 +43,8 @@ extern "C" { // Increment this when we want to force users to start a new adb server. #define ADB_SERVER_VERSION 32 -typedef struct amessage amessage; -typedef struct apacket apacket; -typedef struct asocket asocket; -typedef struct alistener alistener; -typedef struct aservice aservice; -typedef struct atransport atransport; -typedef struct adisconnect adisconnect; -typedef struct usb_handle usb_handle; +struct atransport; +struct usb_handle; struct amessage { unsigned command; /* command identifier constant */ @@ -171,12 +161,12 @@ struct adisconnect ** object, it's a special value used to indicate that a client wants to ** connect to a service implemented within the ADB server itself. */ -typedef enum transport_type { +enum transport_type { kTransportUsb, kTransportLocal, kTransportAny, kTransportHost, -} transport_type; +}; #define TOKEN_SIZE 20 @@ -363,10 +353,10 @@ extern const char *adb_device_banner; extern int HOST; extern int SHELL_EXIT_NOTIFY_FD; -typedef enum { +enum subproc_mode { SUBPROC_PTY = 0, SUBPROC_RAW = 1, -} subproc_mode; +} ; #define CHUNK_SIZE (64*1024) @@ -389,8 +379,4 @@ void handle_offline(atransport *t); void send_connect(atransport *t); -#ifdef __cplusplus -} -#endif - #endif diff --git a/adb/adb_auth.h b/adb/adb_auth.h index 635556e..1e1978d 100644 --- a/adb/adb_auth.h +++ b/adb/adb_auth.h @@ -19,10 +19,6 @@ #include "adb.h" -#ifdef __cplusplus -extern "C" { -#endif - extern int auth_enabled; int adb_auth_keygen(const char* filename); @@ -68,8 +64,4 @@ void adb_auth_confirm_key(unsigned char *data, size_t len, atransport *t); #endif // ADB_HOST -#ifdef __cplusplus -} -#endif - #endif // __ADB_AUTH_H diff --git a/adb/adb_client.h b/adb/adb_client.h index 9af176f..934362a 100644 --- a/adb/adb_client.h +++ b/adb/adb_client.h @@ -3,10 +3,6 @@ #include "adb.h" -#ifdef __cplusplus -extern "C" { -#endif - /* connect to adb, connect to the named service, and return ** a valid fd for interacting with that service upon success ** or a negative number on failure @@ -58,8 +54,4 @@ const char *adb_error(void); */ int adb_status(int fd); -#ifdef __cplusplus -} -#endif - #endif diff --git a/adb/adb_io.h b/adb/adb_io.h index 7d09e7b..8d237ce 100644 --- a/adb/adb_io.h +++ b/adb/adb_io.h @@ -20,10 +20,6 @@ #include <stdbool.h> #include <sys/types.h> -#ifdef __cplusplus -extern "C" { -#endif - /* * Reads exactly len bytes from fd into buf. * @@ -46,8 +42,4 @@ bool WriteFdExactly(int fd, const void *buf, size_t len); /* Same as WriteFdExactly, but with an implicit len = strlen(buf). */ bool WriteStringFully(int fd, const char* str); -#ifdef __cplusplus -} -#endif - #endif /* ADB_IO_H */ diff --git a/adb/adb_listeners.h b/adb/adb_listeners.h index 14fdcd6..6421df1 100644 --- a/adb/adb_listeners.h +++ b/adb/adb_listeners.h @@ -19,17 +19,13 @@ #include "adb.h" -#ifdef __cplusplus -extern "C" { -#endif - // error/status codes for install_listener. -typedef enum { +enum install_status_t { INSTALL_STATUS_OK = 0, INSTALL_STATUS_INTERNAL_ERROR = -1, INSTALL_STATUS_CANNOT_BIND = -2, INSTALL_STATUS_CANNOT_REBIND = -3, -} install_status_t; +}; extern alistener listener_list; @@ -47,8 +43,4 @@ int format_listeners(char* buf, size_t buflen); int remove_listener(const char *local_name, atransport* transport); void remove_all_listeners(void); -#ifdef __cplusplus -} -#endif - #endif /* __ADB_LISTENERS_H */ diff --git a/adb/adb_trace.h b/adb/adb_trace.h index ef5dc24..32b6ae4 100644 --- a/adb/adb_trace.h +++ b/adb/adb_trace.h @@ -23,10 +23,6 @@ #include <stdio.h> #endif -#ifdef __cplusplus -extern "C" { -#endif - /* define ADB_TRACE to 1 to enable tracing support, or 0 to disable it */ #define ADB_TRACE 1 @@ -34,7 +30,7 @@ extern "C" { * forget to update the corresponding 'tags' table in * the adb_trace_init() function implemented in adb.c */ -typedef enum { +enum AdbTrace { TRACE_ADB = 0, /* 0x001 */ TRACE_SOCKETS, TRACE_PACKETS, @@ -47,7 +43,7 @@ typedef enum { TRACE_SERVICES, TRACE_AUTH, TRACE_FDEVENT, -} AdbTrace; +} ; #if ADB_TRACE @@ -148,8 +144,4 @@ void adb_trace_init(void); # define ADB_TRACING 0 #endif /* ADB_TRACE */ -#ifdef __cplusplus -} -#endif - #endif /* __ADB_TRACE_H */ diff --git a/adb/fdevent.h b/adb/fdevent.h index a8102ca..8d84b29 100644 --- a/adb/fdevent.h +++ b/adb/fdevent.h @@ -19,10 +19,6 @@ #include <stdint.h> /* for int64_t */ -#ifdef __cplusplus -extern "C" { -#endif - /* events that may be observed */ #define FDE_READ 0x0001 #define FDE_WRITE 0x0002 @@ -32,7 +28,7 @@ extern "C" { /* features that may be set (via the events set/add/del interface) */ #define FDE_DONT_CLOSE 0x0080 -typedef struct fdevent fdevent; +struct fdevent; typedef void (*fd_func)(int fd, unsigned events, void *userdata); @@ -82,8 +78,4 @@ struct fdevent { void *arg; }; -#ifdef __cplusplus -} -#endif - #endif diff --git a/adb/file_sync_client.cpp b/adb/file_sync_client.cpp index 4ba730b..730a5e2 100644 --- a/adb/file_sync_client.cpp +++ b/adb/file_sync_client.cpp @@ -130,8 +130,6 @@ fail: return -1; } -typedef struct syncsendbuf syncsendbuf; - struct syncsendbuf { unsigned id; unsigned size; @@ -557,8 +555,6 @@ int do_sync_ls(const char *path) } } -typedef struct copyinfo copyinfo; - struct copyinfo { copyinfo *next; @@ -804,12 +800,12 @@ int do_sync_push(const char *lpath, const char *rpath, int show_progress) } -typedef struct { +struct sync_ls_build_list_cb_args { copyinfo **filelist; copyinfo **dirlist; const char *rpath; const char *lpath; -} sync_ls_build_list_cb_args; +}; void sync_ls_build_list_cb(unsigned mode, unsigned size, unsigned time, diff --git a/adb/file_sync_service.h b/adb/file_sync_service.h index 5b69a63..6e1ccce 100644 --- a/adb/file_sync_service.h +++ b/adb/file_sync_service.h @@ -17,10 +17,6 @@ #ifndef _FILE_SYNC_SERVICE_H_ #define _FILE_SYNC_SERVICE_H_ -#ifdef __cplusplus -extern "C" { -#endif - #define htoll(x) (x) #define ltohl(x) (x) @@ -38,7 +34,7 @@ extern "C" { #define ID_FAIL MKID('F','A','I','L') #define ID_QUIT MKID('Q','U','I','T') -typedef union { +union syncmsg { unsigned id; struct { unsigned id; @@ -65,7 +61,7 @@ typedef union { unsigned id; unsigned msglen; } status; -} syncmsg; +} ; void file_sync_service(int fd, void *cookie); @@ -76,8 +72,4 @@ int do_sync_pull(const char *rpath, const char *lpath, int show_progress, int pu #define SYNC_DATA_MAX (64*1024) -#ifdef __cplusplus -} -#endif - #endif diff --git a/adb/jdwp_service.cpp b/adb/jdwp_service.cpp index 9cf084e..c0f7ec2 100644 --- a/adb/jdwp_service.cpp +++ b/adb/jdwp_service.cpp @@ -121,7 +121,6 @@ #include <sys/socket.h> #include <sys/un.h> -typedef struct JdwpProcess JdwpProcess; struct JdwpProcess { JdwpProcess* next; JdwpProcess* prev; @@ -455,11 +454,10 @@ FoundIt: #define JDWP_CONTROL_NAME "\0jdwp-control" #define JDWP_CONTROL_NAME_LEN (sizeof(JDWP_CONTROL_NAME)-1) -typedef struct { +struct JdwpControl { int listen_socket; fdevent* fde; - -} JdwpControl; +}; static void @@ -570,10 +568,10 @@ static JdwpControl _jdwp_control; ** this simply returns the list of known JDWP process pids **/ -typedef struct { +struct JdwpSocket { asocket socket; int pass; -} JdwpSocket; +}; static void jdwp_socket_close( asocket* s ) @@ -642,8 +640,6 @@ create_jdwp_service_socket( void ) ** to the client... **/ -typedef struct JdwpTracker JdwpTracker; - struct JdwpTracker { asocket socket; JdwpTracker* next; @@ -754,4 +750,3 @@ init_jdwp(void) } #endif /* !ADB_HOST */ - diff --git a/adb/qemu_tracing.h b/adb/qemu_tracing.h index bf80457..ff42d4f 100644 --- a/adb/qemu_tracing.h +++ b/adb/qemu_tracing.h @@ -21,16 +21,8 @@ #ifndef __QEMU_TRACING_H #define __QEMU_TRACING_H -#ifdef __cplusplus -extern "C" { -#endif - /* Initializes connection with the adb-debug qemud service in the emulator. */ int adb_qemu_trace_init(void); void adb_qemu_trace(const char* fmt, ...); -#ifdef __cplusplus -} -#endif - #endif /* __QEMU_TRACING_H */ diff --git a/adb/services.cpp b/adb/services.cpp index e58100f..769d58e 100644 --- a/adb/services.cpp +++ b/adb/services.cpp @@ -43,8 +43,6 @@ #include "remount_service.h" #include "transport.h" -typedef struct stinfo stinfo; - struct stinfo { void (*func)(int fd, void *cookie); int fd; diff --git a/adb/sockets.cpp b/adb/sockets.cpp index e52d6b1..f468029 100644 --- a/adb/sockets.cpp +++ b/adb/sockets.cpp @@ -487,10 +487,10 @@ static asocket *create_host_service_socket(const char *name, const char* serial) /* a Remote socket is used to send/receive data to/from a given transport object ** it needs to be closed when the transport is forcibly destroyed by the user */ -typedef struct aremotesocket { +struct aremotesocket { asocket socket; adisconnect disconnect; -} aremotesocket; +}; static int remote_socket_enqueue(asocket *s, apacket *p) { diff --git a/adb/sysdeps.h b/adb/sysdeps.h index 2ad28fa..d9a1518 100644 --- a/adb/sysdeps.h +++ b/adb/sysdeps.h @@ -54,10 +54,6 @@ #include "fdevent.h" -#ifdef __cplusplus -extern "C" { -#endif - #define OS_PATH_SEPARATOR '\\' #define OS_PATH_SEPARATOR_STR "\\" #define ENV_PATH_SEPARATOR_STR ";" @@ -296,10 +292,6 @@ extern char* adb_strtok_r(char *str, const char *delim, char **saveptr); #include <string.h> #include <unistd.h> -#ifdef __cplusplus -extern "C" { -#endif - #define OS_PATH_SEPARATOR '/' #define OS_PATH_SEPARATOR_STR "/" #define ENV_PATH_SEPARATOR_STR ":" @@ -540,8 +532,4 @@ static __inline__ unsigned long adb_thread_id() #endif /* !_WIN32 */ -#ifdef __cplusplus -} -#endif - #endif /* _ADB_SYSDEPS_H */ diff --git a/adb/transport.cpp b/adb/transport.cpp index f3e6461..37f9d7b 100644 --- a/adb/transport.cpp +++ b/adb/transport.cpp @@ -406,7 +406,6 @@ static int list_transports_msg(char* buffer, size_t bufferlen) * number of client connections that want it through a single * live TCP connection */ -typedef struct device_tracker device_tracker; struct device_tracker { asocket socket; int update_needed; @@ -536,7 +535,6 @@ void update_transports(void) } #endif // ADB_HOST -typedef struct tmsg tmsg; struct tmsg { atransport *transport; |