summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-06-03 13:37:32 -0400
committerAdam Jackson <ajax@redhat.com>2009-06-03 13:45:42 -0400
commite1e8c7ddd7fdbfd674361364295fb1cbd5f28b45 (patch)
tree52945278e94746acfb4c01fd5f81b0af19aaa5ea /miext
parent7f027d9dc0146e229802aeac342ea2dbab63264a (diff)
s/MIN/min/, s/MAX/max/ (#2968)
Diffstat (limited to 'miext')
-rw-r--r--miext/rootless/rootlessCommon.c4
-rw-r--r--miext/rootless/rootlessCommon.h7
-rw-r--r--miext/rootless/rootlessScreen.c16
3 files changed, 11 insertions, 16 deletions
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index 97c92d309..e3dd9d97c 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -109,8 +109,8 @@ RootlessResolveColormap (ScreenPtr pScreen, int first_color,
map = RootlessGetColormap (pScreen);
if (map == NULL || map->class != PseudoColor) return FALSE;
- last = MIN (map->pVisual->ColormapEntries, first_color + n_colors);
- for (i = MAX (0, first_color); i < last; i++) {
+ last = min (map->pVisual->ColormapEntries, first_color + n_colors);
+ for (i = max (0, first_color); i < last; i++) {
Entry *ent = map->red + i;
uint16_t red, green, blue;
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index a92f1f1e4..ba121c0f4 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -36,6 +36,7 @@
#ifndef _ROOTLESSCOMMON_H
#define _ROOTLESSCOMMON_H
+#include "misc.h"
#include "rootless.h"
#include "fb.h"
@@ -120,12 +121,6 @@ typedef struct _RootlessScreenRec {
unsigned int colormap_changed :1;
} RootlessScreenRec, *RootlessScreenPtr;
-
-#undef MIN
-#define MIN(x,y) ((x) < (y) ? (x) : (y))
-#undef MAX
-#define MAX(x,y) ((x) > (y) ? (x) : (y))
-
// "Definition of the Porting Layer for the X11 Sample Server" says
// unwrap and rewrap of screen functions is unnecessary, but
// screen->CreateGC changes after a call to cfbCreateGC.
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 88d38698b..b10ca70eb 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -200,10 +200,10 @@ RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
x1 = x0 + w;
y1 = y0 + h;
- x0 = MAX (x0, winRec->x);
- y0 = MAX (y0, winRec->y);
- x1 = MIN (x1, winRec->x + winRec->width);
- y1 = MIN (y1, winRec->y + winRec->height);
+ x0 = max (x0, winRec->x);
+ y0 = max (y0, winRec->y);
+ x1 = min (x1, winRec->x + winRec->width);
+ y1 = min (y1, winRec->y + winRec->height);
sx = x0 - pDrawable->x;
sy = y0 - pDrawable->y;
@@ -347,10 +347,10 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
x2 = x1 + glyph->info.width;
y2 = y1 + glyph->info.height;
- box.x1 = MAX (box.x1, x1);
- box.y1 = MAX (box.y1, y1);
- box.x2 = MAX (box.x2, x2);
- box.y2 = MAX (box.y2, y2);
+ box.x1 = max (box.x1, x1);
+ box.y1 = max (box.y1, y1);
+ box.x2 = max (box.x2, x2);
+ box.y2 = max (box.y2, y2);
x += glyph->info.xOff;
y += glyph->info.yOff;