Loading adb/file_sync_client.cpp +9 −19 Original line number Original line Diff line number Diff line Loading @@ -79,8 +79,7 @@ static void print_transfer_progress(unsigned long long bytes_current, fflush(stderr); fflush(stderr); } } void sync_quit(int fd) static void sync_quit(int fd) { { syncmsg msg; syncmsg msg; msg.req.id = ID_QUIT; msg.req.id = ID_QUIT; Loading @@ -91,8 +90,7 @@ void sync_quit(int fd) typedef void (*sync_ls_cb)(unsigned mode, unsigned size, unsigned time, const char *name, void *cookie); typedef void (*sync_ls_cb)(unsigned mode, unsigned size, unsigned time, const char *name, void *cookie); int sync_ls(int fd, const char *path, sync_ls_cb func, void *cookie) static int sync_ls(int fd, const char* path, sync_ls_cb func, void* cookie) { { syncmsg msg; syncmsg msg; char buf[257]; char buf[257]; int len; int len; Loading Loading @@ -138,9 +136,7 @@ struct syncsendbuf { static syncsendbuf send_buffer; static syncsendbuf send_buffer; int sync_readtime(int fd, const char *path, unsigned int *timestamp, static int sync_readtime(int fd, const char* path, unsigned int* timestamp, unsigned int* mode) { unsigned int *mode) { syncmsg msg; syncmsg msg; int len = strlen(path); int len = strlen(path); Loading Loading @@ -199,8 +195,7 @@ static int sync_finish_readtime(int fd, unsigned int *timestamp, return 0; return 0; } } int sync_readmode(int fd, const char *path, unsigned *mode) static int sync_readmode(int fd, const char* path, unsigned* mode) { { syncmsg msg; syncmsg msg; int len = strlen(path); int len = strlen(path); Loading Loading @@ -419,8 +414,7 @@ static int mkdirs(const char *name) return 0; return 0; } } int sync_recv(int fd, const char *rpath, const char *lpath, int show_progress) static int sync_recv(int fd, const char* rpath, const char* lpath, int show_progress) { { syncmsg msg; syncmsg msg; int len; int len; int lfd = -1; int lfd = -1; Loading Loading @@ -566,17 +560,14 @@ struct copyinfo int flag; int flag; }; }; copyinfo *mkcopyinfo(const char *spath, const char *dpath, static copyinfo* mkcopyinfo(const char* spath, const char* dpath, const char* name, int isdir) { const char *name, int isdir) { int slen = strlen(spath); int slen = strlen(spath); int dlen = strlen(dpath); int dlen = strlen(dpath); int nlen = strlen(name); int nlen = strlen(name); int ssize = slen + nlen + 2; int ssize = slen + nlen + 2; int dsize = dlen + nlen + 2; int dsize = dlen + nlen + 2; copyinfo *ci = reinterpret_cast<copyinfo*>( copyinfo *ci = reinterpret_cast<copyinfo*>(malloc(sizeof(copyinfo) + ssize + dsize)); malloc(sizeof(copyinfo) + ssize + dsize)); if(ci == 0) { if(ci == 0) { fprintf(stderr,"out of memory\n"); fprintf(stderr,"out of memory\n"); abort(); abort(); Loading Loading @@ -807,8 +798,7 @@ struct sync_ls_build_list_cb_args { const char *lpath; const char *lpath; }; }; void static void sync_ls_build_list_cb(unsigned mode, unsigned size, unsigned time, sync_ls_build_list_cb(unsigned mode, unsigned size, unsigned time, const char* name, void* cookie) const char* name, void* cookie) { { sync_ls_build_list_cb_args *args = (sync_ls_build_list_cb_args *)cookie; sync_ls_build_list_cb_args *args = (sync_ls_build_list_cb_args *)cookie; Loading adb/usb_linux_client.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ struct desc_v2 { struct func_desc fs_descs, hs_descs; struct func_desc fs_descs, hs_descs; } __attribute__((packed)); } __attribute__((packed)); struct func_desc fs_descriptors = { static struct func_desc fs_descriptors = { .intf = { .intf = { .bLength = sizeof(fs_descriptors.intf), .bLength = sizeof(fs_descriptors.intf), .bDescriptorType = USB_DT_INTERFACE, .bDescriptorType = USB_DT_INTERFACE, Loading @@ -109,7 +109,7 @@ struct func_desc fs_descriptors = { }, }, }; }; struct func_desc hs_descriptors = { static struct func_desc hs_descriptors = { .intf = { .intf = { .bLength = sizeof(hs_descriptors.intf), .bLength = sizeof(hs_descriptors.intf), .bDescriptorType = USB_DT_INTERFACE, .bDescriptorType = USB_DT_INTERFACE, Loading Loading
adb/file_sync_client.cpp +9 −19 Original line number Original line Diff line number Diff line Loading @@ -79,8 +79,7 @@ static void print_transfer_progress(unsigned long long bytes_current, fflush(stderr); fflush(stderr); } } void sync_quit(int fd) static void sync_quit(int fd) { { syncmsg msg; syncmsg msg; msg.req.id = ID_QUIT; msg.req.id = ID_QUIT; Loading @@ -91,8 +90,7 @@ void sync_quit(int fd) typedef void (*sync_ls_cb)(unsigned mode, unsigned size, unsigned time, const char *name, void *cookie); typedef void (*sync_ls_cb)(unsigned mode, unsigned size, unsigned time, const char *name, void *cookie); int sync_ls(int fd, const char *path, sync_ls_cb func, void *cookie) static int sync_ls(int fd, const char* path, sync_ls_cb func, void* cookie) { { syncmsg msg; syncmsg msg; char buf[257]; char buf[257]; int len; int len; Loading Loading @@ -138,9 +136,7 @@ struct syncsendbuf { static syncsendbuf send_buffer; static syncsendbuf send_buffer; int sync_readtime(int fd, const char *path, unsigned int *timestamp, static int sync_readtime(int fd, const char* path, unsigned int* timestamp, unsigned int* mode) { unsigned int *mode) { syncmsg msg; syncmsg msg; int len = strlen(path); int len = strlen(path); Loading Loading @@ -199,8 +195,7 @@ static int sync_finish_readtime(int fd, unsigned int *timestamp, return 0; return 0; } } int sync_readmode(int fd, const char *path, unsigned *mode) static int sync_readmode(int fd, const char* path, unsigned* mode) { { syncmsg msg; syncmsg msg; int len = strlen(path); int len = strlen(path); Loading Loading @@ -419,8 +414,7 @@ static int mkdirs(const char *name) return 0; return 0; } } int sync_recv(int fd, const char *rpath, const char *lpath, int show_progress) static int sync_recv(int fd, const char* rpath, const char* lpath, int show_progress) { { syncmsg msg; syncmsg msg; int len; int len; int lfd = -1; int lfd = -1; Loading Loading @@ -566,17 +560,14 @@ struct copyinfo int flag; int flag; }; }; copyinfo *mkcopyinfo(const char *spath, const char *dpath, static copyinfo* mkcopyinfo(const char* spath, const char* dpath, const char* name, int isdir) { const char *name, int isdir) { int slen = strlen(spath); int slen = strlen(spath); int dlen = strlen(dpath); int dlen = strlen(dpath); int nlen = strlen(name); int nlen = strlen(name); int ssize = slen + nlen + 2; int ssize = slen + nlen + 2; int dsize = dlen + nlen + 2; int dsize = dlen + nlen + 2; copyinfo *ci = reinterpret_cast<copyinfo*>( copyinfo *ci = reinterpret_cast<copyinfo*>(malloc(sizeof(copyinfo) + ssize + dsize)); malloc(sizeof(copyinfo) + ssize + dsize)); if(ci == 0) { if(ci == 0) { fprintf(stderr,"out of memory\n"); fprintf(stderr,"out of memory\n"); abort(); abort(); Loading Loading @@ -807,8 +798,7 @@ struct sync_ls_build_list_cb_args { const char *lpath; const char *lpath; }; }; void static void sync_ls_build_list_cb(unsigned mode, unsigned size, unsigned time, sync_ls_build_list_cb(unsigned mode, unsigned size, unsigned time, const char* name, void* cookie) const char* name, void* cookie) { { sync_ls_build_list_cb_args *args = (sync_ls_build_list_cb_args *)cookie; sync_ls_build_list_cb_args *args = (sync_ls_build_list_cb_args *)cookie; Loading
adb/usb_linux_client.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ struct desc_v2 { struct func_desc fs_descs, hs_descs; struct func_desc fs_descs, hs_descs; } __attribute__((packed)); } __attribute__((packed)); struct func_desc fs_descriptors = { static struct func_desc fs_descriptors = { .intf = { .intf = { .bLength = sizeof(fs_descriptors.intf), .bLength = sizeof(fs_descriptors.intf), .bDescriptorType = USB_DT_INTERFACE, .bDescriptorType = USB_DT_INTERFACE, Loading @@ -109,7 +109,7 @@ struct func_desc fs_descriptors = { }, }, }; }; struct func_desc hs_descriptors = { static struct func_desc hs_descriptors = { .intf = { .intf = { .bLength = sizeof(hs_descriptors.intf), .bLength = sizeof(hs_descriptors.intf), .bDescriptorType = USB_DT_INTERFACE, .bDescriptorType = USB_DT_INTERFACE, Loading