Eliminate GCC signed/unsigned warnings related to encodings: The
encoding in the RFB protocol has always been signed, and signed values
are also used in the specification (ie DesktopName = -307 etc). In the
code, however, unsigned types were used in a number of places, but not
all, which causes warnings. This patch fixes the problem by switching
to signed values everywhere.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3968 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/Encoder.cxx b/common/rfb/Encoder.cxx
index 53cb170..b0bd147 100644
--- a/common/rfb/Encoder.cxx
+++ b/common/rfb/Encoder.cxx
@@ -32,19 +32,19 @@
EncoderCreateFnType Encoder::createFns[encodingMax+1] = { 0 };
-bool Encoder::supported(unsigned int encoding)
+bool Encoder::supported(int encoding)
{
return encoding <= encodingMax && createFns[encoding];
}
-Encoder* Encoder::createEncoder(unsigned int encoding, SMsgWriter* writer)
+Encoder* Encoder::createEncoder(int encoding, SMsgWriter* writer)
{
if (encoding <= encodingMax && createFns[encoding])
return (*createFns[encoding])(writer);
return 0;
}
-void Encoder::registerEncoder(unsigned int encoding,
+void Encoder::registerEncoder(int encoding,
EncoderCreateFnType createFn)
{
if (encoding > encodingMax)
@@ -56,7 +56,7 @@
createFns[encoding] = createFn;
}
-void Encoder::unregisterEncoder(unsigned int encoding)
+void Encoder::unregisterEncoder(int encoding)
{
if (encoding > encodingMax)
throw Exception("Encoder::unregisterEncoder: encoding out of range");