From f6afc8ba57225e49a01afab52aaff028f4e6788a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 3 Dec 2013 19:42:43 +0100 Subject: [PATCH] Allow UC_MIN(UC_MAX(x,y),z), though only one nesting can be done. --- include/ucore/utils.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ucore/utils.h b/include/ucore/utils.h index f3bedef..39db850 100644 --- a/include/ucore/utils.h +++ b/include/ucore/utils.h @@ -14,15 +14,15 @@ //MAX of a and b #define UC_MAX(a,b) \ - ({ __typeof__ (a) _a = (a); \ - __typeof__ (b) _b = (b); \ - _a > _b ? _a : _b; }) + ({ __typeof__ (a) _amx = (a); \ + __typeof__ (b) _bmx = (b); \ + _amx > _bmx ? _amx : _bmx; }) //min of a and b #define UC_MIN(a,b) \ - ({ __typeof__ (a) _a = (a); \ - __typeof__ (b) _b = (b); \ - _a < _b ? _a : _b; }) + ({ __typeof__ (a) _amn = (a); \ + __typeof__ (b) _bmn = (b); \ + _amn < _bmn ? _amn : _bmn; }) #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))