summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-19 08:15:32 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-19 08:15:32 +0000
commit7d6b4b42f61debb058013c4179f29f7fa09d8548 (patch)
tree730f73af3905c7caa8ecfa797b88ed655d647e7d /src
parentdd6912b1e55888d02af390f1174a80b74a511d86 (diff)
downloadopenocd+libswd-7d6b4b42f61debb058013c4179f29f7fa09d8548.tar.gz
openocd+libswd-7d6b4b42f61debb058013c4179f29f7fa09d8548.tar.bz2
openocd+libswd-7d6b4b42f61debb058013c4179f29f7fa09d8548.tar.xz
openocd+libswd-7d6b4b42f61debb058013c4179f29f7fa09d8548.zip
Zach Welch <zw@superlucidity.net> fix warnings in usbprog
git-svn-id: svn://svn.berlios.de/openocd/trunk@1465 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/jtag/usbprog.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/jtag/usbprog.c b/src/jtag/usbprog.c
index 5d5518da..81666885 100644
--- a/src/jtag/usbprog.c
+++ b/src/jtag/usbprog.c
@@ -347,18 +347,16 @@ void usbprog_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size)
usbprog_jtag_tms_send(usbprog_jtag_handle);
- if (type == SCAN_OUT)
- {
- usbprog_jtag_write_tdi(usbprog_jtag_handle,buffer, scan_size);
- }
- if (type == SCAN_IN)
- {
- usbprog_jtag_read_tdo(usbprog_jtag_handle,buffer, scan_size);
- }
- if (type == SCAN_IO)
- {
- usbprog_jtag_write_and_read(usbprog_jtag_handle,buffer, scan_size);
+ void (*f)(struct usbprog_jtag *usbprog_jtag, char * buffer, int size);
+ switch (type) {
+ case SCAN_OUT: f = &usbprog_jtag_write_tdi; break;
+ case SCAN_IN: f = &usbprog_jtag_read_tdo; break;
+ case SCAN_IO: f = &usbprog_jtag_write_and_read; break;
+ default:
+ LOG_ERROR("unknown scan type: %i", type);
+ exit(-1);
}
+ f(usbprog_jtag_handle, (char *)buffer, scan_size);
if (ir_scan)
tap_set_state(TAP_IRPAUSE);