aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Common
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-08-23 10:39:04 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-08-23 10:39:04 +0000
commitcff190b8f47416698f3783e1e7711f0864713f73 (patch)
tree8407b1a1e71021bca28abd4784804251733f4ed5 /LUFA/Common
parent2d9f98b592c41a0b79eb6d15122fc00f4f91c836 (diff)
downloadlufa-cff190b8f47416698f3783e1e7711f0864713f73.tar.gz
lufa-cff190b8f47416698f3783e1e7711f0864713f73.tar.bz2
lufa-cff190b8f47416698f3783e1e7711f0864713f73.zip
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).
Diffstat (limited to 'LUFA/Common')
-rw-r--r--LUFA/Common/Common.h4
1 files changed, 2 insertions, 2 deletions
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__)