From 1cd3ddaa54f0e750fe1b00ccdc228894510a48c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20=C3=85strand?= Date: Tue, 9 Dec 2008 11:17:28 +0000 Subject: [PATCH] MinGW tweak: use __rfbmax/__rfbmin instead of max/min, just like most other files. (There are other variants in use as well: vncmax/vncmin, max/min, MAX/MIN.) git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3337 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- win/vncviewer/DesktopWindow.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx index e282a283..243d1b51 100644 --- a/win/vncviewer/DesktopWindow.cxx +++ b/win/vncviewer/DesktopWindow.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -363,8 +364,8 @@ char* DesktopWindow::getMonitor() const { bool DesktopWindow::setViewportOffset(const Point& tl) { - Point np = Point(max(0, min(tl.x, buffer->width()-client_size.width())), - max(0, min(tl.y, buffer->height()-client_size.height()))); + Point np = Point(__rfbmax(0, __rfbmin(tl.x, buffer->width()-client_size.width())), + __rfbmax(0, __rfbmin(tl.y, buffer->height()-client_size.height()))); Point delta = np.translate(scrolloffset.negate()); if (!np.equals(scrolloffset)) { scrolloffset = np; @@ -1219,8 +1220,8 @@ void DesktopWindow::calculateScrollBars() { si.nMin = 0; si.nMax = buffer->height(); si.nPage = buffer->height() - (reqd_size.height() - window_size.height()); - maxscrolloffset.y = max(0, si.nMax-si.nPage); - scrolloffset.y = min(maxscrolloffset.y, scrolloffset.y); + maxscrolloffset.y = __rfbmax(0, si.nMax-si.nPage); + scrolloffset.y = __rfbmin(maxscrolloffset.y, scrolloffset.y); si.nPos = scrolloffset.y; SetScrollInfo(frameHandle, SB_VERT, &si, TRUE); } @@ -1230,8 +1231,8 @@ void DesktopWindow::calculateScrollBars() { si.nMin = 0; si.nMax = buffer->width(); si.nPage = buffer->width() - (reqd_size.width() - window_size.width()); - maxscrolloffset.x = max(0, si.nMax-si.nPage); - scrolloffset.x = min(maxscrolloffset.x, scrolloffset.x); + maxscrolloffset.x = __rfbmax(0, si.nMax-si.nPage); + scrolloffset.x = __rfbmin(maxscrolloffset.x, scrolloffset.x); si.nPos = scrolloffset.x; SetScrollInfo(frameHandle, SB_HORZ, &si, TRUE); } -- 2.39.5