summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-03-03 16:26:03 +0100
committerPierre Ossman <ossman@cendio.se>2015-03-03 16:26:03 +0100
commit5c23b9ed7d55a2cd5f44b8ec3da2c8bdcac5c3a5 (patch)
tree8c3438ffdacb5188cae93df720219fb96c242505 /win
parenta7bbe9c4a3b2090240173e45bebab86e5cba3b4b (diff)
downloadtigervnc-5c23b9ed7d55a2cd5f44b8ec3da2c8bdcac5c3a5.tar.gz
tigervnc-5c23b9ed7d55a2cd5f44b8ec3da2c8bdcac5c3a5.zip
Fix bad signed/unsigned comparisons
Either by casting, or switching to a more appropriate type for the variable.
Diffstat (limited to 'win')
-rw-r--r--win/rfb_win32/CleanDesktop.cxx2
-rw-r--r--win/rfb_win32/TsSessions.cxx4
-rw-r--r--win/vncconfig/Connections.h6
3 files changed, 6 insertions, 6 deletions
diff --git a/win/rfb_win32/CleanDesktop.cxx b/win/rfb_win32/CleanDesktop.cxx
index 52dc6bd7..bad95f0a 100644
--- a/win/rfb_win32/CleanDesktop.cxx
+++ b/win/rfb_win32/CleanDesktop.cxx
@@ -129,7 +129,7 @@ struct ActiveDesktop {
vlog.error("failed to get desktop item count: %ld", hr);
return false;
}
- for (unsigned int i=0; i<itemCount; i++) {
+ for (int i=0; i<itemCount; i++) {
if (enableItem(i, false))
restoreItems.insert(i);
}
diff --git a/win/rfb_win32/TsSessions.cxx b/win/rfb_win32/TsSessions.cxx
index efe75640..a4fac2f9 100644
--- a/win/rfb_win32/TsSessions.cxx
+++ b/win/rfb_win32/TsSessions.cxx
@@ -48,7 +48,7 @@ namespace win32 {
id = 0;
if (!_ProcessIdToSessionId.isValid())
return;
- if (processId == -1)
+ if (processId == (DWORD)-1)
processId = GetCurrentProcessId();
if (!(*_ProcessIdToSessionId)(GetCurrentProcessId(), &id))
throw rdr::SystemException("ProcessIdToSessionId", GetLastError());
@@ -72,7 +72,7 @@ namespace win32 {
#ifdef RFB_HAVE_WINSTATION_CONNECT
if (!_WinStationConnect.isValid())
throw rdr::Exception("WinSta APIs missing");
- if (sessionId == -1)
+ if (sessionId == (DWORD)-1)
sessionId = mySessionId.id;
// Try to reconnect our session to the console
diff --git a/win/vncconfig/Connections.h b/win/vncconfig/Connections.h
index 209e4fd8..6176f3dc 100644
--- a/win/vncconfig/Connections.h
+++ b/win/vncconfig/Connections.h
@@ -117,11 +117,11 @@ namespace rfb {
case IDC_HOSTS:
{
DWORD selected = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCURSEL, 0, 0);
- int count = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCOUNT, 0, 0);
- bool enable = selected != LB_ERR;
+ DWORD count = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCOUNT, 0, 0);
+ bool enable = selected != (DWORD)LB_ERR;
enableItem(IDC_HOST_REMOVE, enable);
enableItem(IDC_HOST_UP, enable && (selected > 0));
- enableItem(IDC_HOST_DOWN, enable && (selected < count-1));
+ enableItem(IDC_HOST_DOWN, enable && (selected+1 < count));
enableItem(IDC_HOST_EDIT, enable);
setChanged(isChanged());
}