From ad8181cf4df9d9497ae4a0b3baa0d2c75ad0144c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Mon, 8 Apr 2013 22:24:19 +0200 Subject: [PATCH] Add UC_ROUND_DOWN, fix duplicated UC_ROUND_UP --- include/ucore/utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ucore/utils.h b/include/ucore/utils.h index f04410b..9adb19f 100644 --- a/include/ucore/utils.h +++ b/include/ucore/utils.h @@ -107,13 +107,13 @@ if (!(expr) ) {\ #define UC_ROUND_UP(x, y) (((x) / (y)) * (y)) /** - * Round x up to nearest multiple of y + * Round x down to nearest multiple of y * * @param x numerator, must be positive * @param y denominator * @return x rounded to nearest multiple of y */ -#define UC_ROUND_UP(x, y) (UC_DIV_ROUND_UP((x),(y)) * (y)) +#define UC_ROUND_DOWN(x, y) ((x) / (y) * (y)) #endif