Fix cppcheck warning: The scope of the variable X can be reduced.

This commit is contained in:
Philippe Teuwen 2013-04-05 14:38:03 +02:00
parent fc144fe389
commit 9cb9e0e6da
5 changed files with 5 additions and 7 deletions

View file

@ -151,7 +151,6 @@ initiator_thread(void *arg)
void
test_dep_active(void)
{
int res;
nfc_baud_rate nbrs[3] = { NBR_106, NBR_212, NBR_424};
CutTestContext *test_context = cut_get_current_test_context();
@ -167,6 +166,7 @@ test_dep_active(void)
for (int i = 0; i < 3; i++) {
initiator_data.nbr = nbrs[i];
int res;
if ((res = pthread_create(&(threads[TARGET]), NULL, target_thread, &target_data)))
cut_fail("pthread_create() returned %d", res);

View file

@ -177,8 +177,6 @@ initiator_thread(void *arg)
void
test_dep_states(void)
{
int res;
CutTestContext *test_context = cut_get_current_test_context();
struct thread_data target_data = {
.device = first_device,
@ -191,6 +189,7 @@ test_dep_states(void)
};
for (int i = 0; i < 2; i++) {
int res;
if ((res = pthread_create(&(threads[1]), NULL, target_thread, &target_data)))
cut_fail("pthread_create() returned %d", res);