Changeset 050adc2 in rtems


Ignore:
Timestamp:
Oct 20, 2011, 11:58:54 AM (8 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.11, master
Children:
9356119
Parents:
9495580
Message:

2011-10-20 Ralf Corsépius <ralf.corsepius@…>

  • score/include/rtems/score/rbtree.h (_RBTree_Container_of): Use offsetof. Don't cast to size_t. Include <stddef.h>.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r9495580 r050adc2  
    112011-10-20      Ralf Corsépius <ralf.corsepius@rtems.org>
    22
     3        * score/include/rtems/score/rbtree.h (_RBTree_Container_of):
     4        Use offsetof. Don't cast to size_t. Include <stddef.h>.
    35        * libnetworking/libc/res_mkupdate.c (res_mkupdate):
    46        Remove unused var "sp1".
  • cpukit/score/include/rtems/score/rbtree.h

    r9495580 r050adc2  
    1818#ifndef _RTEMS_SCORE_RBTREE_H
    1919#define _RTEMS_SCORE_RBTREE_H
     20
     21#include <stddef.h>
    2022
    2123/**
     
    8991 */
    9092#define _RBTree_Container_of(node,container_type, node_field_name) \
    91 ((container_type*) \
    92  ((size_t)node - ((size_t)(&((container_type *)0)->node_field_name))))
     93  ((container_type*) (node - offsetof(container_type,node_field_name)))
    9394
    9495/**
Note: See TracChangeset for help on using the changeset viewer.