Unverified Commit fad80bc4 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/drop_double_min_max' into 3.6.x

parents b517b66e 3bd41aaf
......@@ -25,6 +25,7 @@
#include "dixstruct.h"
#include "../../fb/fb.h"
#include "misc.h"
#include "Agent.h"
#include "Display.h"
......@@ -696,11 +697,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
for (y = box.y1; y < box.y2; y += h)
{
h = MIN(box.y2 - y, tileHeight);
h = min(box.y2 - y, tileHeight);
for (x = box.x1; x < box.x2; x += w)
{
w = MIN(box.x2 - x, tileWidth);
w = min(box.x2 - x, tileWidth);
/*
* FIXME: This should not occur.
......
......@@ -1415,7 +1415,7 @@ static Bool nxagentGetFontServerPath(char * fontServerPath, int size)
if (len)
{
snprintf(fontServerPath, MIN(size, len + 1), "%s", path + 1);
snprintf(fontServerPath, min(size, len + 1), "%s", path + 1);
#ifdef TEST
fprintf(stderr, "nxagentGetFontServerPath: Got path [%s].\n",
......
......@@ -431,7 +431,7 @@ void nxagentDumpKeystrokes(void)
{
int maxlen = 0;
for (int i = 0; nxagentSpecialKeystrokeNames[i]; i++)
maxlen = MAX(maxlen, strlen(nxagentSpecialKeystrokeNames[i]));
maxlen = min(maxlen, strlen(nxagentSpecialKeystrokeNames[i]));
fprintf(stderr, "Current known keystrokes:\n");
......
......@@ -55,6 +55,7 @@ is" without express or implied warranty.
#include "../../randr/randrstr.h"
#include "inputstr.h"
#include "mivalidate.h"
#include "misc.h"
#include "Agent.h"
#include "Display.h"
......@@ -3641,10 +3642,10 @@ Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,
return FALSE;
}
tx1 = MAX(ax1, bx1);
ty1 = MAX(ay1, by1);
tx2 = MIN(ax2, bx2);
ty2 = MIN(ay2, by2);
tx1 = max(ax1, bx1);
ty1 = max(ay1, by1);
tx2 = min(ax2, bx2);
ty2 = min(ay2, by2);
ix = tx1 - ax1;
iy = ty1 - ay1;
......@@ -4022,10 +4023,10 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
bbx1 = bby1 = INT_MAX;
for (i = 0; i < number; i++) {
bbx2 = MAX(bbx2, screeninfo[i].x_org + screeninfo[i].width);
bby2 = MAX(bby2, screeninfo[i].y_org + screeninfo[i].height);
bbx1 = MIN(bbx1, screeninfo[i].x_org);
bby1 = MIN(bby1, screeninfo[i].y_org);
bbx2 = max(bbx2, screeninfo[i].x_org + screeninfo[i].width);
bby2 = max(bby2, screeninfo[i].y_org + screeninfo[i].height);
bbx1 = min(bbx1, screeninfo[i].x_org);
bby1 = min(bby1, screeninfo[i].y_org);
}
#ifdef DEBUG
fprintf(stderr, "nxagentAdjustRandRXinerama: bounding box: left [%d] right [%d] top [%d] bottom [%d]\n", bbx1, bbx2, bby1, bby2);
......
......@@ -40,14 +40,6 @@
#define nxagentScale(i, ratio) (((i) * (ratio)) >> (PRECISION))
#ifndef MIN
#define MIN(A, B) ( (A) < (B) ? (A) : (B) )
#endif
#ifndef MAX
#define MAX(A, B) ( (A) > (B) ? (A) : (B) );
#endif
static inline const char * validateString(const char *str) {
return str ? str : "(null)";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment