diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-05-07 23:15:40 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-07 23:15:40 +0000 |
commit | e75971157c46a0fc57194a75d4dde0920f60f427 (patch) | |
tree | 3bd787ce1fb5a5ff05621670d9a2847d67beac61 /adb | |
parent | b18da571f90eebedd99fe5607a6b0d7ae4e91893 (diff) | |
parent | 328746da8090a549e432da2358585b101e30d753 (diff) | |
download | system_core-e75971157c46a0fc57194a75d4dde0920f60f427.zip system_core-e75971157c46a0fc57194a75d4dde0920f60f427.tar.gz system_core-e75971157c46a0fc57194a75d4dde0920f60f427.tar.bz2 |
am 328746da: am 129e9dad: Merge changes Idfd1a114,If725a1cb,I61211165,If9a05ccb
* commit '328746da8090a549e432da2358585b101e30d753':
adb: turn on -Werror
netcfg: turn on -Werror
mkbootimg: turn on -Werror
gpttool: turn on -Werror
Diffstat (limited to 'adb')
-rw-r--r-- | adb/Android.mk | 7 | ||||
-rw-r--r-- | adb/backup_service.c | 5 | ||||
-rw-r--r-- | adb/commandline.c | 8 | ||||
-rw-r--r-- | adb/file_sync_client.c | 6 | ||||
-rw-r--r-- | adb/remount_service.c | 11 | ||||
-rw-r--r-- | adb/sysdeps_win32.c | 4 | ||||
-rw-r--r-- | adb/usb_windows.c | 4 |
7 files changed, 20 insertions, 25 deletions
diff --git a/adb/Android.mk b/adb/Android.mk index 51e1664..50e28a6 100644 --- a/adb/Android.mk +++ b/adb/Android.mk @@ -74,7 +74,7 @@ else LOCAL_SRC_FILES += fdevent.c endif -LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter +LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE LOCAL_MODULE := adb LOCAL_MODULE_TAGS := debug @@ -116,7 +116,7 @@ LOCAL_SRC_FILES := \ remount_service.c \ usb_linux_client.c -LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter +LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter -Werror LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) @@ -160,8 +160,7 @@ LOCAL_CFLAGS := \ -g \ -DADB_HOST=1 \ -DADB_HOST_ON_TARGET=1 \ - -Wall \ - -Wno-unused-parameter \ + -Wall -Wno-unused-parameter -Werror \ -D_XOPEN_SOURCE \ -D_GNU_SOURCE diff --git a/adb/backup_service.c b/adb/backup_service.c index 669ff86..654e0f3 100644 --- a/adb/backup_service.c +++ b/adb/backup_service.c @@ -52,15 +52,12 @@ int backup_service(BackupOperation op, char* args) { pid_t pid; int s[2]; char* operation; - int socketnum; - // Command string and choice of stdin/stdout for the pipe depend on our invocation + // Command string depends on our invocation if (op == BACKUP) { operation = "backup"; - socketnum = STDOUT_FILENO; } else { operation = "restore"; - socketnum = STDIN_FILENO; } D("backup_service(%s, %s)\n", operation, args); diff --git a/adb/commandline.c b/adb/commandline.c index e0345a8..c4b5174 100644 --- a/adb/commandline.c +++ b/adb/commandline.c @@ -407,7 +407,7 @@ int adb_download_buffer(const char *service, const char *fn, const void* data, i } int opt = CHUNK_SIZE; - opt = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt)); + opt = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (const void *) &opt, sizeof(opt)); total = sz; ptr = data; @@ -682,10 +682,10 @@ static int logcat(transport_type transport, char* serial, int argc, char **argv) return 0; } -static int mkdirs(char *path) +static int mkdirs(const char *path) { int ret; - char *x = path + 1; + char *x = (char *)path + 1; for(;;) { x = adb_dirstart(x); @@ -728,7 +728,7 @@ static int backup(int argc, char** argv) { if (argc < 2) return usage(); adb_unlink(filename); - mkdirs((char *)filename); + mkdirs(filename); outFd = adb_creat(filename, 0640); if (outFd < 0) { fprintf(stderr, "adb: unable to open file %s\n", filename); diff --git a/adb/file_sync_client.c b/adb/file_sync_client.c index 8fad50e..dc4e77f 100644 --- a/adb/file_sync_client.c +++ b/adb/file_sync_client.c @@ -456,10 +456,10 @@ fail: return -1; } -static int mkdirs(char *name) +static int mkdirs(const char *name) { int ret; - char *x = name + 1; + char *x = (char *)name + 1; for(;;) { x = adb_dirstart(x); @@ -521,7 +521,7 @@ int sync_recv(int fd, const char *rpath, const char *lpath, int show_progress) if((id == ID_DATA) || (id == ID_DONE)) { adb_unlink(lpath); - mkdirs((char *)lpath); + mkdirs(lpath); lfd = adb_creat(lpath, 0644); if(lfd < 0) { fprintf(stderr,"cannot create '%s': %s\n", lpath, strerror(errno)); diff --git a/adb/remount_service.c b/adb/remount_service.c index ad61284..d3a649b 100644 --- a/adb/remount_service.c +++ b/adb/remount_service.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include <stdlib.h> +#include <errno.h> +#include <fcntl.h> #include <stdio.h> -#include <unistd.h> +#include <stdlib.h> #include <string.h> -#include <fcntl.h> #include <sys/mount.h> -#include <errno.h> +#include <unistd.h> #include "sysdeps.h" @@ -35,7 +35,6 @@ static char *find_mount(const char *dir) { int fd; int res; - int size; char *token = NULL; const char delims[] = "\n"; char buf[4096]; @@ -45,7 +44,7 @@ static char *find_mount(const char *dir) return NULL; buf[sizeof(buf) - 1] = '\0'; - size = adb_read(fd, buf, sizeof(buf) - 1); + adb_read(fd, buf, sizeof(buf) - 1); adb_close(fd); token = strtok(buf, delims); diff --git a/adb/sysdeps_win32.c b/adb/sysdeps_win32.c index 2105b16..b0cb048 100644 --- a/adb/sysdeps_win32.c +++ b/adb/sysdeps_win32.c @@ -956,7 +956,7 @@ bip_buffer_write( BipBuffer bip, const void* src, int len ) avail = len; memcpy( bip->buff + bip->a_end, src, avail ); - src += avail; + src = (const char *)src + avail; count += avail; len -= avail; @@ -1049,7 +1049,7 @@ bip_buffer_read( BipBuffer bip, void* dst, int len ) avail = len; memcpy( dst, bip->buff + bip->a_start, avail ); - dst += avail; + dst = (char *)dst + avail; count += avail; len -= avail; diff --git a/adb/usb_windows.c b/adb/usb_windows.c index 4936b77..1309a78 100644 --- a/adb/usb_windows.c +++ b/adb/usb_windows.c @@ -310,14 +310,14 @@ int usb_read(usb_handle *handle, void* data, int len) { int xfer = (len > 4096) ? 4096 : len; ret = AdbReadEndpointSync(handle->adb_read_pipe, - (void*)data, + data, (unsigned long)xfer, &read, time_out); int saved_errno = GetLastError(); D("usb_write got: %ld, expected: %d, errno: %d\n", read, xfer, saved_errno); if (ret) { - data += read; + data = (char *)data + read; len -= read; if (len == 0) |