Use min/max instead of MIN/MAX.
diff --git a/windows/cursoricon.c b/windows/cursoricon.c index afcca46..08b3b8a 100644 --- a/windows/cursoricon.c +++ b/windows/cursoricon.c
@@ -499,7 +499,7 @@ */ if ((pInfo = (BITMAPINFO *)HeapAlloc( GetProcessHeap(), 0, - MAX(size, sizeof(BITMAPINFOHEADER) + 2*sizeof(RGBQUAD))))) + max(size, sizeof(BITMAPINFOHEADER) + 2*sizeof(RGBQUAD))))) { memcpy( pInfo, bmi, size ); pInfo->bmiHeader.biHeight /= 2;
diff --git a/windows/dce.c b/windows/dce.c index 78f1123..5b14309 100644 --- a/windows/dce.c +++ b/windows/dce.c
@@ -411,10 +411,10 @@ goto fail; } - lprect->left = MAX( lprect->left, wndPtr->rectClient.left ); - lprect->right = MIN( lprect->right, wndPtr->rectClient.right ); - lprect->top = MAX( lprect->top, wndPtr->rectClient.top ); - lprect->bottom = MIN( lprect->bottom, wndPtr->rectClient.bottom ); + lprect->left = max( lprect->left, wndPtr->rectClient.left ); + lprect->right = min( lprect->right, wndPtr->rectClient.right ); + lprect->top = max( lprect->top, wndPtr->rectClient.top ); + lprect->bottom = min( lprect->bottom, wndPtr->rectClient.bottom ); WIN_ReleaseWndPtr(wndPtr); }
diff --git a/windows/msgbox.c b/windows/msgbox.c index 4d6db88..9fa8a0a 100644 --- a/windows/msgbox.c +++ b/windows/msgbox.c
@@ -155,7 +155,7 @@ } } } - bw = MAX(bw, bh * 2); + bw = max(bw, bh * 2); /* Button white space */ bh = bh * 2; bw = bw * 2; @@ -168,14 +168,14 @@ DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT); /* Min text width corresponds to space for the buttons */ tleft = 2 * ileft + iwidth; - twidth = MAX((bw + bspace) * buttons + bspace - tleft, rect.right); + twidth = max((bw + bspace) * buttons + bspace - tleft, rect.right); theight = rect.bottom; if (hFont) SelectObject(hdc, hPrevFont); ReleaseDC(hItem, hdc); - tiheight = 16 + MAX(iheight, theight); + tiheight = 16 + max(iheight, theight); wwidth = tleft + twidth + ileft + borwidth; wheight = 8 + tiheight + bh + borheight;
diff --git a/windows/nonclient.c b/windows/nonclient.c index 6394790..8b0edd8 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c
@@ -2157,23 +2157,23 @@ SetRect(&mouseRect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); if (ON_LEFT_BORDER(hittest)) { - mouseRect.left = MAX( mouseRect.left, sizingRect.right-maxTrack.x ); - mouseRect.right = MIN( mouseRect.right, sizingRect.right-minTrack.x ); + mouseRect.left = max( mouseRect.left, sizingRect.right-maxTrack.x ); + mouseRect.right = min( mouseRect.right, sizingRect.right-minTrack.x ); } else if (ON_RIGHT_BORDER(hittest)) { - mouseRect.left = MAX( mouseRect.left, sizingRect.left+minTrack.x ); - mouseRect.right = MIN( mouseRect.right, sizingRect.left+maxTrack.x ); + mouseRect.left = max( mouseRect.left, sizingRect.left+minTrack.x ); + mouseRect.right = min( mouseRect.right, sizingRect.left+maxTrack.x ); } if (ON_TOP_BORDER(hittest)) { - mouseRect.top = MAX( mouseRect.top, sizingRect.bottom-maxTrack.y ); - mouseRect.bottom = MIN( mouseRect.bottom,sizingRect.bottom-minTrack.y); + mouseRect.top = max( mouseRect.top, sizingRect.bottom-maxTrack.y ); + mouseRect.bottom = min( mouseRect.bottom,sizingRect.bottom-minTrack.y); } else if (ON_BOTTOM_BORDER(hittest)) { - mouseRect.top = MAX( mouseRect.top, sizingRect.top+minTrack.y ); - mouseRect.bottom = MIN( mouseRect.bottom, sizingRect.top+maxTrack.y ); + mouseRect.top = max( mouseRect.top, sizingRect.top+minTrack.y ); + mouseRect.bottom = min( mouseRect.bottom, sizingRect.top+maxTrack.y ); } if (wndPtr->dwStyle & WS_CHILD) { @@ -2231,10 +2231,10 @@ case VK_RIGHT: pt.x += 8; break; } - pt.x = MAX( pt.x, mouseRect.left ); - pt.x = MIN( pt.x, mouseRect.right ); - pt.y = MAX( pt.y, mouseRect.top ); - pt.y = MIN( pt.y, mouseRect.bottom ); + pt.x = max( pt.x, mouseRect.left ); + pt.x = min( pt.x, mouseRect.right ); + pt.y = max( pt.y, mouseRect.top ); + pt.y = min( pt.y, mouseRect.bottom ); dx = pt.x - capturePoint.x; dy = pt.y - capturePoint.y;
diff --git a/windows/rect.c b/windows/rect.c index 1717cf8..1f48e77 100644 --- a/windows/rect.c +++ b/windows/rect.c
@@ -183,10 +183,10 @@ SetRectEmpty16( dest ); return FALSE; } - dest->left = MAX( src1->left, src2->left ); - dest->right = MIN( src1->right, src2->right ); - dest->top = MAX( src1->top, src2->top ); - dest->bottom = MIN( src1->bottom, src2->bottom ); + dest->left = max( src1->left, src2->left ); + dest->right = min( src1->right, src2->right ); + dest->top = max( src1->top, src2->top ); + dest->bottom = min( src1->bottom, src2->bottom ); return TRUE; } @@ -204,10 +204,10 @@ SetRectEmpty( dest ); return FALSE; } - dest->left = MAX( src1->left, src2->left ); - dest->right = MIN( src1->right, src2->right ); - dest->top = MAX( src1->top, src2->top ); - dest->bottom = MIN( src1->bottom, src2->bottom ); + dest->left = max( src1->left, src2->left ); + dest->right = min( src1->right, src2->right ); + dest->top = max( src1->top, src2->top ); + dest->bottom = min( src1->bottom, src2->bottom ); return TRUE; } @@ -232,10 +232,10 @@ if (IsRectEmpty16(src2)) *dest = *src1; else { - dest->left = MIN( src1->left, src2->left ); - dest->right = MAX( src1->right, src2->right ); - dest->top = MIN( src1->top, src2->top ); - dest->bottom = MAX( src1->bottom, src2->bottom ); + dest->left = min( src1->left, src2->left ); + dest->right = max( src1->right, src2->right ); + dest->top = min( src1->top, src2->top ); + dest->bottom = max( src1->bottom, src2->bottom ); } } return TRUE; @@ -262,10 +262,10 @@ if (IsRectEmpty(src2)) *dest = *src1; else { - dest->left = MIN( src1->left, src2->left ); - dest->right = MAX( src1->right, src2->right ); - dest->top = MIN( src1->top, src2->top ); - dest->bottom = MAX( src1->bottom, src2->bottom ); + dest->left = min( src1->left, src2->left ); + dest->right = max( src1->right, src2->right ); + dest->top = min( src1->top, src2->top ); + dest->bottom = max( src1->bottom, src2->bottom ); } } return TRUE;
diff --git a/windows/timer.c b/windows/timer.c index b724780..8a33d4a 100644 --- a/windows/timer.c +++ b/windows/timer.c
@@ -255,7 +255,7 @@ if (proc) WINPROC_SetProc( &pTimer->proc, proc, type, WIN_PROC_TIMER ); pTimer->expired = FALSE; - pTimer->hService = SERVICE_AddTimer( MAX( timeout * 1000L, SYS_TIMER_RATE ), + pTimer->hService = SERVICE_AddTimer( max( timeout * 1000L, SYS_TIMER_RATE ), TIMER_CheckTimer, (ULONG_PTR)pTimer ); TRACE("Timer added: %p, %04x, %04x, %04x, %08lx\n",
diff --git a/windows/user.c b/windows/user.c index c8b3f6b..7d4a735 100644 --- a/windows/user.c +++ b/windows/user.c
@@ -69,7 +69,7 @@ default: return 0; } - return (WORD)MIN( userPercent, gdiPercent ); + return (WORD)min( userPercent, gdiPercent ); }
diff --git a/windows/winpos.c b/windows/winpos.c index ba42028..f615246 100644 --- a/windows/winpos.c +++ b/windows/winpos.c
@@ -1142,9 +1142,9 @@ MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y, MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y, MinMax.ptMinTrackSize.x, MinMax.ptMinTrackSize.y); - MinMax.ptMaxTrackSize.x = MAX( MinMax.ptMaxTrackSize.x, + MinMax.ptMaxTrackSize.x = max( MinMax.ptMaxTrackSize.x, MinMax.ptMinTrackSize.x ); - MinMax.ptMaxTrackSize.y = MAX( MinMax.ptMaxTrackSize.y, + MinMax.ptMaxTrackSize.y = max( MinMax.ptMaxTrackSize.y, MinMax.ptMinTrackSize.y ); if (maxSize) *maxSize = MinMax.ptMaxSize; @@ -2087,8 +2087,8 @@ ((wndPtr->dwStyle & (WS_POPUP | WS_CHILD)) == 0)) { WINPOS_GetMinMaxInfo( wndPtr, &maxSize, NULL, NULL, NULL ); - winpos->cx = MIN( winpos->cx, maxSize.x ); - winpos->cy = MIN( winpos->cy, maxSize.y ); + winpos->cx = min( winpos->cx, maxSize.x ); + winpos->cy = min( winpos->cy, maxSize.y ); } return 0; } @@ -2239,8 +2239,8 @@ r.left = Wnd->rectClient.left - Wnd->rectWindow.left; r.top = Wnd->rectClient.top - Wnd->rectWindow.top; - r.right = r.left + MIN( ocw, ncw ); - r.bottom = r.top + MIN( och, nch ); + r.right = r.left + min( ocw, ncw ); + r.bottom = r.top + min( och, nch ); REGION_CropRgn( hrgnValid, hrgnValid, &r, (uFlags & SWP_EX_PAINTSELF) ? NULL : (POINT*)&(Wnd->rectWindow));
diff --git a/windows/winproc.c b/windows/winproc.c index 861e8eb..7b6893e 100644 --- a/windows/winproc.c +++ b/windows/winproc.c
@@ -1620,7 +1620,7 @@ case LB_GETSELITEMS: { LPINT16 items; - *pwparam16 = (WPARAM16)MIN( wParam32, 0x7f80 ); /* Must be < 64K */ + *pwparam16 = (WPARAM16)min( wParam32, 0x7f80 ); /* Must be < 64K */ if (!(items = SEGPTR_ALLOC( *pwparam16 * sizeof(INT16) + sizeof(LPARAM)))) return -1; *((LPARAM *)items)++ = *plparam; /* Store the previous lParam */ @@ -1633,7 +1633,7 @@ { INT i; LPINT16 stops; - *pwparam16 = (WPARAM16)MIN( wParam32, 0x7f80 ); /* Must be < 64K */ + *pwparam16 = (WPARAM16)min( wParam32, 0x7f80 ); /* Must be < 64K */ if (!(stops = SEGPTR_ALLOC( *pwparam16 * sizeof(INT16) + sizeof(LPARAM)))) return -1; for (i = 0; i < *pwparam16; i++) stops[i] = *((LPINT)*plparam+i); @@ -1765,7 +1765,7 @@ case WM_GETTEXT: { LPSTR str; - *pwparam16 = (WPARAM16)MIN( wParam32, 0xff80 ); /* Must be < 64K */ + *pwparam16 = (WPARAM16)min( wParam32, 0xff80 ); /* Must be < 64K */ if (!(str = SEGPTR_ALLOC(*pwparam16 + sizeof(LPARAM)))) return -1; *((LPARAM *)str)++ = *plparam; /* Store the previous lParam */ *plparam = (LPARAM)SEGPTR_GET(str);