Loading fastboot/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \ LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c fs.c LOCAL_MODULE := fastboot LOCAL_MODULE_TAGS := debug LOCAL_CFLAGS += -std=gnu99 LOCAL_CFLAGS += -std=gnu99 -Werror ifeq ($(HOST_OS),linux) LOCAL_SRC_FILES += usb_linux.c util_linux.c Loading Loading @@ -72,6 +72,7 @@ ifeq ($(HOST_OS),linux) include $(CLEAR_VARS) LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c LOCAL_MODULE := usbtest LOCAL_CFLAGS := -Werror include $(BUILD_HOST_EXECUTABLE) endif Loading fastboot/engine.c +7 −6 Original line number Diff line number Diff line Loading @@ -30,10 +30,10 @@ #include "fs.h" #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> Loading @@ -45,6 +45,10 @@ #include <sys/mman.h> #endif #ifndef __unused #define __unused __attribute__((__unused__)) #endif #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define OP_DOWNLOAD 1 Loading Loading @@ -106,7 +110,6 @@ int fb_format_supported(usb_handle *usb, const char *partition, const char *type { char fs_type[FB_RESPONSE_SZ + 1] = {0,}; int status; unsigned int i; if (type_override) { return !!fs_get_generator(type_override); Loading Loading @@ -197,9 +200,7 @@ void fb_queue_flash_sparse(const char *ptn, struct sparse_file *s, unsigned sz) static int match(char *str, const char **value, unsigned count) { const char *val; unsigned n; int len; for (n = 0; n < count; n++) { const char *val = value[n]; Loading Loading @@ -325,7 +326,7 @@ void fb_queue_query_save(const char *var, char *dest, unsigned dest_size) a->func = cb_save; } static int cb_do_nothing(Action *a, int status, char *resp) static int cb_do_nothing(Action *a __unused, int status __unused, char *resp __unused) { fprintf(stderr,"\n"); return 0; Loading fastboot/fastboot.c +15 −21 Original line number Diff line number Diff line Loading @@ -28,22 +28,20 @@ #define _LARGEFILE64_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <stdint.h> #include <string.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <limits.h> #include <ctype.h> #include <getopt.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <bootimg.h> #include <sparse/sparse.h> Loading Loading @@ -72,7 +70,6 @@ static usb_handle *usb = 0; static const char *serial = 0; static const char *product = 0; static const char *cmdline = 0; static int wipe_data = 0; static unsigned short vendor_id = 0; static int long_listing = 0; static int64_t sparse_limit = -1; Loading Loading @@ -270,7 +267,7 @@ usb_handle *open_device(void) announce = 0; fprintf(stderr,"< waiting for device >\n"); } sleep(1); usleep(1000); } } Loading Loading @@ -428,7 +425,7 @@ static int unzip_to_file(zipfile_t zip, char *name) return -1; } if (write(fd, data, sz) != sz) { if (write(fd, data, sz) != (ssize_t)sz) { fd = -1; } Loading Loading @@ -722,7 +719,7 @@ void do_update(usb_handle *usb, char *fn, int erase_first) int fd; int rc; struct fastboot_buffer buf; int i; size_t i; queue_info_dump(); Loading Loading @@ -796,7 +793,7 @@ void do_flashall(usb_handle *usb, int erase_first) void *data; unsigned sz; struct fastboot_buffer buf; int i; size_t i; queue_info_dump(); Loading Loading @@ -828,7 +825,6 @@ void do_flashall(usb_handle *usb, int erase_first) int do_oem_command(int argc, char **argv) { int i; char command[256]; if (argc <= 1) return 0; Loading Loading @@ -915,7 +911,7 @@ void fb_perform_format(const char *partition, int skip_if_not_supported, "Warning: %s type is %s, but %s was requested for formating.\n", partition, pType, type_override); } pType = type_override; pType = (char *)type_override; } status = fb_getvar(usb, pSize, "partition-size:%s", partition); Loading @@ -929,7 +925,7 @@ void fb_perform_format(const char *partition, int skip_if_not_supported, "Warning: %s size is %s, but %s was requested for formating.\n", partition, pSize, size_override); } pSize = size_override; pSize = (char *)size_override; } gen = fs_get_generator(pType); Loading Loading @@ -981,7 +977,6 @@ int main(int argc, char **argv) unsigned sz; int status; int c; int r; const struct option longopts[] = { {"base", required_argument, 0, 'b'}, Loading @@ -996,7 +991,6 @@ int main(int argc, char **argv) serial = getenv("ANDROID_SERIAL"); while (1) { int option_index = 0; c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:h", longopts, NULL); if (c < 0) { break; Loading fastboot/protocol.c +0 −3 Original line number Diff line number Diff line Loading @@ -110,7 +110,6 @@ static int _command_start(usb_handle *usb, const char *cmd, unsigned size, char *response) { int cmdsize = strlen(cmd); int r; if(response) { response[0] = 0; Loading Loading @@ -189,8 +188,6 @@ static int _command_send(usb_handle *usb, const char *cmd, static int _command_send_no_data(usb_handle *usb, const char *cmd, char *response) { int r; return _command_start(usb, cmd, 0, response); } Loading fastboot/usb_linux.c +0 −3 Original line number Diff line number Diff line Loading @@ -125,9 +125,6 @@ static int filter_usb_device(char* sysfs_name, unsigned i; unsigned e; struct stat st; int result; if(check(ptr, len, USB_DT_DEVICE, USB_DT_DEVICE_SIZE)) return -1; dev = (void*) ptr; Loading Loading
fastboot/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \ LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c fs.c LOCAL_MODULE := fastboot LOCAL_MODULE_TAGS := debug LOCAL_CFLAGS += -std=gnu99 LOCAL_CFLAGS += -std=gnu99 -Werror ifeq ($(HOST_OS),linux) LOCAL_SRC_FILES += usb_linux.c util_linux.c Loading Loading @@ -72,6 +72,7 @@ ifeq ($(HOST_OS),linux) include $(CLEAR_VARS) LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c LOCAL_MODULE := usbtest LOCAL_CFLAGS := -Werror include $(BUILD_HOST_EXECUTABLE) endif Loading
fastboot/engine.c +7 −6 Original line number Diff line number Diff line Loading @@ -30,10 +30,10 @@ #include "fs.h" #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> Loading @@ -45,6 +45,10 @@ #include <sys/mman.h> #endif #ifndef __unused #define __unused __attribute__((__unused__)) #endif #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define OP_DOWNLOAD 1 Loading Loading @@ -106,7 +110,6 @@ int fb_format_supported(usb_handle *usb, const char *partition, const char *type { char fs_type[FB_RESPONSE_SZ + 1] = {0,}; int status; unsigned int i; if (type_override) { return !!fs_get_generator(type_override); Loading Loading @@ -197,9 +200,7 @@ void fb_queue_flash_sparse(const char *ptn, struct sparse_file *s, unsigned sz) static int match(char *str, const char **value, unsigned count) { const char *val; unsigned n; int len; for (n = 0; n < count; n++) { const char *val = value[n]; Loading Loading @@ -325,7 +326,7 @@ void fb_queue_query_save(const char *var, char *dest, unsigned dest_size) a->func = cb_save; } static int cb_do_nothing(Action *a, int status, char *resp) static int cb_do_nothing(Action *a __unused, int status __unused, char *resp __unused) { fprintf(stderr,"\n"); return 0; Loading
fastboot/fastboot.c +15 −21 Original line number Diff line number Diff line Loading @@ -28,22 +28,20 @@ #define _LARGEFILE64_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <stdint.h> #include <string.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <limits.h> #include <ctype.h> #include <getopt.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <bootimg.h> #include <sparse/sparse.h> Loading Loading @@ -72,7 +70,6 @@ static usb_handle *usb = 0; static const char *serial = 0; static const char *product = 0; static const char *cmdline = 0; static int wipe_data = 0; static unsigned short vendor_id = 0; static int long_listing = 0; static int64_t sparse_limit = -1; Loading Loading @@ -270,7 +267,7 @@ usb_handle *open_device(void) announce = 0; fprintf(stderr,"< waiting for device >\n"); } sleep(1); usleep(1000); } } Loading Loading @@ -428,7 +425,7 @@ static int unzip_to_file(zipfile_t zip, char *name) return -1; } if (write(fd, data, sz) != sz) { if (write(fd, data, sz) != (ssize_t)sz) { fd = -1; } Loading Loading @@ -722,7 +719,7 @@ void do_update(usb_handle *usb, char *fn, int erase_first) int fd; int rc; struct fastboot_buffer buf; int i; size_t i; queue_info_dump(); Loading Loading @@ -796,7 +793,7 @@ void do_flashall(usb_handle *usb, int erase_first) void *data; unsigned sz; struct fastboot_buffer buf; int i; size_t i; queue_info_dump(); Loading Loading @@ -828,7 +825,6 @@ void do_flashall(usb_handle *usb, int erase_first) int do_oem_command(int argc, char **argv) { int i; char command[256]; if (argc <= 1) return 0; Loading Loading @@ -915,7 +911,7 @@ void fb_perform_format(const char *partition, int skip_if_not_supported, "Warning: %s type is %s, but %s was requested for formating.\n", partition, pType, type_override); } pType = type_override; pType = (char *)type_override; } status = fb_getvar(usb, pSize, "partition-size:%s", partition); Loading @@ -929,7 +925,7 @@ void fb_perform_format(const char *partition, int skip_if_not_supported, "Warning: %s size is %s, but %s was requested for formating.\n", partition, pSize, size_override); } pSize = size_override; pSize = (char *)size_override; } gen = fs_get_generator(pType); Loading Loading @@ -981,7 +977,6 @@ int main(int argc, char **argv) unsigned sz; int status; int c; int r; const struct option longopts[] = { {"base", required_argument, 0, 'b'}, Loading @@ -996,7 +991,6 @@ int main(int argc, char **argv) serial = getenv("ANDROID_SERIAL"); while (1) { int option_index = 0; c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lp:c:i:m:h", longopts, NULL); if (c < 0) { break; Loading
fastboot/protocol.c +0 −3 Original line number Diff line number Diff line Loading @@ -110,7 +110,6 @@ static int _command_start(usb_handle *usb, const char *cmd, unsigned size, char *response) { int cmdsize = strlen(cmd); int r; if(response) { response[0] = 0; Loading Loading @@ -189,8 +188,6 @@ static int _command_send(usb_handle *usb, const char *cmd, static int _command_send_no_data(usb_handle *usb, const char *cmd, char *response) { int r; return _command_start(usb, cmd, 0, response); } Loading
fastboot/usb_linux.c +0 −3 Original line number Diff line number Diff line Loading @@ -125,9 +125,6 @@ static int filter_usb_device(char* sysfs_name, unsigned i; unsigned e; struct stat st; int result; if(check(ptr, len, USB_DT_DEVICE, USB_DT_DEVICE_SIZE)) return -1; dev = (void*) ptr; Loading