From cff190b8f47416698f3783e1e7711f0864713f73 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 23 Aug 2011 10:39:04 +0000 Subject: Minor documentation fixes. Add extra parenthesis around terms in the common MIN() and MAX() macros to prevent issues with non-trivial macro inputs (thanks to David Lyons). --- LUFA/Common/Common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'LUFA/Common') diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index e38d63efe..43df9fbe9 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -160,7 +160,7 @@ * \return The larger of the two input parameters */ #if !defined(MAX) || defined(__DOXYGEN__) - #define MAX(x, y) ((x > y) ? x : y) + #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #endif /** Convenience macro to determine the smaller of two values. @@ -174,7 +174,7 @@ * \return The smaller of the two input parameters */ #if !defined(MIN) || defined(__DOXYGEN__) - #define MIN(x, y) ((x < y) ? x : y) + #define MIN(x, y) (((x) < (y)) ? (x) : (y)) #endif #if !defined(STRINGIFY) || defined(__DOXYGEN__) -- cgit v1.2.3