Ignore:
Timestamp:
Nov 30, 2007, 9:49:41 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
a58ff1c
Parents:
393a1e05
Message:

2007-11-30 Joel Sherrill <joel.sherrill@…>

  • rtems/src/barrierdelete.c, rtems/src/barrierrelease.c, rtems/src/barriertranslatereturncode.c, rtems/src/barrierwait.c, rtems/src/clockget.c, rtems/src/dpmemdelete.c, rtems/src/dpmemexternal2internal.c, rtems/src/dpmeminternal2external.c, rtems/src/eventsend.c, rtems/src/eventtimeout.c, rtems/src/msgqbroadcast.c, rtems/src/msgqdelete.c, rtems/src/msgqflush.c, rtems/src/msgqgetnumberpending.c, rtems/src/msgqreceive.c, rtems/src/msgqsend.c, rtems/src/msgqurgent.c, rtems/src/partdelete.c, rtems/src/partgetbuffer.c, rtems/src/partreturnbuffer.c, rtems/src/ratemoncancel.c, rtems/src/ratemondelete.c, rtems/src/ratemongetstatistics.c, rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c, rtems/src/ratemonresetstatistics.c, rtems/src/ratemontimeout.c, rtems/src/semdelete.c, rtems/src/semflush.c, rtems/src/semobtain.c, rtems/src/semrelease.c, rtems/src/semtranslatereturncode.c, rtems/src/signalsend.c, rtems/src/taskdelete.c, rtems/src/taskgetnote.c, rtems/src/taskissuspended.c, rtems/src/taskrestart.c, rtems/src/taskresume.c, rtems/src/tasksetnote.c, rtems/src/tasksetpriority.c, rtems/src/taskstart.c, rtems/src/tasksuspend.c, rtems/src/taskvariableadd.c, rtems/src/taskvariabledelete.c, rtems/src/taskvariableget.c, rtems/src/timercancel.c, rtems/src/timerdelete.c, rtems/src/timerfirewhen.c, rtems/src/timergetinfo.c, rtems/src/timerreset.c, rtems/src/timerserverfireafter.c, rtems/src/timerserverfirewhen.c: Restructured all code with the switch (location) pattern so that OBJECTS_LOCAL is first and we can fall into it and the OBJECTS_ERROR case breaks to a return RTEMS_INVALID_ID. This eliminates the return RTEMS_INTERNAL_ERROR at the bottom of each of these files which was unreachable and untestable code. This resulted in a code savings of approximately 20 bytes per file on the SPARC/ERC32.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/msgqbroadcast.c

    r393a1e05 rebe61382  
    7373  the_message_queue = _Message_queue_Get( id, &location );
    7474  switch ( location ) {
     75
     76    case OBJECTS_LOCAL:
     77      core_status = _CORE_message_queue_Broadcast(
     78                      &the_message_queue->message_queue,
     79                      buffer,
     80                      size,
     81                      id,
     82                      #if defined(RTEMS_MULTIPROCESSING)
     83                        _Message_queue_Core_message_queue_mp_support,
     84                      #else
     85                        NULL,
     86                      #endif
     87                      count
     88                    );
     89
     90      _Thread_Enable_dispatch();
     91      return
     92        _Message_queue_Translate_core_message_queue_return_code( core_status );
     93
    7594#if defined(RTEMS_MULTIPROCESSING)
    7695    case OBJECTS_REMOTE:
     
    89108
    90109    case OBJECTS_ERROR:
    91       return RTEMS_INVALID_ID;
    92 
    93     case OBJECTS_LOCAL:
    94       core_status = _CORE_message_queue_Broadcast(
    95                       &the_message_queue->message_queue,
    96                       buffer,
    97                       size,
    98                       id,
    99 #if defined(RTEMS_MULTIPROCESSING)
    100                       _Message_queue_Core_message_queue_mp_support,
    101 #else
    102                       NULL,
    103 #endif
    104                       count
    105                     );
    106 
    107       _Thread_Enable_dispatch();
    108       return
    109         _Message_queue_Translate_core_message_queue_return_code( core_status );
    110 
     110      break;
    111111  }
    112   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     112  return RTEMS_INVALID_ID;
    113113}
Note: See TracChangeset for help on using the changeset viewer.