diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-03-31 16:19:45 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-03-31 16:39:56 -0400 |
commit | 86f4b4f7180bca73a734249e67dada708f8275ff (patch) | |
tree | 408bdffc5001ce8180dc46f10d4cc04ea7c17d82 /src/config.h | |
parent | f75f3de63888702f29f48bcf2691291403720b9d (diff) | |
download | bfs-86f4b4f7180bca73a734249e67dada708f8275ff.tar.xz |
list: Use macros instead of type-erased lists
Diffstat (limited to 'src/config.h')
-rw-r--r-- | src/config.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/config.h b/src/config.h index cee8511..34ae11d 100644 --- a/src/config.h +++ b/src/config.h @@ -147,17 +147,6 @@ */ #define BFS_COUNTOF(array) (sizeof(array) / sizeof(0[array])) -// BFS_CONTAINER_OF() helper -static inline char *bfs_container_offset(char *ptr, ptrdiff_t offset, size_t unused) { - return ptr ? ptr - offset : NULL; -} - -/** - * Move a pointer from a field to its outer struct. - */ -#define BFS_CONTAINER_OF(ptr, type, member) \ - ((type *)bfs_container_offset((char *)(ptr), offsetof(type, member), sizeof((ptr) - &((type *)NULL)->member))) - // Lower bound on BFS_FLEX_SIZEOF() #define BFS_FLEX_LB(type, member, length) (offsetof(type, member) + sizeof(((type *)NULL)->member[0]) * (length)) |