diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-10-14 20:04:33 -0700 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2009-10-14 20:04:33 -0700 |
commit | 510db585fd3996ff075539aac413eee955bf23b2 (patch) | |
tree | ad64d42a86c79d2354e3e906731c0831d701b9a2 /src/jtag | |
parent | bc792857a5cbfb603a5c3be5ac62d9d54981959c (diff) | |
download | riscv-openocd-510db585fd3996ff075539aac413eee955bf23b2.zip riscv-openocd-510db585fd3996ff075539aac413eee955bf23b2.tar.gz riscv-openocd-510db585fd3996ff075539aac413eee955bf23b2.tar.bz2 |
portability updates
Based on some patches from <redirect.slash.nil@gmail.com>
for preliminary Win64 compilation. More such updates are
needed, but they need work. Compile tested on 64 and 32 bit
Linuxes, and Cygwin.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/jtag')
-rw-r--r-- | src/jtag/core.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index 564b93f..415d1e8 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -991,8 +991,9 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap) return true; /* Loop over the expected identification codes and test for a match */ - uint8_t ii; - for (ii = 0; ii < tap->expected_ids_cnt; ii++) + unsigned ii, limit = tap->expected_ids_cnt; + + for (ii = 0; ii < limit; ii++) { if (tap->idcode == tap->expected_ids[ii]) return true; @@ -1005,11 +1006,11 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap) /* If none of the expected ids matched, warn */ jtag_examine_chain_display(LOG_LVL_WARNING, "UNEXPECTED", tap->dotted_name, tap->idcode); - for (ii = 0; ii < tap->expected_ids_cnt; ii++) + for (ii = 0; ii < limit; ii++) { char msg[32]; - snprintf(msg, sizeof(msg), "expected %hhu of %hhu", - ii + 1, tap->expected_ids_cnt); + + snprintf(msg, sizeof(msg), "expected %u of %u", ii + 1, limit); jtag_examine_chain_display(LOG_LVL_ERROR, msg, tap->dotted_name, tap->expected_ids[ii]); } |