mirror of
https://github.com/apache/nuttx.git
synced 2025-01-12 22:08:35 +08:00
macro/align: Fix ALIGN_UP and ALIGN_DOWN
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
parent
558fe83f6d
commit
1d8ce18d7f
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue