diff --git a/kernel/inc/utils/math.h b/kernel/inc/utils/math.h index 26d3cea..2ef7a10 100644 --- a/kernel/inc/utils/math.h +++ b/kernel/inc/utils/math.h @@ -27,10 +27,10 @@ #include "stdtypes.h" #include "string.h" -#define MAX(a, b) (a > b ? a : b) -#define MIN(a, b) (a > b ? b : a) -#define CEIL_TO(a, b) (a % b ? a + b - (a % b) : a) -#define FLOOR_TO(a, b) (a - (a % b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define MIN(a, b) ((a) > (b) ? (b) : (a)) +#define CEIL_TO(a, b) ((a) % (b) ? (a) + (b) - ((a) % (b)) : (a)) +#define FLOOR_TO(a, b) ((a) - ((a) % (b))) typedef struct { uint64_t x;