From 9b371f3282468fe5b5f698656a60b3c6d4ae16ea Mon Sep 17 00:00:00 2001 From: gewlitys Date: Wed, 4 Dec 2002 02:44:52 +0000 Subject: [PATCH] Changed min,max to MIN,MAX and define them little better git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@310 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/boxint.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/boxint.c b/sc2/src/sc2code/libs/graphics/boxint.c index 8eaee46c1..e85d32932 100644 --- a/sc2/src/sc2code/libs/graphics/boxint.c +++ b/sc2/src/sc2code/libs/graphics/boxint.c @@ -18,8 +18,10 @@ #include "gfxintrn.h" -#define min(a, b) ((a <= b) ? a : b) -#define max(a, b) ((a >= b) ? a : b) +#undef MIN +#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) +#undef MAX +#define MAX(a, b) (((a) >= (b)) ? (a) : (b)) INTERSECT_CODE BoxIntersect (PRECT pr1, PRECT pr2, PRECT pinter) @@ -105,12 +107,12 @@ BoxUnion (PRECT pr1, PRECT pr2, PRECT punion) COORD x2, y2, w2, h2; // Union is A AND B, put together, correct? Returns a bigger box that // encompasses the two. - punion->corner.x = min(pr1->corner.x, pr2->corner.x); - punion->corner.y = min(pr1->corner.y, pr2->corner.y); + punion->corner.x = MIN(pr1->corner.x, pr2->corner.x); + punion->corner.y = MIN(pr1->corner.y, pr2->corner.y); - punion->extent.width = max(pr1->corner.x + pr1->extent.width, + punion->extent.width = MAX(pr1->corner.x + pr1->extent.width, pr2->corner.x + pr2->extent.width) - punion->corner.x; - punion->extent.height = max(pr1->corner.y + pr1->extent.height, + punion->extent.height = MAX(pr1->corner.y + pr1->extent.height, pr2->corner.y + pr2->extent.height) - punion->corner.y;