| 17 | typedef struct ptrint ptrint_t; |
| 18 | |
| 19 | CONST_FUNCTION static inline ptrdiff_t ptr2int(const ptrint_t *p) |
| 20 | { |
| 21 | /* |
| 22 | * ptrdiff_t is the right size by definition, but to avoid |
| 23 | * surprises we want a warning if the user can't fit at least |
| 24 | * a regular int in there |
| 25 | */ |
| 26 | BUILD_ASSERT(sizeof(int) <= sizeof(ptrdiff_t)); |
| 27 | return (const char *)p - (const char *)NULL; |
| 28 | } |
| 29 | |
| 30 | CONST_FUNCTION static inline ptrint_t *int2ptr(ptrdiff_t i) |
| 31 | { |
no outgoing calls