summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-12-06 17:55:45 +0200
committerAlon Levy <alevy@redhat.com>2010-12-08 17:11:45 +0200
commit1943352d6093ae27f1f4e80d786f4114be6032ac (patch)
treedd5ca4695ef94cd63d3ca991017917218e1de9f5 /client
parent06749bd66bb3e689bc96be1a3739747912ee0020 (diff)
downloadspice-1943352d6093ae27f1f4e80d786f4114be6032ac.tar.gz
spice-1943352d6093ae27f1f4e80d786f4114be6032ac.tar.xz
spice-1943352d6093ae27f1f4e80d786f4114be6032ac.zip
mingw32 build: fixed using -1 as uninitialized value for unsigned variables
Diffstat (limited to 'client')
-rw-r--r--client/red_client.cpp4
-rw-r--r--client/red_client.h2
-rw-r--r--client/red_peer.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/client/red_client.cpp b/client/red_client.cpp
index 4923f296..c632a216 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -351,7 +351,7 @@ RedClient::RedClient(Application& application)
, _mouse_mode (SPICE_MOUSE_MODE_SERVER)
, _notify_disconnect (false)
, _auto_display_res (false)
- , _agent_reply_wait_type (-1)
+ , _agent_reply_wait_type (VD_AGENT_END_MESSAGE)
, _aborting (false)
, _agent_connected (false)
, _agent_mon_config_sent (false)
@@ -1060,7 +1060,7 @@ void RedClient::on_agent_reply(VDAgentReply* reply)
if (_agent_reply_wait_type == reply->type) {
post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
_application.deactivate_interval_timer(*_agent_timer);
- _agent_reply_wait_type = -1;
+ _agent_reply_wait_type = VD_AGENT_END_MESSAGE;
}
break;
default:
diff --git a/client/red_client.h b/client/red_client.h
index ae52d9f2..7b04d083 100644
--- a/client/red_client.h
+++ b/client/red_client.h
@@ -318,7 +318,7 @@ private:
bool _notify_disconnect;
bool _auto_display_res;
DisplaySetting _display_setting;
- int _agent_reply_wait_type;
+ uint32_t _agent_reply_wait_type;
bool _aborting;
diff --git a/client/red_peer.cpp b/client/red_peer.cpp
index 08176d09..6ff58446 100644
--- a/client/red_peer.cpp
+++ b/client/red_peer.cpp
@@ -91,7 +91,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr)
THROW_ERR(SPICEC_ERROR_CODE_GETHOSTBYNAME_FAILED, "cannot resolve host address %s", host);
}
Lock lock(_lock);
- _peer = -1;
+ _peer = INVALID_SOCKET;
for (e = result; e != NULL; e = e->ai_next) {
if ((_peer = socket(e->ai_family, e->ai_socktype, e->ai_protocol)) == INVALID_SOCKET) {
int err = sock_error();
@@ -112,7 +112,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr)
LOG_INFO("Connect failed: %s (%d)",
sock_err_message(err), err);
closesocket(_peer);
- _peer = -1;
+ _peer = INVALID_SOCKET;
continue;
}
LOG_INFO("Connected to %s %s", uaddr, uport);
@@ -120,7 +120,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr)
}
lock.unlock();
freeaddrinfo(result);
- if (_peer == -1) {
+ if (_peer == INVALID_SOCKET) {
THROW_ERR(SPICEC_ERROR_CODE_CONNECT_FAILED, "failed to connect: %s (%d)",
sock_err_message(err), err);
}