From: oharboe Date: Thu, 4 Jun 2009 11:42:34 +0000 (+0000) Subject: use assert() to catch TAP_INVALID passed to jtag_add_xxx() fn's. X-Git-Tag: v0.2.0~467 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f86f2ab3f8e51129ccadcba4920be0f8bf47637e;p=openocd use assert() to catch TAP_INVALID passed to jtag_add_xxx() fn's. git-svn-id: svn://svn.berlios.de/openocd/trunk@2043 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 04ab48b6..5738a0dc 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -394,8 +394,9 @@ static void jtag_prelude(tap_state_t state) { jtag_checks(); - if (state != TAP_INVALID) - jtag_add_end_state(state); + assert(state!=TAP_INVALID); + + jtag_add_end_state(state); cmd_queue_cur_state = cmd_queue_end_state; } @@ -575,8 +576,9 @@ void jtag_add_dr_out(jtag_tap_t* tap, int num_fields, const int* num_bits, const u32* value, tap_state_t end_state) { - if (end_state != TAP_INVALID) - cmd_queue_end_state = end_state; + assert(end_state != TAP_INVALID); + + cmd_queue_end_state = end_state; cmd_queue_cur_state = cmd_queue_end_state;