mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
macro/align: Fix ALIGN_UP and ALIGN_DOWN
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
committed by
Xiang Xiao
parent
558fe83f6d
commit
1d8ce18d7f
@@ -48,7 +48,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_UP
|
||||
# define ALIGN_UP(x,a) (((x) + ((a) - 1)) & ~((a) - 1))
|
||||
# define ALIGN_UP(x,a) ((((x) + (a) - 1) / (a)) * (a))
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_UP_MASK
|
||||
@@ -56,7 +56,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_DOWN
|
||||
# define ALIGN_DOWN(x,a) ((x) & (~((a) - 1)))
|
||||
# define ALIGN_DOWN(x,a) (((x) / (a)) * (a))
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_DOWN_MASK
|
||||
|
||||
Reference in New Issue
Block a user