Changeset 16b1546e in rtems


Ignore:
Timestamp:
Nov 4, 2010, 10:22:49 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 5, master
Children:
11236580
Parents:
a14b982
Message:

2010-11-04 Joel Sherrill <joel.sherrill@…>

  • libmisc/stackchk/check.c: Address casting issue highlighted by clang. There was no need for an intermediate cast to a structure pointer.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    ra14b982 r16b1546e  
     12010-11-04      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libmisc/stackchk/check.c: Address casting issue highlighted by clang.
     4        There was no need for an intermediate cast to a structure pointer.
     5
    162010-11-01      Alin Rus <alin.codejunkie@gmail.com>
    27
  • cpukit/libmisc/stackchk/check.c

    ra14b982 r16b1546e  
    8080 */
    8181#if (CPU_STACK_GROWS_UP == TRUE)
    82   #define Stack_check_Get_pattern_area( _the_stack ) \
    83     ((Stack_check_Control *) ((char *)(_the_stack)->area + \
     82  #define Stack_check_Get_pattern( _the_stack ) \
     83    ((char *)(_the_stack)->area + \
    8484         (_the_stack)->size - sizeof( Stack_check_Control ) ))
    8585
     
    9797   * for the free list into this area.
    9898   */
    99   #define Stack_check_Get_pattern_area( _the_stack ) \
    100     ((Stack_check_Control *) ((char *)(_the_stack)->area \
     99  #define Stack_check_Get_pattern( _the_stack ) \
     100    ((char *)(_the_stack)->area \
    101101      + sizeof(Heap_Block) - HEAP_BLOCK_HEADER_SIZE))
    102102
     
    108108
    109109#endif
     110
     111/*
     112 *  Obtain a properly typed pointer to the area to check.
     113 */
     114#define Stack_check_Get_pattern_area( _the_stack ) \
     115  ((Stack_check_Control *) Stack_check_Get_pattern( _the_stack )
    110116
    111117/*
     
    220226{
    221227  Stack_Control *stack = &running->Start.Initial_stack;
    222   void *pattern_area = Stack_check_Get_pattern_area(stack);
    223   char name [32];
     228  void          *pattern_area = Stack_check_Get_pattern(stack);
     229  char           name[32];
    224230
    225231  printk("BLOWN STACK!!!\n");
     
    271277  Stack_Control *the_stack = &running->Start.Initial_stack;
    272278  void          *pattern;
    273   bool        sp_ok;
    274   bool        pattern_ok = true;
    275 
    276   pattern = (void *) Stack_check_Get_pattern_area(the_stack)->pattern;
     279  bool           sp_ok;
     280  bool           pattern_ok = true;
     281
     282  pattern = Stack_check_Get_pattern_area(the_stack);
    277283
    278284  /*
     
    310316  if ( Stack_check_Initialized ) {
    311317    pattern_ok = (!memcmp(
    312       (void *) Stack_check_Get_pattern_area(the_stack)->pattern,
     318      Stack_check_Get_pattern(the_stack),
    313319      (void *) Stack_check_Pattern.pattern,
    314320      PATTERN_SIZE_BYTES
Note: See TracChangeset for help on using the changeset viewer.