diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-22 19:10:04 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-22 19:10:04 +0000 |
commit | 4e1304dcb9d11c2b66c5f0239542d65acda40790 (patch) | |
tree | ddf1d95dae751bf68374e800835c37f8fd64f56e | |
parent | 2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-4e1304dcb9d11c2b66c5f0239542d65acda40790.tar.bz2 |
2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/src/threadqfirst.c: Remove switch.
-rw-r--r-- | cpukit/ChangeLog | 4 | ||||
-rw-r--r-- | cpukit/score/src/threadqfirst.c | 19 |
2 files changed, 10 insertions, 13 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 29b2767801..65f5314b29 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,9 @@ 2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com> + * score/src/threadqfirst.c: Remove switch. + +2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com> + * rtems/include/rtems/rtems/event.h, rtems/inline/rtems/rtems/eventset.inl, rtems/src/event.c, rtems/src/eventseize.c, rtems/src/eventsurrender.c, diff --git a/cpukit/score/src/threadqfirst.c b/cpukit/score/src/threadqfirst.c index 9112b0ab72..8e268b87d9 100644 --- a/cpukit/score/src/threadqfirst.c +++ b/cpukit/score/src/threadqfirst.c @@ -43,19 +43,12 @@ Thread_Control *_Thread_queue_First( Thread_queue_Control *the_thread_queue ) { - Thread_Control *the_thread; + Thread_Control * (*first_p)(Thread_queue_Control *); - switch ( the_thread_queue->discipline ) { - case THREAD_QUEUE_DISCIPLINE_FIFO: - the_thread = _Thread_queue_First_fifo( the_thread_queue ); - break; - case THREAD_QUEUE_DISCIPLINE_PRIORITY: - the_thread = _Thread_queue_First_priority( the_thread_queue ); - break; - default: /* this is only to prevent warnings */ - the_thread = NULL; - break; - } + if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) + first_p = _Thread_queue_First_priority; + else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ + first_p = _Thread_queue_First_fifo; - return the_thread; + return (*first_p)( the_thread_queue ); } |