Changeset 5697c28 in rtems for c/src/libmisc/stackchk


Ignore:
Timestamp:
09/18/96 20:55:53 (28 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
d6b2bba
Parents:
be95da0
Message:

pointer arithmetic reworked to be more portable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/libmisc/stackchk/check.c

    rbe95da0 r5697c28  
    8585
    8686#define Stack_check_Get_pattern_area( _the_stack ) \
    87   ((Stack_check_Control *) \
    88     ((_the_stack)->area + (_the_stack)->size - sizeof( Stack_check_Control ) ))
     87  ((Stack_check_Control *) ((char *)(_the_stack)->area + \
     88      (_the_stack)->size - sizeof( Stack_check_Control ) ))
    8989
    9090#define Stack_check_Calculate_used( _low, _size, _high_water ) \
    91     ((_high_water) - (_low))
     91    ((char *)(_high_water) - (char *)(_low))
    9292
    9393#define Stack_check_usable_stack_start(_the_stack) \
     
    9797
    9898#define Stack_check_Get_pattern_area( _the_stack ) \
    99   ((Stack_check_Control *) ((_the_stack)->area + HEAP_OVERHEAD))
     99  ((Stack_check_Control *) ((char *)(_the_stack)->area + HEAP_OVERHEAD))
    100100
    101101#define Stack_check_Calculate_used( _low, _size, _high_water) \
    102     ( ((_low) + (_size)) - (_high_water) )
     102    ( ((char *)(_low) + (_size)) - (char *)(_high_water) )
    103103
    104104#define Stack_check_usable_stack_start(_the_stack) \
    105     ((_the_stack)->area + sizeof(Stack_check_Control))
     105    ((char *)(_the_stack)->area + sizeof(Stack_check_Control))
    106106
    107107#endif
     
    225225  {
    226226      stack_check_interrupt_stack.area = _CPU_Interrupt_stack_low;
    227       stack_check_interrupt_stack.size = _CPU_Interrupt_stack_high -
    228                                               _CPU_Interrupt_stack_low;
     227      stack_check_interrupt_stack.size = (char *) _CPU_Interrupt_stack_high -
     228                                              (char *) _CPU_Interrupt_stack_low;
    229229
    230230      stack_check_dope_stack(&stack_check_interrupt_stack);
Note: See TracChangeset for help on using the changeset viewer.