Utilize ARRAY_SIZE macro

This commit is contained in:
CTCaer
2020-11-15 13:56:45 +02:00
parent 55568b037f
commit 669e42960c
6 changed files with 11 additions and 10 deletions

View File

@@ -25,6 +25,8 @@
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
#define OFFSET_OF(t, m) ((u32)&((t *)NULL)->m)
#define CONTAINER_OF(mp, t, mn) ((t *)((u32)mp - OFFSET_OF(t, mn)))