MCPcopy Create free account
hub / github.com/ElementsProject/lightning / ptr2int

Function ptr2int

ccan/ccan/ptrint/ptrint.h:19–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17typedef struct ptrint ptrint_t;
18
19CONST_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
30CONST_FUNCTION static inline ptrint_t *int2ptr(ptrdiff_t i)
31{

Callers 7

rehashFunction · 0.85
msg_map_removeFunction · 0.85
mainFunction · 0.85
keyFunction · 0.85
ptrint2chanFunction · 0.85
ptrint2nodeFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68