[common] array: add ALIGN_PAD macro for common logic

ALIGN_PAD(x, a) returns x rounded up to the nearest multiple of a.
This commit is contained in:
Quantum
2021-08-13 06:53:56 -04:00
committed by Geoffrey McRae
parent 712dcee07f
commit e5d252290d
3 changed files with 5 additions and 2 deletions

View File

@@ -22,5 +22,6 @@
#define _LG_ARRAY_H_
#define ARRAY_LENGTH(arr) (sizeof(arr) / sizeof(*(arr)))
#define ALIGN_PAD(value, align) (((value) + (align) - 1) & -(align))
#endif