summaryrefslogtreecommitdiffstats
path: root/vncviewer
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 /vncviewer
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 'vncviewer')
-rw-r--r--vncviewer/CConn.cxx2
-rw-r--r--vncviewer/cocoa.mm4
-rw-r--r--vncviewer/parameters.cxx12
3 files changed, 9 insertions, 9 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index cf4f31b9..5935c177 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -134,7 +134,7 @@ CConn::~CConn()
{
OptionsDialog::removeCallback(handleOptions);
- for (int i = 0; i < sizeof(decoders)/sizeof(decoders[0]); i++)
+ for (size_t i = 0; i < sizeof(decoders)/sizeof(decoders[0]); i++)
delete decoders[i];
if (desktop)
diff --git a/vncviewer/cocoa.mm b/vncviewer/cocoa.mm
index 09921000..e51cba9d 100644
--- a/vncviewer/cocoa.mm
+++ b/vncviewer/cocoa.mm
@@ -57,7 +57,7 @@ int cocoa_capture_display(Fl_Window *win, bool all_displays)
if (CGGetActiveDisplayList(16, displays, &count) != kCGErrorSuccess)
return 1;
- if (count != Fl::screen_count())
+ if (count != (unsigned)Fl::screen_count())
return 1;
#ifdef HAVE_FLTK_FULLSCREEN_SCREENS
@@ -424,7 +424,7 @@ int cocoa_event_keysym(const void *event)
NSEvent *nsevent;
UInt16 key_code;
- int i;
+ size_t i;
NSString *chars;
UInt32 modifiers;
diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx
index 184af08f..29a5397d 100644
--- a/vncviewer/parameters.cxx
+++ b/vncviewer/parameters.cxx
@@ -202,7 +202,7 @@ static bool encodeValue(const char* val, char* dest, size_t destSize) {
} else {
- for (int j = 0; j < sizeof(replaceMap)/sizeof(replaceMap[0]); j++) {
+ for (size_t j = 0; j < sizeof(replaceMap)/sizeof(replaceMap[0]); j++) {
if (val[i] == replaceMap[j].first) {
dest[pos] = '\\';
@@ -242,7 +242,7 @@ static bool decodeValue(const char* val, char* dest, size_t destSize) {
// Check for escape sequences
if (val[i] == '\\') {
- for (int j = 0; j < sizeof(replaceMap)/sizeof(replaceMap[0]); j++) {
+ for (size_t j = 0; j < sizeof(replaceMap)/sizeof(replaceMap[0]); j++) {
if (val[i+1] == replaceMap[j].second) {
dest[pos] = replaceMap[j].first;
escapedCharacter = true;
@@ -413,7 +413,7 @@ static void saveToReg(const char* servername) {
setKeyString("ServerName", servername, &hKey);
- for (int i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
+ for (size_t i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
if (dynamic_cast<StringParameter*>(parameterArray[i]) != NULL) {
setKeyString(parameterArray[i]->getName(), *(StringParameter*)parameterArray[i], &hKey);
} else if (dynamic_cast<IntParameter*>(parameterArray[i]) != NULL) {
@@ -459,7 +459,7 @@ static char* loadFromReg() {
int intValue = 0;
char stringValue[buffersize];
- for (int i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
+ for (size_t i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
if (dynamic_cast<StringParameter*>(parameterArray[i]) != NULL) {
if (getKeyString(parameterArray[i]->getName(), stringValue, buffersize, &hKey))
parameterArray[i]->setParam(stringValue);
@@ -523,7 +523,7 @@ void saveViewerParameters(const char *filename, const char *servername) {
if (encodeValue(servername, encodingBuffer, buffersize))
fprintf(f, "ServerName=%s\n", encodingBuffer);
- for (int i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
+ for (size_t i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
if (dynamic_cast<StringParameter*>(parameterArray[i]) != NULL) {
if (encodeValue(*(StringParameter*)parameterArray[i], encodingBuffer, buffersize))
fprintf(f, "%s=%s\n", ((StringParameter*)parameterArray[i])->getName(), encodingBuffer);
@@ -635,7 +635,7 @@ char* loadViewerParameters(const char *filename) {
} else {
// Find and set the correct parameter
- for (int i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
+ for (size_t i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) {
if (dynamic_cast<StringParameter*>(parameterArray[i]) != NULL) {
if (strcasecmp(line, ((StringParameter*)parameterArray[i])->getName()) == 0) {