util: squelch clang cast alignment warning caused by container_of()
This commit is contained in:
parent
3098a3cda5
commit
0a817e84ec
@ -3,6 +3,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
@ -12,8 +13,10 @@ typedef intptr_t ssize_t;
|
||||
|
||||
#define array_count(a) (sizeof(a) / (sizeof((a)[0])))
|
||||
|
||||
/* clang-format off */
|
||||
#define container_of(ptr, type, member) \
|
||||
((type*) ((char*) (ptr) -offsetof(type, member)))
|
||||
((type*) ((uintptr_t) (ptr) - offsetof(type, member)))
|
||||
/* clang-format on */
|
||||
|
||||
#define unused_var(v) ((void) (v))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user