Loading adb/adb.h +0 −1 Original line number Diff line number Diff line Loading @@ -375,7 +375,6 @@ void usb_kick(usb_handle *h); int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_protocol); #endif unsigned host_to_le32(unsigned n); int adb_commandline(int argc, char **argv); int connection_state(atransport *t); Loading adb/file_sync_service.h +1 −13 Original line number Diff line number Diff line Loading @@ -17,22 +17,10 @@ #ifndef _FILE_SYNC_SERVICE_H_ #define _FILE_SYNC_SERVICE_H_ #ifdef HAVE_BIG_ENDIAN static inline unsigned __swap_uint32(unsigned x) { return (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24); } #define htoll(x) __swap_uint32(x) #define ltohl(x) __swap_uint32(x) #define MKID(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24)) #else #define htoll(x) (x) #define ltohl(x) (x) #define MKID(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)) #endif #define ID_STAT MKID('S','T','A','T') #define ID_LIST MKID('L','I','S','T') Loading adb/transport_local.c +0 −27 Original line number Diff line number Diff line Loading @@ -28,21 +28,6 @@ #define TRACE_TAG TRACE_TRANSPORT #include "adb.h" #ifdef HAVE_BIG_ENDIAN #define H4(x) (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) static inline void fix_endians(apacket *p) { p->msg.command = H4(p->msg.command); p->msg.arg0 = H4(p->msg.arg0); p->msg.arg1 = H4(p->msg.arg1); p->msg.data_length = H4(p->msg.data_length); p->msg.data_check = H4(p->msg.data_check); p->msg.magic = H4(p->msg.magic); } #else #define fix_endians(p) do {} while (0) #endif #if ADB_HOST /* we keep a list of opened transports. The atransport struct knows to which * local transport it is connected. The list is used to detect when we're Loading @@ -62,12 +47,6 @@ static int remote_read(apacket *p, atransport *t) return -1; } fix_endians(p); #if 0 && defined HAVE_BIG_ENDIAN D("read remote packet: %04x arg0=%0x arg1=%0x data_length=%0x data_check=%0x magic=%0x\n", p->msg.command, p->msg.arg0, p->msg.arg1, p->msg.data_length, p->msg.data_check, p->msg.magic); #endif if(check_header(p)) { D("bad header: terminated (data)\n"); return -1; Loading @@ -90,12 +69,6 @@ static int remote_write(apacket *p, atransport *t) { int length = p->msg.data_length; fix_endians(p); #if 0 && defined HAVE_BIG_ENDIAN D("write remote packet: %04x arg0=%0x arg1=%0x data_length=%0x data_check=%0x magic=%0x\n", p->msg.command, p->msg.arg0, p->msg.arg1, p->msg.data_length, p->msg.data_check, p->msg.magic); #endif if(writex(t->sfd, &p->msg, sizeof(amessage) + length)) { D("remote local: write terminated\n"); return -1; Loading adb/transport_usb.c +0 −27 Original line number Diff line number Diff line Loading @@ -23,29 +23,6 @@ #define TRACE_TAG TRACE_TRANSPORT #include "adb.h" #ifdef HAVE_BIG_ENDIAN #define H4(x) (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) static inline void fix_endians(apacket *p) { p->msg.command = H4(p->msg.command); p->msg.arg0 = H4(p->msg.arg0); p->msg.arg1 = H4(p->msg.arg1); p->msg.data_length = H4(p->msg.data_length); p->msg.data_check = H4(p->msg.data_check); p->msg.magic = H4(p->msg.magic); } unsigned host_to_le32(unsigned n) { return H4(n); } #else #define fix_endians(p) do {} while (0) unsigned host_to_le32(unsigned n) { return n; } #endif static int remote_read(apacket *p, atransport *t) { if(usb_read(t->usb, &p->msg, sizeof(amessage))){ Loading @@ -53,8 +30,6 @@ static int remote_read(apacket *p, atransport *t) return -1; } fix_endians(p); if(check_header(p)) { D("remote usb: check_header failed\n"); return -1; Loading @@ -79,8 +54,6 @@ static int remote_write(apacket *p, atransport *t) { unsigned size = p->msg.data_length; fix_endians(p); if(usb_write(t->usb, &p->msg, sizeof(amessage))) { D("remote usb: 1 - write terminated\n"); return -1; Loading include/utils/Endian.h +5 −10 Original line number Diff line number Diff line Loading @@ -20,21 +20,16 @@ #ifndef _LIBS_UTILS_ENDIAN_H #define _LIBS_UTILS_ENDIAN_H #if defined(HAVE_ENDIAN_H) #include <endian.h> #else /*not HAVE_ENDIAN_H*/ #if defined(_WIN32) #define __BIG_ENDIAN 0x1000 #define __LITTLE_ENDIAN 0x0001 #if defined(HAVE_LITTLE_ENDIAN) #define __BYTE_ORDER __LITTLE_ENDIAN #else # define __BYTE_ORDER __BIG_ENDIAN #endif #endif /*not HAVE_ENDIAN_H*/ #include <endian.h> #endif #endif /*_LIBS_UTILS_ENDIAN_H*/ Loading
adb/adb.h +0 −1 Original line number Diff line number Diff line Loading @@ -375,7 +375,6 @@ void usb_kick(usb_handle *h); int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_protocol); #endif unsigned host_to_le32(unsigned n); int adb_commandline(int argc, char **argv); int connection_state(atransport *t); Loading
adb/file_sync_service.h +1 −13 Original line number Diff line number Diff line Loading @@ -17,22 +17,10 @@ #ifndef _FILE_SYNC_SERVICE_H_ #define _FILE_SYNC_SERVICE_H_ #ifdef HAVE_BIG_ENDIAN static inline unsigned __swap_uint32(unsigned x) { return (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24); } #define htoll(x) __swap_uint32(x) #define ltohl(x) __swap_uint32(x) #define MKID(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24)) #else #define htoll(x) (x) #define ltohl(x) (x) #define MKID(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)) #endif #define ID_STAT MKID('S','T','A','T') #define ID_LIST MKID('L','I','S','T') Loading
adb/transport_local.c +0 −27 Original line number Diff line number Diff line Loading @@ -28,21 +28,6 @@ #define TRACE_TAG TRACE_TRANSPORT #include "adb.h" #ifdef HAVE_BIG_ENDIAN #define H4(x) (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) static inline void fix_endians(apacket *p) { p->msg.command = H4(p->msg.command); p->msg.arg0 = H4(p->msg.arg0); p->msg.arg1 = H4(p->msg.arg1); p->msg.data_length = H4(p->msg.data_length); p->msg.data_check = H4(p->msg.data_check); p->msg.magic = H4(p->msg.magic); } #else #define fix_endians(p) do {} while (0) #endif #if ADB_HOST /* we keep a list of opened transports. The atransport struct knows to which * local transport it is connected. The list is used to detect when we're Loading @@ -62,12 +47,6 @@ static int remote_read(apacket *p, atransport *t) return -1; } fix_endians(p); #if 0 && defined HAVE_BIG_ENDIAN D("read remote packet: %04x arg0=%0x arg1=%0x data_length=%0x data_check=%0x magic=%0x\n", p->msg.command, p->msg.arg0, p->msg.arg1, p->msg.data_length, p->msg.data_check, p->msg.magic); #endif if(check_header(p)) { D("bad header: terminated (data)\n"); return -1; Loading @@ -90,12 +69,6 @@ static int remote_write(apacket *p, atransport *t) { int length = p->msg.data_length; fix_endians(p); #if 0 && defined HAVE_BIG_ENDIAN D("write remote packet: %04x arg0=%0x arg1=%0x data_length=%0x data_check=%0x magic=%0x\n", p->msg.command, p->msg.arg0, p->msg.arg1, p->msg.data_length, p->msg.data_check, p->msg.magic); #endif if(writex(t->sfd, &p->msg, sizeof(amessage) + length)) { D("remote local: write terminated\n"); return -1; Loading
adb/transport_usb.c +0 −27 Original line number Diff line number Diff line Loading @@ -23,29 +23,6 @@ #define TRACE_TAG TRACE_TRANSPORT #include "adb.h" #ifdef HAVE_BIG_ENDIAN #define H4(x) (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) static inline void fix_endians(apacket *p) { p->msg.command = H4(p->msg.command); p->msg.arg0 = H4(p->msg.arg0); p->msg.arg1 = H4(p->msg.arg1); p->msg.data_length = H4(p->msg.data_length); p->msg.data_check = H4(p->msg.data_check); p->msg.magic = H4(p->msg.magic); } unsigned host_to_le32(unsigned n) { return H4(n); } #else #define fix_endians(p) do {} while (0) unsigned host_to_le32(unsigned n) { return n; } #endif static int remote_read(apacket *p, atransport *t) { if(usb_read(t->usb, &p->msg, sizeof(amessage))){ Loading @@ -53,8 +30,6 @@ static int remote_read(apacket *p, atransport *t) return -1; } fix_endians(p); if(check_header(p)) { D("remote usb: check_header failed\n"); return -1; Loading @@ -79,8 +54,6 @@ static int remote_write(apacket *p, atransport *t) { unsigned size = p->msg.data_length; fix_endians(p); if(usb_write(t->usb, &p->msg, sizeof(amessage))) { D("remote usb: 1 - write terminated\n"); return -1; Loading
include/utils/Endian.h +5 −10 Original line number Diff line number Diff line Loading @@ -20,21 +20,16 @@ #ifndef _LIBS_UTILS_ENDIAN_H #define _LIBS_UTILS_ENDIAN_H #if defined(HAVE_ENDIAN_H) #include <endian.h> #else /*not HAVE_ENDIAN_H*/ #if defined(_WIN32) #define __BIG_ENDIAN 0x1000 #define __LITTLE_ENDIAN 0x0001 #if defined(HAVE_LITTLE_ENDIAN) #define __BYTE_ORDER __LITTLE_ENDIAN #else # define __BYTE_ORDER __BIG_ENDIAN #endif #endif /*not HAVE_ENDIAN_H*/ #include <endian.h> #endif #endif /*_LIBS_UTILS_ENDIAN_H*/