# HG changeset patch # User sergeig # Date 1332257998 0 # Node ID 80f232caf539442266e2e8e137da458f56d7f9e3 # Parent 5512149f0f36c13712a0f7be9a00db198fbd9d8f * tests/except1.cxx (cause_exception): Fix compiler warning about variable that is set but not used. Enter CYGBLD_ATTRIB_UNUSED. * tests/kexcept1.c (cause_exception): Ditto. * tests/kmbox1.c (entry1): Fix compiler warning about variable that is set but not used. Use by a conditional CYGMTH_MBOX_PUT_CAN_WAIT. * tests/mbox1.cxx (entry1): Ditto. * tests/tm_basic.cxx (run_thread_tests, run_mbox_tests, run_flag_tests): Remove unused variables. diff --git a/packages/kernel/current/ChangeLog b/packages/kernel/current/ChangeLog --- a/packages/kernel/current/ChangeLog +++ b/packages/kernel/current/ChangeLog @@ -1,3 +1,15 @@ +2012-03-19 Sergei Gavrikov + Jonathan Larmour + + * tests/except1.cxx (cause_exception): Fix compiler warning about + variable that is set but not used. Enter CYGBLD_ATTRIB_UNUSED. + * tests/kexcept1.c (cause_exception): Ditto. + * tests/kmbox1.c (entry1): Fix compiler warning about variable that + is set but not used. Use by a conditional CYGMTH_MBOX_PUT_CAN_WAIT. + * tests/mbox1.cxx (entry1): Ditto. + * tests/tm_basic.cxx (run_thread_tests, run_mbox_tests, + run_flag_tests): Remove unused variables. + 2012-03-06 Grant Edwards * src/intr/intr.cxx (attach): Fix compiler warning about unused diff --git a/packages/kernel/current/tests/except1.cxx b/packages/kernel/current/tests/except1.cxx --- a/packages/kernel/current/tests/except1.cxx +++ b/packages/kernel/current/tests/except1.cxx @@ -122,7 +122,7 @@ cause_fpe(int num) void cause_exception(void) { - int x; + int x CYGBLD_ATTRIB_UNUSED; unsigned int p=0; // First try for an address exception (unaligned access exception diff --git a/packages/kernel/current/tests/kexcept1.c b/packages/kernel/current/tests/kexcept1.c --- a/packages/kernel/current/tests/kexcept1.c +++ b/packages/kernel/current/tests/kexcept1.c @@ -131,7 +131,7 @@ cause_fpe(int num) void cause_exception(void) { - int x; + int x CYGBLD_ATTRIB_UNUSED; unsigned int p=0; // First try for an address exception (unaligned access exception diff --git a/packages/kernel/current/tests/kmbox1.c b/packages/kernel/current/tests/kmbox1.c --- a/packages/kernel/current/tests/kmbox1.c +++ b/packages/kernel/current/tests/kmbox1.c @@ -151,8 +151,10 @@ static void entry0( cyg_addrword_t data static void entry1( cyg_addrword_t data ) { +#ifdef CYGMTH_MBOX_PUT_CAN_WAIT cyg_count8 i; i = (cyg_count8)cyg_mbox_get(m1); +#endif CYG_TEST_CHECK(1==q++, "bad synchronization"); cyg_mbox_PUT(m0, (void *)3); // wake t0 diff --git a/packages/kernel/current/tests/mbox1.cxx b/packages/kernel/current/tests/mbox1.cxx --- a/packages/kernel/current/tests/mbox1.cxx +++ b/packages/kernel/current/tests/mbox1.cxx @@ -151,11 +151,15 @@ static void entry0( CYG_ADDRWORD data ) static void entry1( CYG_ADDRWORD data ) { +#ifdef CYGMTH_MBOX_PUT_CAN_WAIT cyg_count8 i; +#endif Cyg_Thread::self()->set_priority(5); +#ifdef CYGMTH_MBOX_PUT_CAN_WAIT i = (cyg_count8)m1.get(); +#endif CYG_TEST_CHECK(1==q++, "bad synchronization"); m0.PUT((void *)3); // wake t0 diff --git a/packages/kernel/current/tests/tm_basic.cxx b/packages/kernel/current/tests/tm_basic.cxx --- a/packages/kernel/current/tests/tm_basic.cxx +++ b/packages/kernel/current/tests/tm_basic.cxx @@ -507,7 +507,6 @@ void run_thread_tests(void) { int i; - cyg_priority_t prio; // Set my priority higher than any I plan to create cyg_thread_set_priority(cyg_thread_self(), 2); @@ -563,7 +562,7 @@ run_thread_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < ntest_threads; i++) { HAL_CLOCK_READ(&thread_ft[i].start); - prio = cyg_thread_get_priority(threads[i]); + cyg_thread_get_priority(threads[i]); HAL_CLOCK_READ(&thread_ft[i].end); } show_times(thread_ft, ntest_threads, "Get priority"); @@ -844,8 +843,7 @@ run_mutex_circuit_test(void) void run_mbox_tests(void) { - int i, cnt; - void *item; + int i; // Mailbox primitives wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { @@ -858,7 +856,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - cnt = cyg_mbox_peek(test_mbox_handles[i]); + cyg_mbox_peek(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Peek [empty] mbox"); @@ -875,7 +873,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - cnt = cyg_mbox_peek(test_mbox_handles[i]); + cyg_mbox_peek(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Peek [1 msg] mbox"); @@ -891,7 +889,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - cnt = cyg_mbox_peek(test_mbox_handles[i]); + cyg_mbox_peek(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Peek [2 msgs] mbox"); @@ -899,7 +897,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - item = cyg_mbox_get(test_mbox_handles[i]); + cyg_mbox_get(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Get [first] mbox"); @@ -907,7 +905,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - item = cyg_mbox_get(test_mbox_handles[i]); + cyg_mbox_get(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Get [second] mbox"); @@ -924,7 +922,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - item = cyg_mbox_peek_item(test_mbox_handles[i]); + cyg_mbox_peek_item(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Peek item [non-empty] mbox"); @@ -932,7 +930,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - item = cyg_mbox_tryget(test_mbox_handles[i]); + cyg_mbox_tryget(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Tryget [non-empty] mbox"); @@ -940,7 +938,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - item = cyg_mbox_peek_item(test_mbox_handles[i]); + cyg_mbox_peek_item(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Peek item [empty] mbox"); @@ -948,7 +946,7 @@ run_mbox_tests(void) wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nmboxes; i++) { HAL_CLOCK_READ(&mbox_ft[i].start); - item = cyg_mbox_tryget(test_mbox_handles[i]); + cyg_mbox_tryget(test_mbox_handles[i]); HAL_CLOCK_READ(&mbox_ft[i].end); } show_times(mbox_ft, nmboxes, "Tryget [empty] mbox"); @@ -1160,7 +1158,6 @@ void run_flag_tests(void) { int i; - cyg_flag_value_t val; wait_for_tick(); // Wait until the next clock tick to minimize aberations for (i = 0; i < nflags; i++) { @@ -1239,7 +1236,7 @@ run_flag_tests(void) for (i = 0; i < nflags; i++) { cyg_flag_setbits(&test_flags[i], 0x11); HAL_CLOCK_READ(&flag_ft[i].start); - val = cyg_flag_peek(&test_flags[i]); + cyg_flag_peek(&test_flags[i]); HAL_CLOCK_READ(&flag_ft[i].end); } show_times(flag_ft, nflags, "Peek on flag");