summaryrefslogtreecommitdiff
path: root/utils/jz4740_tools/jz4740_usbtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/jz4740_tools/jz4740_usbtool.c')
-rw-r--r--utils/jz4740_tools/jz4740_usbtool.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/jz4740_tools/jz4740_usbtool.c b/utils/jz4740_tools/jz4740_usbtool.c
index fe8771ae12..bc26804bdd 100644
--- a/utils/jz4740_tools/jz4740_usbtool.c
+++ b/utils/jz4740_tools/jz4740_usbtool.c
@@ -127,30 +127,30 @@ int filesize(FILE* fd)
127 return tmp; 127 return tmp;
128} 128}
129 129
130#define SEND_COMMAND(cmd, arg) err = usb_control_msg(dh, USB_ENDPOINT_OUT | USB_TYPE_VENDOR, cmd, arg>>16, arg&0xFFFF, NULL, 0, TOUT);\ 130#define SEND_COMMAND(cmd, arg) err = usb_control_msg(dh, USB_ENDPOINT_OUT | USB_TYPE_VENDOR, (cmd), (arg)>>16, (arg)&0xFFFF, NULL, 0, TOUT);\
131 if (err < 0) \ 131 if (err < 0) \
132 { \ 132 { \
133 fprintf(stderr,"\n[ERR] Error sending control message (%d, %s)\n", err, usb_strerror()); \ 133 fprintf(stderr,"\n[ERR] Error sending control message (%d, %s)\n", err, usb_strerror()); \
134 return -1; \ 134 return -1; \
135 } 135 }
136 136
137#define GET_CPU_INFO(s) err = usb_control_msg(dh, USB_ENDPOINT_IN | USB_TYPE_VENDOR, VR_GET_CPU_INFO, 0, 0, s, 8, TOUT); \ 137#define GET_CPU_INFO(s) err = usb_control_msg(dh, USB_ENDPOINT_IN | USB_TYPE_VENDOR, VR_GET_CPU_INFO, 0, 0, (s), 8, TOUT); \
138 if (err < 0) \ 138 if (err < 0) \
139 { \ 139 { \
140 fprintf(stderr,"\n[ERR] Error sending control message (%d, %s)\n", err, usb_strerror()); \ 140 fprintf(stderr,"\n[ERR] Error sending control message (%d, %s)\n", err, usb_strerror()); \
141 return -1; \ 141 return -1; \
142 } 142 }
143 143
144#define SEND_DATA(ptr, size) err = usb_bulk_write(dh, USB_ENDPOINT_OUT | EP_BULK_TO, ptr, size, TOUT); \ 144#define SEND_DATA(ptr, size) err = usb_bulk_write(dh, USB_ENDPOINT_OUT | EP_BULK_TO, ((char*)(ptr)), (size), TOUT); \
145 if (err != size) \ 145 if (err != (size)) \
146 { \ 146 { \
147 fprintf(stderr,"\n[ERR] Error writing data\n"); \ 147 fprintf(stderr,"\n[ERR] Error writing data\n"); \
148 fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); \ 148 fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); \
149 return -1; \ 149 return -1; \
150 } 150 }
151 151
152#define GET_DATA(ptr, size) err = usb_bulk_read(dh, USB_ENDPOINT_IN | EP_BULK_TO, ptr, size, TOUT); \ 152#define GET_DATA(ptr, size) err = usb_bulk_read(dh, USB_ENDPOINT_IN | EP_BULK_TO, ((char*)(ptr)), (size), TOUT); \
153 if (err != size) \ 153 if (err != (size)) \
154 { \ 154 { \
155 fprintf(stderr,"\n[ERR] Error writing data\n"); \ 155 fprintf(stderr,"\n[ERR] Error writing data\n"); \
156 fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); \ 156 fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); \