diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-10-07 17:43:18 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-10-09 10:11:57 -0500 |
commit | 51a95ff9df21288bd03e467ca38af7bb8d9b7ef8 (patch) | |
tree | 46093b4c81ef42a1a8af46b6345f522b44b71454 /testsuites/samples/unlimited/init.c | |
parent | m68k/rtems/score/cpu.h: _CPU_Context_Restart_self needed RTEMS_COMPILER_NO_RE... (diff) | |
download | rtems-51a95ff9df21288bd03e467ca38af7bb8d9b7ef8.tar.bz2 |
samples/unlimited: Fix printf() warning and clean up
Diffstat (limited to 'testsuites/samples/unlimited/init.c')
-rw-r--r-- | testsuites/samples/unlimited/init.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/testsuites/samples/unlimited/init.c b/testsuites/samples/unlimited/init.c index 06e0c3ac8c..002a9736e4 100644 --- a/testsuites/samples/unlimited/init.c +++ b/testsuites/samples/unlimited/init.c @@ -55,20 +55,21 @@ rtems_task Init( rtems_task test_task( rtems_task_argument my_number - ) +) { rtems_event_set out; + unsigned int my_n = (unsigned int) my_number; - printf( "task %" PRIdrtems_task_argument " has started.\n", my_number); + printf( "task %u has started.\n", my_n); rtems_event_receive(1, RTEMS_WAIT | RTEMS_EVENT_ANY, 0, &out); - printf( "task %" PRIdrtems_task_argument " ending.\n", my_number); + printf( "task %u ending.\n", my_n); rtems_task_delete(RTEMS_SELF); } -void destory_all_tasks( +void destroy_all_tasks( const char *who ) { @@ -78,19 +79,23 @@ void destory_all_tasks( * If the id is not zero, signal the task to delete. */ - for (task = 0; task < MAX_TASKS; task++) - if (task_id[task]) - { - printf(" %s : signal task %08" PRIxrtems_id " to delete, ", who, task_id[task]); + for (task = 0; task < MAX_TASKS; task++) { + if (task_id[task]) { + printf( + " %s : signal task %08" PRIxrtems_id " to delete, ", + who, + task_id[task] + ); fflush(stdout); rtems_event_send(task_id[task], 1); task_id[task] = 0; } + } } bool status_code_bad( rtems_status_code status_code - ) +) { if (status_code != RTEMS_SUCCESSFUL) { |