Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 5b382774 in mainline


Ignore:
Timestamp:
2012-07-24T14:19:58Z (9 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master
Children:
4a6da62
Parents:
2696a76
Message:

Added member_to_inst() to macros.h in uspace and kernel.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/macros.h

    r2696a76 r5b382774  
    131131        })
    132132
     133
     134#ifndef member_to_inst
     135#define member_to_inst(ptr_member, type, member_identif) \
     136        ((type*) (((void*)(ptr_member)) - ((void*)&(((type*)0)->member_identif))))
     137#endif
     138
     139
    133140#endif
    134141
  • uspace/lib/c/include/adt/list.h

    r2696a76 r5b382774  
    102102                iterator = next_iter, next_iter = iterator->next)
    103103
    104 #ifndef member_to_inst
    105 #define member_to_inst(ptr_member, type, member_identif) \
    106         ((type*) (((void*)(ptr_member)) - ((void*)&(((type*)0)->member_identif))))
    107 #endif
    108 
    109 
    110104#define assert_link_not_used(link) \
    111105        assert(((link)->prev == NULL) && ((link)->next == NULL))
  • uspace/lib/c/include/macros.h

    r2696a76 r5b382774  
    5252            | ((((uint64_t) (up)) & 0xffffffff) << 32))
    5353
     54#ifndef member_to_inst
     55#define member_to_inst(ptr_member, type, member_identif) \
     56        ((type*) (((void*)(ptr_member)) - ((void*)&(((type*)0)->member_identif))))
     57#endif
     58
     59
    5460#endif
    5561
  • uspace/lib/nic/src/nic_addr_db.c

    r2696a76 r5b382774  
    3535 * @brief Generic hash-set based database of addresses
    3636 */
     37#include "nic_addr_db.h"
    3738#include <assert.h>
    3839#include <stdlib.h>
     
    4041#include <errno.h>
    4142#include <mem.h>
    42 
    43 #include "nic_addr_db.h"
    44 #include "adt/hash_table.h"
    45 //#include "string.h"
     43#include <adt/hash_table.h>
     44#include <macros.h>
     45
    4646
    4747
Note: See TracChangeset for help on using the changeset viewer.