From b1aeb2c1260f8adc33ee0a0c00fdc4731a4be338 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 14 Feb 2009 04:30:41 +0000 Subject: [PATCH] Add a prefix to all local variables named "exit" to avoid shadowing the system exit() function git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1432 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 6 ++++++ jtag/include/chain.h | 4 ++-- jtag/include/tap.h | 6 +++--- jtag/src/tap/chain.c | 12 ++++++------ jtag/src/tap/tap.c | 20 ++++++++++---------- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 22d6d7b6..b7a00aa6 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,9 @@ +2009-02-13 Mike Frysinger + + * include/chain.h, include/tap.h, src/tap/chain.c, src/tap/tap.c: Add a + prefix to all local variables named "exit" to avoid shadowing the system + exit() function. + 2009-02-11 Arnim Laeuger * src/bsdl/bsdl_sem.c: return proper error code to upper level diff --git a/jtag/include/chain.h b/jtag/include/chain.h index d2cbce2c..06edc1e5 100644 --- a/jtag/include/chain.h +++ b/jtag/include/chain.h @@ -55,9 +55,9 @@ void chain_defer_clock( chain_t *chain, int tms, int tdi, int n ); int chain_set_trst( chain_t *chain, int trst ); int chain_get_trst( chain_t *chain ); void chain_shift_instructions( chain_t *chain ); -void chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, int exit ); +void chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, int chain_exit ); void chain_shift_data_registers( chain_t *chain, int capture_output ); -void chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture, int exit ); +void chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture, int chain_exit ); void chain_flush( chain_t *chain ); int chain_set_pod_signal( chain_t *chain, int mask, int val ); int chain_get_pod_signal( chain_t *chain, pod_sigsel_t sig ); diff --git a/jtag/include/tap.h b/jtag/include/tap.h index fed95475..69e8ec3c 100644 --- a/jtag/include/tap.h +++ b/jtag/include/tap.h @@ -32,8 +32,8 @@ void tap_reset( chain_t *chain ); void tap_reset_bypass( chain_t *chain ); void tap_capture_dr( chain_t *chain ); void tap_capture_ir( chain_t *chain ); -void tap_defer_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int exit ); -void tap_shift_register_output( chain_t *chain, const tap_register *in, tap_register *out, int exit ); -void tap_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int exit ); +void tap_defer_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int tap_exit ); +void tap_shift_register_output( chain_t *chain, const tap_register *in, tap_register *out, int tap_exit ); +void tap_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int tap_exit ); #endif /* TAP_H */ diff --git a/jtag/src/tap/chain.c b/jtag/src/tap/chain.c index 268550aa..fae3ded2 100644 --- a/jtag/src/tap/chain.c +++ b/jtag/src/tap/chain.c @@ -134,7 +134,7 @@ chain_get_pod_signal( chain_t *chain, pod_sigsel_t sig ) } void -chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, int exit ) +chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, int chain_exit ) { int i; parts_t *ps; @@ -160,7 +160,7 @@ chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, for (i = 0; i < ps->len; i++) { tap_defer_shift_register( chain, ps->parts[i]->active_instruction->value, capture_output ? ps->parts[i]->active_instruction->out : NULL, - (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); + (i + 1) == ps->len ? chain_exit : EXITMODE_SHIFT ); } if(capture_output) @@ -168,7 +168,7 @@ chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, for (i = 0; i < ps->len; i++) { tap_shift_register_output( chain, ps->parts[i]->active_instruction->value, ps->parts[i]->active_instruction->out, - (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); + (i + 1) == ps->len ? chain_exit : EXITMODE_SHIFT ); } } else @@ -185,7 +185,7 @@ chain_shift_instructions( chain_t *chain ) } void -chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture, int exit ) +chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture, int chain_exit ) { int i; parts_t *ps; @@ -215,7 +215,7 @@ chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture for (i = 0; i < ps->len; i++) { tap_defer_shift_register( chain, ps->parts[i]->active_instruction->data_register->in, capture_output ? ps->parts[i]->active_instruction->data_register->out : NULL, - (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); + (i + 1) == ps->len ? chain_exit : EXITMODE_SHIFT ); } if(capture_output) @@ -223,7 +223,7 @@ chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture for (i = 0; i < ps->len; i++) { tap_shift_register_output( chain, ps->parts[i]->active_instruction->data_register->in, ps->parts[i]->active_instruction->data_register->out, - (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); + (i + 1) == ps->len ? chain_exit : EXITMODE_SHIFT ); } } else diff --git a/jtag/src/tap/tap.c b/jtag/src/tap/tap.c index 6af66656..95a5f65d 100644 --- a/jtag/src/tap/tap.c +++ b/jtag/src/tap/tap.c @@ -63,7 +63,7 @@ tap_reset_bypass( chain_t *chain ) } void -tap_defer_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int exit ) +tap_defer_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int tap_exit ) { int i; @@ -75,7 +75,7 @@ tap_defer_shift_register( chain_t *chain, const tap_register *in, tap_register * chain_defer_clock( chain, 0, 0, 1 ); /* save last TDO bit :-) */ i = in->len; - if(exit) i--; + if (tap_exit) i--; if(out && out->len < i) i = out->len; if(out) @@ -86,26 +86,26 @@ tap_defer_shift_register( chain_t *chain, const tap_register *in, tap_register * for (; i < in->len; i++) { if (out != NULL && (i < out->len)) out->data[i] = cable_defer_get_tdo( chain->cable ); - chain_defer_clock( chain, (exit != EXITMODE_SHIFT && ((i + 1) == in->len)) ? 1 : 0, in->data[i], 1 ); /* Shift (& Exit1) */ + chain_defer_clock( chain, (tap_exit != EXITMODE_SHIFT && ((i + 1) == in->len)) ? 1 : 0, in->data[i], 1 ); /* Shift (& Exit1) */ } /* Shift-DR, Shift-IR, Exit1-DR or Exit1-IR state */ - if (exit == EXITMODE_IDLE) { + if (tap_exit == EXITMODE_IDLE) { chain_defer_clock( chain, 1, 0, 1 ); /* Update-DR or Update-IR */ chain_defer_clock( chain, 0, 0, 1 ); /* Run-Test/Idle */ - } else if (exit == EXITMODE_UPDATE) + } else if (tap_exit == EXITMODE_UPDATE) chain_defer_clock( chain, 1, 0, 1 ); /* Update-DR or Update-IR */ } void -tap_shift_register_output( chain_t *chain, const tap_register *in, tap_register *out, int exit ) +tap_shift_register_output( chain_t *chain, const tap_register *in, tap_register *out, int tap_exit ) { if(out != NULL) { int j; j = in->len; - if(exit) j--; + if (tap_exit) j--; if(out && out->len < j) j = out->len; /* Asking for the result of the cable transfer @@ -118,10 +118,10 @@ tap_shift_register_output( chain_t *chain, const tap_register *in, tap_register } void -tap_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int exit ) +tap_shift_register( chain_t *chain, const tap_register *in, tap_register *out, int tap_exit ) { - tap_defer_shift_register( chain, in, out, exit ); - tap_shift_register_output( chain, in, out, exit ); + tap_defer_shift_register( chain, in, out, tap_exit ); + tap_shift_register_output( chain, in, out, tap_exit ); } void