| 1 |
Description: Fix MIN/MAX macros |
| 2 |
These macros did not properly guard against operator precedence issues. |
| 3 |
Author: Simon Richter <[email protected]> |
| 4 |
Last-Update: 2013-01-08 |
| 5 |
|
| 6 |
Index: langford-0.0.20130228/langford.h |
| 7 |
=================================================================== |
| 8 |
--- langford-0.0.20130228.orig/langford.h |
| 9 |
+++ langford-0.0.20130228/langford.h |
| 10 |
@@ -109,7 +109,7 @@ typedef struct { |
| 11 |
/*Program macros*/ |
| 12 |
|
| 13 |
/**Given 2 numbers, return the larger one*/ |
| 14 |
|
| 15 |
+#define MAX(a, b) (((a) > (b)) ? (a) : (b)) |
| 16 |
|
| 17 |
/**Given 2 numbers, return the smaller one*/ |
| 18 |
|
| 19 |
+#define MIN(a, b) (((a) < (b)) ? (a) : (b)) |