aboutsummaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2008-12-09 11:17:28 +0000
committerPeter Åstrand <astrand@cendio.se>2008-12-09 11:17:28 +0000
commit1cd3ddaa54f0e750fe1b00ccdc228894510a48c7 (patch)
treeb96092ddcd7647d2259aa1446115270a61e6a88a /win
parent2ae73a3022cb31eaebc4f9fe9e4501a97133cf92 (diff)
downloadtigervnc-1cd3ddaa54f0e750fe1b00ccdc228894510a48c7.tar.gz
tigervnc-1cd3ddaa54f0e750fe1b00ccdc228894510a48c7.zip
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
Diffstat (limited to 'win')
-rw-r--r--win/vncviewer/DesktopWindow.cxx13
1 files 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 <rfb_win32/DeviceContext.h>
#include <rfb_win32/Win32Util.h>
#include <rfb_win32/MsgBox.h>
+#include <rfb/util.h>
#include <vncviewer/DesktopWindow.h>
#include <vncviewer/resource.h>
@@ -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);
}