Fix bad signed/unsigned comparisons

Either by casting, or switching to a more appropriate type
for the variable.
diff --git a/common/rdr/FileInStream.cxx b/common/rdr/FileInStream.cxx
index 6d23aa2..8d5c22e 100644
--- a/common/rdr/FileInStream.cxx
+++ b/common/rdr/FileInStream.cxx
@@ -58,7 +58,7 @@
 
 int FileInStream::overrun(int itemSize, int nItems, bool wait)
 {
-  if (itemSize > sizeof(b))
+  if (itemSize > (int)sizeof(b))
     throw Exception("FileInStream overrun: max itemSize exceeded");
 
   if (end - ptr != 0)
diff --git a/common/rdr/RandomStream.cxx b/common/rdr/RandomStream.cxx
index 7056c2c..3fde18d 100644
--- a/common/rdr/RandomStream.cxx
+++ b/common/rdr/RandomStream.cxx
@@ -44,7 +44,7 @@
 #ifdef RFB_HAVE_WINCRYPT
   provider = 0;
   if (!CryptAcquireContext(&provider, 0, 0, PROV_RSA_FULL, 0)) {
-    if (GetLastError() == NTE_BAD_KEYSET) {
+    if (GetLastError() == (DWORD)NTE_BAD_KEYSET) {
       if (!CryptAcquireContext(&provider, 0, 0, PROV_RSA_FULL, CRYPT_NEWKEYSET)) {
         fprintf(stderr, "RandomStream: unable to create keyset\n");
         provider = 0;
diff --git a/common/rdr/TLSInStream.cxx b/common/rdr/TLSInStream.cxx
index 4d2c9ec..21b6056 100644
--- a/common/rdr/TLSInStream.cxx
+++ b/common/rdr/TLSInStream.cxx
@@ -44,7 +44,7 @@
       return -1;
     }
 
-    if (in->getend() - in->getptr() < size)
+    if (in->getend() - in->getptr() < (ptrdiff_t)size)
       size = in->getend() - in->getptr();
   
     in->readBytes(data, size);
diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx
index e632387..4e133d3 100644
--- a/common/rfb/EncodeManager.cxx
+++ b/common/rfb/EncodeManager.cxx
@@ -152,7 +152,7 @@
 
 void EncodeManager::logStats()
 {
-  int i, j;
+  size_t i, j;
 
   unsigned rects;
   unsigned long long pixels, bytes, equivalent;
@@ -603,7 +603,7 @@
   Encoder *encoder;
 
   struct RectInfo info;
-  int divisor, maxColours;
+  unsigned int divisor, maxColours;
 
   bool useRLE;
   EncoderType type;
diff --git a/common/rfb/TightEncoder.cxx b/common/rfb/TightEncoder.cxx
index ec19c2e..fe2470b 100644
--- a/common/rfb/TightEncoder.cxx
+++ b/common/rfb/TightEncoder.cxx
@@ -201,7 +201,7 @@
   }
 
   while (count) {
-    int iter_count;
+    unsigned int iter_count;
 
     iter_count = sizeof(rgb)/3;
     if (iter_count > count)
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index 51cb86c..199524e 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -544,7 +544,7 @@
   if (!deferPending)
     return true;
 
-  if (msSince(&deferStart) >= deferUpdateTime)
+  if (msSince(&deferStart) >= (unsigned)deferUpdateTime)
     return true;
 
   return false;