mingw32 build: fixed using -1 as uninitialized value for unsigned variables

This commit is contained in:
Alon Levy 2010-12-06 17:55:45 +02:00
parent 06749bd66b
commit 1943352d60
3 changed files with 6 additions and 6 deletions

View File

@ -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:

View File

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

View File

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