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);