From 5c58f80d97dc44e3263c7144ef12a5d976ada46f Mon Sep 17 00:00:00 2001 From: Casper Hornstrup Date: Sun, 27 Aug 2000 16:44:02 +0000 Subject: [PATCH] Fixed user32.dll so it will compile svn path=/trunk/; revision=1320 --- reactos/lib/user32/controls/edit.c | 3 --- reactos/lib/user32/controls/listbox.c | 2 -- reactos/lib/user32/controls/menu.c | 1 - reactos/lib/user32/controls/scroll.c | 3 --- reactos/lib/user32/graphics/rect.c | 17 +++++++++-------- reactos/lib/user32/internal/dce.c | 8 ++++---- reactos/lib/user32/internal/menu.c | 14 +++++++------- reactos/lib/user32/internal/nc.c | 25 +++++++++++++------------ reactos/lib/user32/internal/scroll.c | 1 - reactos/lib/user32/internal/winpos.c | 8 ++++---- reactos/lib/user32/windows/msgbox.c | 2 +- 11 files changed, 38 insertions(+), 46 deletions(-) diff --git a/reactos/lib/user32/controls/edit.c b/reactos/lib/user32/controls/edit.c index 26e7cfbc338..a3c8db6bfe1 100644 --- a/reactos/lib/user32/controls/edit.c +++ b/reactos/lib/user32/controls/edit.c @@ -20,9 +20,6 @@ #include #include -#define MAX(x,y) x > y ? x : y -#define MIN(x,y) x < y ? x : y - #define BUFLIMIT_MULTI 65534 /* maximum buffer size (not including '\0') FIXME: BTW, new specs say 65535 (do you dare ???) */ #define BUFLIMIT_SINGLE 766 /* maximum buffer size (not including '\0') */ diff --git a/reactos/lib/user32/controls/listbox.c b/reactos/lib/user32/controls/listbox.c index 8cf352023dd..2468e164104 100644 --- a/reactos/lib/user32/controls/listbox.c +++ b/reactos/lib/user32/controls/listbox.c @@ -14,8 +14,6 @@ #define MAX_DOS_DRIVES 26 -#define MAX(x,y) x > y ? x : y -#define MIN(x,y) x < y ? x : y #define abs(x) ((x) < 0 ? -(x) : (x)) #define WM_LBTRACKPOINT 0x0131 diff --git a/reactos/lib/user32/controls/menu.c b/reactos/lib/user32/controls/menu.c index 322925dcf89..b98ad791f14 100644 --- a/reactos/lib/user32/controls/menu.c +++ b/reactos/lib/user32/controls/menu.c @@ -13,7 +13,6 @@ */ - #include #include #include diff --git a/reactos/lib/user32/controls/scroll.c b/reactos/lib/user32/controls/scroll.c index 8a6fb710a42..9c454ae42e7 100644 --- a/reactos/lib/user32/controls/scroll.c +++ b/reactos/lib/user32/controls/scroll.c @@ -13,9 +13,6 @@ #include #include -#define MAX(x,y) x > y ? x : y -#define MIN(x,y) x < y ? x : y - static HBITMAP hUpArrow = 0; static HBITMAP hDnArrow = 0; static HBITMAP hLfArrow = 0; diff --git a/reactos/lib/user32/graphics/rect.c b/reactos/lib/user32/graphics/rect.c index 923f1fc3059..da304865569 100644 --- a/reactos/lib/user32/graphics/rect.c +++ b/reactos/lib/user32/graphics/rect.c @@ -6,6 +6,7 @@ */ #include +#include WINBOOL STDCALL @@ -149,10 +150,10 @@ IntersectRect( SetRectEmpty( lprcDst ); return FALSE; } - lprcDst->left = max( lprcSrc1->left, lprcSrc2->left ); - lprcDst->right = min( lprcSrc1->right, lprcSrc2->right ); - lprcDst->top = max( lprcSrc1->top, lprcSrc2->top ); - lprcDst->bottom = min( lprcSrc1->bottom, lprcSrc2->bottom ); + lprcDst->left = MAX( lprcSrc1->left, lprcSrc2->left ); + lprcDst->right = MIN( lprcSrc1->right, lprcSrc2->right ); + lprcDst->top = MAX( lprcSrc1->top, lprcSrc2->top ); + lprcDst->bottom = MIN( lprcSrc1->bottom, lprcSrc2->bottom ); return TRUE; } @@ -180,10 +181,10 @@ WINBOOL STDCALL UnionRect( LPRECT lprcDst, const RECT *lprcSrc1, *lprcDst = *lprcSrc1; else { - lprcDst->left = min( lprcSrc1->left, lprcSrc2->left ); - lprcDst->right = max( lprcSrc1->right, lprcSrc2->right ); - lprcDst->top = min( lprcSrc1->top, lprcSrc2->top ); - lprcDst->bottom = max( lprcSrc1->bottom, lprcSrc2->bottom ); + lprcDst->left = MIN( lprcSrc1->left, lprcSrc2->left ); + lprcDst->right = MAX( lprcSrc1->right, lprcSrc2->right ); + lprcDst->top = MIN( lprcSrc1->top, lprcSrc2->top ); + lprcDst->bottom = MAX( lprcSrc1->bottom, lprcSrc2->bottom ); } } return TRUE; diff --git a/reactos/lib/user32/internal/dce.c b/reactos/lib/user32/internal/dce.c index 33ef045e1e7..4de2132cc05 100644 --- a/reactos/lib/user32/internal/dce.c +++ b/reactos/lib/user32/internal/dce.c @@ -152,10 +152,10 @@ WINBOOL DCE_GetVisRect( WND *wndPtr, WINBOOL clientArea, RECT *lprect ) (lprect->bottom <= wndPtr->rectClient.top) ) 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 ); } OffsetRect( lprect, -xoffset, -yoffset ); return TRUE; diff --git a/reactos/lib/user32/internal/menu.c b/reactos/lib/user32/internal/menu.c index e4fe07039f8..6235ba51da4 100644 --- a/reactos/lib/user32/internal/menu.c +++ b/reactos/lib/user32/internal/menu.c @@ -583,9 +583,9 @@ void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, GetTextExtentPointW( hdc, lpitem->text, wcslen(lpitem->text), &szSize ); lpitem->rect.right += LOWORD(szSize.cx); if (TWEAK_WineLook == WIN31_LOOK) - lpitem->rect.bottom += max( HIWORD(szSize.cy), SYSMETRICS_CYMENU ); + lpitem->rect.bottom += MAX( HIWORD(szSize.cy), SYSMETRICS_CYMENU ); else - lpitem->rect.bottom += max(HIWORD(szSize.cy), sysMetrics[SM_CYMENU]- 1); + lpitem->rect.bottom += MAX(HIWORD(szSize.cy), sysMetrics[SM_CYMENU]- 1); lpitem->xTab = 0; if (menuBar) lpitem->rect.right += MENU_BAR_ITEMS_SPACE; @@ -645,24 +645,24 @@ void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner ) MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, FALSE ); if (lpitem->fType & MF_MENUBARBREAK) orgX++; - maxX = max( maxX, lpitem->rect.right ); + maxX = MAX( maxX, lpitem->rect.right ); orgY = lpitem->rect.bottom; if (IS_STRING_ITEM(lpitem->fType) && lpitem->xTab) { - maxTab = max( maxTab, lpitem->xTab ); - maxTabWidth = max(maxTabWidth,lpitem->rect.right-lpitem->xTab); + maxTab = MAX( maxTab, lpitem->xTab ); + maxTabWidth = MAX(maxTabWidth,lpitem->rect.right-lpitem->xTab); } } /* Finish the column (set all items to the largest width found) */ - maxX = max( maxX, maxTab + maxTabWidth ); + maxX = MAX( maxX, maxTab + maxTabWidth ); for (lpitem = &lppop->items[start]; start < i; start++, lpitem++) { lpitem->rect.right = maxX; if (IS_STRING_ITEM(lpitem->fType) && lpitem->xTab) lpitem->xTab = maxTab; } - lppop->Height = max( lppop->Height, orgY ); + lppop->Height = MAX( lppop->Height, orgY ); } diff --git a/reactos/lib/user32/internal/nc.c b/reactos/lib/user32/internal/nc.c index a5dcf345570..d8c3b3084aa 100644 --- a/reactos/lib/user32/internal/nc.c +++ b/reactos/lib/user32/internal/nc.c @@ -3,6 +3,7 @@ #include #include #include +#include // GetBitmapDimensionEx in NC_DrawMaxButton95 returns TRUE on invalid bitmap @@ -1784,23 +1785,23 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam ) SetRect(&mouseRect, 0, 0, SYSMETRICS_CXSCREEN, SYSMETRICS_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) { @@ -1858,10 +1859,10 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam ) 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/reactos/lib/user32/internal/scroll.c b/reactos/lib/user32/internal/scroll.c index a4e660a0a26..c3224f140b7 100644 --- a/reactos/lib/user32/internal/scroll.c +++ b/reactos/lib/user32/internal/scroll.c @@ -14,7 +14,6 @@ #include #define MAKEINTRESOURCEA(x) "x" -#define MAX(x,y) x > y ? x : y static HBITMAP hUpArrow = 0; static HBITMAP hDnArrow = 0; diff --git a/reactos/lib/user32/internal/winpos.c b/reactos/lib/user32/internal/winpos.c index 3213c96eebe..5bebc05ae06 100644 --- a/reactos/lib/user32/internal/winpos.c +++ b/reactos/lib/user32/internal/winpos.c @@ -415,9 +415,9 @@ void WINPOS_GetMinMaxInfo( WND *wndPtr, POINT *maxSize, POINT *maxPos, /* Some sanity checks */ - 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; @@ -885,8 +885,8 @@ LONG WINPOS_HandleWindowPosChanging( WND *wndPtr, WINDOWPOS *winpos ) ((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; } diff --git a/reactos/lib/user32/windows/msgbox.c b/reactos/lib/user32/windows/msgbox.c index 94865416d73..640f8b84968 100644 --- a/reactos/lib/user32/windows/msgbox.c +++ b/reactos/lib/user32/windows/msgbox.c @@ -279,7 +279,7 @@ LRESULT CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,WPARAM wParam, LPARAM l lRet = DrawTextA( hdc, lpmb->lpszText, -1, &rect, DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT); theight = rect.bottom - rect.top; - tiheight = 16 + max(iheight, theight); + tiheight = 16 + MAX(iheight, theight); ReleaseDC(hItem, hdc); /* Position the text */