mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-29 13:42:11 +00:00
Prevent ALIGN_DOWN() from overflowing.
This commit is contained in:
parent
1d0cc9c45b
commit
c3555431d4
1 changed files with 2 additions and 2 deletions
|
@ -53,8 +53,8 @@
|
||||||
|
|
||||||
#define BIT_LONG(n) (1UL << (n))
|
#define BIT_LONG(n) (1UL << (n))
|
||||||
|
|
||||||
#define ALIGN_UP(x, y) ((((y) - 1) + (x)) & ~((y) - 1))
|
#define ALIGN_UP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
|
||||||
#define ALIGN_DOWN(x, y) (((x) - ((y) - 1)) & ~((y) - 1))
|
#define ALIGN_DOWN(x, y) ((x) > (y) ? (((x) - ((y) - 1)) & ~((y) - 1)) : 0)
|
||||||
#define IS_ALIGNED(x, y) (((x) & ((y) - 1)) == 0)
|
#define IS_ALIGNED(x, y) (((x) & ((y) - 1)) == 0)
|
||||||
|
|
||||||
#define IS_POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0)
|
#define IS_POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0)
|
||||||
|
|
Loading…
Reference in a new issue