Commit 9a052bd7 authored by Michael Jerris's avatar Michael Jerris

still MORE msvc 2005 warnings fixes

darcs-hash:20060912224733-16063-f5850a714d33ce1629c9efa9634dcc1ba23c3277.gz
parent 4d3e165c
......@@ -1175,7 +1175,7 @@ int readfile(su_home_t *home, FILE *f, void **contents, int add_trailing_lf)
}
if (!(buffer = su_alloc(home, len + 2)) ||
fread(buffer, 1, len, f) != len) {
fread(buffer, 1, len, f) != (unsigned)len) {
SU_DEBUG_1(("%s: unable to read file (%s)\n", __func__, strerror(errno)));
if (buffer)
su_free(home, buffer);
......
......@@ -344,7 +344,7 @@ msg_href_t const *msg_find_hclass(msg_mclass_t const *mc,
for (hr = NULL; (hc = mc->mc_hash[i].hr_class); i = (i + 1) % N) {
/* long form */
if (m == hc->hc_len && strncasecmp(s, hc->hc_name, m) == 0) {
if (m == (isize_t)(hc->hc_len) && strncasecmp(s, hc->hc_name, m) == 0) {
hr = &mc->mc_hash[i];
break;
}
......
......@@ -762,11 +762,11 @@ int nea_view_update(nea_server_t *nes,
primary_p = eevv = ev->ev_views + i;
/* Search for fakeness/eventlist/private view */
if (evv && (private || evv->evv_private || evv->evv_fake != fake)) {
if (evv && (private || evv->evv_private || evv->evv_fake != (unsigned)fake)) {
for (eevv = &evv->evv_next; (evv = *eevv); eevv = &evv->evv_next) {
if (private || evv->evv_private)
continue;
if (evv->evv_fake == fake)
if (evv->evv_fake == (unsigned)fake)
break;
}
}
......
......@@ -8808,7 +8808,8 @@ outgoing_answer_srv(sres_context_t *orq, sres_query_t *q,
/* Insert sorted by priority, randomly select by weigth */
while (selected) {
unsigned long weight = 0;
unsigned N = 0, priority = selected->sq_priority;
unsigned N = 0;
int32_t priority = selected->sq_priority;
/* Total weight of entries with same priority */
for (sq = selected; sq && priority == sq->sq_priority; sq = sq->sq_next) {
......
......@@ -921,7 +921,7 @@ msg_t *nua_creq_msg(nua_t *nua,
tag_type_t tag, tag_value_t value, ...)
{
struct nua_dialog_state *ds = nh->nh_ds;
msg_t *msg;
msg_t *msg = NULL;
sip_t *sip;
ta_list ta;
url_string_t const *url = NULL;
......
......@@ -447,7 +447,7 @@ sdp_origin_t *origin_dup(char **pp, sdp_origin_t const *src)
STR_DUP(p, o, src, o_username);
PTR_DUP(p, o, src, o_address, connection_dup);
assert(p - *pp == origin_xtra(src));
assert((size_t)(p - *pp) == origin_xtra(src));
*pp = p;
return o;
}
......@@ -470,7 +470,7 @@ sdp_connection_t *connection_dup(char **pp, sdp_connection_t const *src)
c->c_next = NULL;
STR_DUP(p, c, src, c_address);
assert(p - *pp == connection_xtra(src));
assert((size_t)(p - *pp) == connection_xtra(src));
*pp = p;
return c;
}
......@@ -493,7 +493,7 @@ sdp_bandwidth_t *bandwidth_dup(char **pp, sdp_bandwidth_t const *src)
b->b_next = NULL;
STR_DUP(p, b, src, b_modifier_name);
assert(p - *pp == bandwidth_xtra(src));
assert((size_t)(p - *pp) == bandwidth_xtra(src));
*pp = p;
return b;
}
......@@ -519,7 +519,7 @@ sdp_time_t *time_dup(char **pp, sdp_time_t const *src)
PTR_DUP(p, t, src, t_repeat, repeat_dup);
PTR_DUP(p, t, src, t_zone, zone_dup);
assert(p - *pp == time_xtra(src));
assert((size_t)(p - *pp) == time_xtra(src));
*pp = p;
return t;
}
......@@ -539,7 +539,7 @@ sdp_repeat_t *repeat_dup(char **pp, sdp_repeat_t const *src)
p = *pp;
STRUCT_DUP2(p, r, src);
assert(p - *pp == repeat_xtra(src));
assert((size_t)(p - *pp) == repeat_xtra(src));
*pp = p;
return r;
}
......@@ -559,7 +559,7 @@ sdp_zone_t *zone_dup(char **pp, sdp_zone_t const *src)
p = *pp;
STRUCT_DUP2(p, z, src);
assert(p - *pp == zone_xtra(src));
assert((size_t)(p - *pp) == zone_xtra(src));
*pp = p;
return z;
}
......@@ -584,7 +584,7 @@ sdp_key_t *key_dup(char **pp, sdp_key_t const *src)
STR_DUP(p, k, src, k_method_name);
STR_DUP(p, k, src, k_material);
assert(p - *pp == key_xtra(src));
assert((size_t)(p - *pp) == key_xtra(src));
*pp = p;
return k;
}
......@@ -610,7 +610,7 @@ sdp_attribute_t *attribute_dup(char **pp, sdp_attribute_t const *src)
STR_DUP(p, a, src, a_name);
STR_DUP(p, a, src, a_value);
assert(p - *pp == attribute_xtra(src));
assert((size_t)(p - *pp) == attribute_xtra(src));
*pp = p;
return a;
}
......@@ -662,7 +662,7 @@ sdp_media_t *media_dup(char **pp,
m->m_rejected = src->m_rejected;
m->m_mode = src->m_mode;
assert(p - *pp == media_xtra(src));
assert((size_t)(p - *pp) == media_xtra(src));
*pp = p;
return m;
}
......@@ -795,7 +795,7 @@ sdp_list_t *list_dup(char **pp, sdp_list_t const *src)
l->l_next = NULL;
STR_DUP(p, l, src, l_text);
assert(p - *pp == list_xtra(src));
assert((size_t)(p - *pp) == list_xtra(src));
*pp = p;
return l;
}
......@@ -823,7 +823,7 @@ sdp_rtpmap_t *rtpmap_dup(char **pp, sdp_rtpmap_t const *src)
STR_DUP(p, rm, src, rm_params);
STR_DUP(p, rm, src, rm_fmtp);
assert(p - *pp == rtpmap_xtra(src));
assert((size_t)(p - *pp) == rtpmap_xtra(src));
*pp = p;
return rm;
}
......@@ -935,7 +935,7 @@ sdp_session_t *session_dup(char **pp, sdp_session_t const *src)
STR_DUP(p, sdp, src, sdp_charset);
MED_DUP_ALL(p, sdp, src, sdp_media);
assert(p - *pp == session_xtra(src));
assert((size_t)(p - *pp) == session_xtra(src));
*pp = p;
return sdp;
}
......@@ -1005,7 +1005,7 @@ sdp_session_t *session_without_media_dup(char **pp, sdp_session_t const *src)
sdp->sdp_media = NULL;
assert(p - *pp == session_without_media_xtra(src));
assert((size_t)(p - *pp) == session_without_media_xtra(src));
*pp = p;
return sdp;
}
......
......@@ -134,11 +134,16 @@ sdp_parse(su_home_t *home, char const msg[], int msgsize, int flags)
{
sdp_parser_t *p;
char *b;
size_t len;
if (msgsize == -1 && msg)
msgsize = strlen(msg);
if (msgsize == -1 && msg) {
if ((len = strlen(msg)) > ISSIZE_MAX)
len = ISSIZE_MAX;
} else {
len = msgsize;
}
if (msgsize < 0 || msg == NULL) {
if (len < 0 || msg == NULL) {
p = su_home_clone(home, sizeof(*p));
if (p)
parsing_error(p, "invalid input message");
......@@ -147,10 +152,10 @@ sdp_parse(su_home_t *home, char const msg[], int msgsize, int flags)
return p;
}
p = su_home_clone(home, sizeof(*p) + msgsize + 1);
p = su_home_clone(home, sizeof(*p) + len + 1);
if (p) {
b = strncpy((void *)(p + 1), msg, msgsize);
b = strncpy((void *)(p + 1), msg, len);
b[msgsize] = 0;
p->pr_message = b;
......
......@@ -636,7 +636,7 @@ static void print_media(sdp_printer_t *p,
}
if (!p->pr_mode_manual && !m->m_rejected &&
(m->m_mode != session_mode || p->pr_mode_always)) {
(m->m_mode != (unsigned int)session_mode || p->pr_mode_always)) {
switch (m->m_mode) {
case sdp_inactive:
sdp_printf(p, "a=inactive" CRLF);
......
......@@ -892,7 +892,7 @@ static int sip_addr_update(msg_common_t *h,
static sip_addr_t *
sip_addr_make_url(su_home_t *home, msg_hclass_t *hc, url_string_t const *us)
{
size_t n;
issize_t n;
sip_header_t *h;
n = url_xtra(us->us_url);
......
......@@ -485,11 +485,11 @@ int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
change_session |= rtp_select != ss->ss_rtp_select;
change_session |= rtp_sort != ss->ss_rtp_sort;
change_session |= rtp_mismatch != ss->ss_rtp_mismatch;
change_session |= (unsigned)rtp_mismatch != ss->ss_rtp_mismatch;
change_session |= srtp_enable != ss->ss_srtp_enable;
change_session |= srtp_confidentiality != ss->ss_srtp_confidentiality;
change_session |= srtp_integrity != ss->ss_srtp_integrity;
change_session |= (unsigned)srtp_enable != ss->ss_srtp_enable;
change_session |= (unsigned)srtp_confidentiality != ss->ss_srtp_confidentiality;
change_session |= (unsigned)srtp_integrity != ss->ss_srtp_integrity;
ss->ss_af = af;
......
......@@ -766,7 +766,7 @@ int soa_sdp_reject_is_needed(sdp_session_t const *session,
}
else {
sdp_mode_t send_mode = (rm->m_mode & sdp_recvonly) ? sdp_sendonly : 0;
if (send_mode != (sm->m_mode & sdp_sendonly))
if ((unsigned int)send_mode != (sm->m_mode & sdp_sendonly))
return 1;
}
}
......@@ -843,7 +843,7 @@ int soa_sdp_mode_set_is_needed(sdp_session_t const *session,
if (rm) {
send_mode = (rm->m_mode & sdp_recvonly) ? sdp_sendonly : 0;
if (send_mode != (sm->m_mode & sdp_sendonly))
if ((unsigned int)send_mode != (sm->m_mode & sdp_sendonly))
return 1;
}
......
......@@ -1480,7 +1480,7 @@ sres_resolver_destructor(void *arg)
su_home_unref((su_home_t *)res->res_config->c_home);
if (res->res_updcb)
res->res_updcb(res->res_async, -1, -1);
res->res_updcb(res->res_async, (sres_socket_t)-1, (sres_socket_t)-1);
}
/*
......@@ -1801,7 +1801,7 @@ static int sres_parse_win32_reg_parse_dnsserver(sres_config_t *c, HKEY key, LPCT
#if __MINGW32__
DWORD name_servers_length = QUERY_DATALEN;
#else
int name_servers_length = QUERY_DATALEN;
DWORD name_servers_length = QUERY_DATALEN;
#endif
int ret, servers_added = 0;
......@@ -1809,7 +1809,7 @@ static int sres_parse_win32_reg_parse_dnsserver(sres_config_t *c, HKEY key, LPCT
while((ret = RegQueryValueEx(key,
lpValueName,
NULL, NULL,
name_servers,
(LPBYTE)name_servers,
&name_servers_length)) == ERROR_MORE_DATA) {
name_servers_length += QUERY_DATALEN;
......@@ -1874,6 +1874,7 @@ static int sres_parse_win32_reg(sres_config_t *c)
#endif
int found = 0;
char *interface_guid = su_alloc(home, MAX_VALUE_NAME_LEN);
#if 0
#if __MINGW32__
DWORD guid_size = QUERY_DATALEN;
#else
......@@ -1884,7 +1885,6 @@ static int sres_parse_win32_reg(sres_config_t *c)
* - this is currently disabled 2006/Jun (the current check might insert
* multiple unnecessary nameservers to the search list)
*/
#if 0
/* open the 'Interfaces' registry Key */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces",
......@@ -2272,7 +2272,7 @@ sres_server_t **sres_servers_new(sres_resolver_t *res,
servers = su_zalloc(res->res_home, size); if (!servers) return servers;
dns = (void *)(servers + N + 1);
for (i = 0; i < N; i++) {
dns->dns_socket = -1;
dns->dns_socket = (sres_socket_t)-1;
ns = c->c_nameservers[i];
memcpy(dns->dns_addr, ns->ns_addr, dns->dns_addrlen = ns->ns_addrlen);
inet_ntop(dns->dns_addr->ss_family, SS_ADDR(dns->dns_addr),
......@@ -2299,7 +2299,7 @@ void sres_servers_close(sres_resolver_t *res,
if (servers[i]->dns_socket != -1) {
if (res->res_updcb)
res->res_updcb(res->res_async, -1, servers[i]->dns_socket);
res->res_updcb(res->res_async, (sres_socket_t)-1, servers[i]->dns_socket);
closesocket(servers[i]->dns_socket);
}
}
......@@ -2378,16 +2378,16 @@ sres_socket_t sres_server_socket(sres_resolver_t *res, sres_server_t *dns)
ntohs(((struct sockaddr_in *)dns->dns_addr)->sin_port)));
closesocket(s);
dns->dns_error = time(NULL);
return -1;
return (sres_socket_t)-1;
}
if (res->res_updcb) {
if (res->res_updcb(res->res_async, s, -1) < 0) {
if (res->res_updcb(res->res_async, s, (sres_socket_t)-1) < 0) {
SU_DEBUG_1(("%s: %s: %s\n", "sres_server_socket", "update callback",
su_strerror(su_errno())));
closesocket(s);
dns->dns_error = time(NULL);
return -1;
return (sres_socket_t)-1;
}
}
......@@ -2478,7 +2478,7 @@ sres_send_dns_query(sres_resolver_t *res,
s = sres_server_socket(res, dns);
/* Send the DNS message via the UDP socket */
if (s != -1 && send(s, m->m_data, size, 0) == size)
if (s != -1 && send(s, (void *)(m->m_data), size, 0) == (int)size)
break;
error = su_errno();
......@@ -2793,7 +2793,7 @@ int sres_resolver_sockets(sres_resolver_t *res,
sres_socket_t *return_sockets,
int n)
{
sres_socket_t s = -1;
sres_socket_t s = (sres_socket_t)-1;
int i, retval;
if (!sres_resolver_set_async(res, sres_no_update,
......@@ -3061,7 +3061,7 @@ sres_resolver_receive(sres_resolver_t *res, int socket)
memset(m, 0, offsetof(sres_message_t, m_data));
num_bytes = recvfrom(socket, m->m_data, sizeof (m->m_data), 0,
num_bytes = recvfrom(socket, (void *)(m->m_data), sizeof (m->m_data), 0,
(void *)from, &fromlen);
if (num_bytes <= 0) {
......
......@@ -112,7 +112,7 @@ int sres_blocking_update(sres_blocking_t *b,
if (old_socket != -1) {
for (i = 0; i < N; i++) {
if (b->fds[i].fd == old_socket)
if (b->fds[i].fd == (int)old_socket)
break;
}
if (i == N)
......@@ -172,8 +172,8 @@ int sres_blocking_complete(sres_blocking_context_t *c)
timeval->tv_usec = 500000;
for (i = 0, n = 0; i < c->block->n_sockets; i++) {
FD_SET(c->block->fds[i].fd, readfds);
FD_SET(c->block->fds[i].fd, errorfds);
FD_SET((sres_socket_t)(c->block->fds[i].fd), readfds);
FD_SET((sres_socket_t)(c->block->fds[i].fd), errorfds);
if (c->block->fds[i].fd >= n)
n = c->block->fds[i].fd + 1;
}
......
......@@ -155,7 +155,7 @@ sres_resolver_destroy(sres_resolver_t *res)
if (srs == NULL)
return su_seterrno(EINVAL);
sres_sofia_update(srs, -1, -1); /* Remove sockets from too, zap timers. */
sres_sofia_update(srs, (su_socket_t)-1, (su_socket_t)-1); /* Remove sockets from too, zap timers. */
sres_resolver_unref(res);
......@@ -205,7 +205,7 @@ static int sres_sofia_update(sres_sofia_t *srs,
if (old_socket != -1)
for (i = 0; i < N; i++)
if ((srs->srs_reg + i)->reg_socket == old_socket) {
if ((su_socket_t)((srs->srs_reg + i)->reg_socket) == old_socket) {
old_reg = srs->srs_reg + i;
break;
}
......@@ -244,7 +244,7 @@ static int sres_sofia_update(sres_sofia_t *srs,
}
if (old_reg) {
if (old_socket == srs->srs_socket)
if (old_socket == (su_socket_t)(srs->srs_socket))
srs->srs_socket = -1;
su_root_deregister(srs->srs_root, old_reg->reg_index);
memset(old_reg, 0, sizeof *old_reg);
......@@ -290,7 +290,7 @@ su_socket_t sres_resolver_root_socket(sres_resolver_t *res)
return su_seterrno(EINVAL);
if (sres_resolver_set_async(res, sres_sofia_update, srs, 1) < 0)
return -1;
return (su_socket_t)-1;
if (srs->srs_socket != SOCKET_ERROR)
return srs->srs_socket;
......@@ -306,7 +306,7 @@ su_socket_t sres_resolver_root_socket(sres_resolver_t *res)
else {
su_socket_t socket;
if (sres_resolver_sockets(res, &socket, 1) < 0)
return -1;
return (su_socket_t)-1;
}
return srs->srs_socket;
......
......@@ -1050,7 +1050,7 @@ int stun_bind(stun_handle_t *sh,
tag_type_t tag, tag_value_t value,
...)
{
su_socket_t s = SOCKET_ERROR;
su_socket_t s = (su_socket_t)SOCKET_ERROR;
stun_request_t *req = NULL;
stun_discovery_t *sd = NULL;
ta_list ta;
......@@ -1219,7 +1219,7 @@ int stun_test_nattype(stun_handle_t *sh,
stun_request_t *req = NULL;
stun_discovery_t *sd = NULL;
su_sockaddr_t bind_addr;
su_socket_t s = SOCKET_ERROR;
su_socket_t s = (su_socket_t)SOCKET_ERROR;
socklen_t bind_len;
su_sockaddr_t *destination = NULL;
......@@ -1715,7 +1715,7 @@ static int stun_bind_callback(stun_magic_t *m, su_wait_t *w, su_wakeup_arg_t *ar
/* receive response */
recv_len = sizeof(recv);
dgram_len = recvfrom(s, dgram, sizeof(dgram), 0, (struct sockaddr *) &recv,
dgram_len = recvfrom(s, (void *)dgram, sizeof(dgram), 0, (struct sockaddr *) &recv,
&recv_len);
err = errno;
if ((dgram_len < 0) && (err != EAGAIN)) {
......@@ -2726,7 +2726,7 @@ int stun_test_lifetime(stun_handle_t *sh,
stun_request_t *req = NULL;
stun_discovery_t *sd = NULL;
ta_list ta;
su_socket_t s = SOCKET_ERROR;
su_socket_t s = (su_socket_t)SOCKET_ERROR;
int err, index = 0, s_reg = 0;
char ipaddr[SU_ADDRSIZE + 2] = { 0 };
char const *server = NULL;
......@@ -2960,7 +2960,7 @@ int stun_keepalive(stun_handle_t *sh,
tag_type_t tag, tag_value_t value,
...)
{
su_socket_t s = SOCKET_ERROR;
su_socket_t s = (su_socket_t)SOCKET_ERROR;
unsigned int timeout = 0;
ta_list ta;
stun_discovery_t *sd;
......
......@@ -616,7 +616,7 @@ int stun_send_message(su_socket_t s, su_sockaddr_t *to_addr,
stun_encode_message(msg, pwd);
err = sendto(s, msg->enc_buf.data, msg->enc_buf.size,
err = sendto(s, (const void *)(msg->enc_buf.data), msg->enc_buf.size,
0, (struct sockaddr *)to_addr, sizeof(struct sockaddr_in));
free(msg->enc_buf.data), msg->enc_buf.data = NULL;
......@@ -705,7 +705,6 @@ int stun_encode_message(stun_msg_t *msg, stun_buffer_t *pwd) {
z = stun_encode_error_code(attr);
default:
break;
z = 0;
}
if(z < 0) return z;
......
......@@ -160,7 +160,7 @@ stun_dns_lookup_t *stun_dns_lookup(stun_magic_t *magic,
}
else {
sres_resolver_destroy(self->stun_sres);
self->stun_socket = SOCKET_ERROR;
self->stun_socket = (su_socket_t)SOCKET_ERROR;
su_free(NULL, self), self = NULL;
}
}
......
......@@ -299,7 +299,7 @@ int process_3489_request(stun_mini_t *mini,
}
for (ss = mini->sockets; ss; ss = ss->ss_next)
if (socket == ss->ss_socket)
if ((su_socket_t)socket == ss->ss_socket)
break;
if (ss == NULL) {
......
......@@ -45,10 +45,7 @@ static int inet_pton6(const char *src, unsigned char *dst);
* Paul Vixie, 1996.
*/
int
inet_pton(af, src, dst)
int af;
const char *src;
void *dst;
inet_pton(int af, const char * src, void * dst)
{
switch (af) {
case AF_INET:
......@@ -75,9 +72,7 @@ inet_pton(af, src, dst)
* Paul Vixie, 1996.
*/
static int
inet_pton4(src, dst)
const char *src;
unsigned char *dst;
inet_pton4(const char *src, unsigned char *dst)
{
static const char digits[] = "0123456789";
int saw_digit, octets, ch;
......@@ -132,9 +127,7 @@ inet_pton4(src, dst)
* Paul Vixie, 1996.
*/
static int
inet_pton6(src, dst)
const char *src;
unsigned char *dst;
inet_pton6(const char *src, unsigned char *dst)
{
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
......
......@@ -117,7 +117,7 @@ typedef struct {
(ta).tl[1].t_tag = tag_next; \
(ta).tl[1].t_value = (tag_value_t)(&(v) + 1); \
} else { \
(ta).tl[1].t_value = 0; (ta).tl[1].t_value = (tag_value_t)0; \
(ta).tl[1].t_tag = 0; (ta).tl[1].t_value = (tag_value_t)0; \
} \
} while(0)
#else
......
......@@ -95,15 +95,15 @@ static char cvtIn[] = {
*/
unsigned longlong
strtoull(string, endPtr, base)
const char *string; /* String of ASCII digits, possibly
strtoull(const char *string, char **endPtr, int base)
/* const char *string; String of ASCII digits, possibly
* preceded by white space. For bases
* greater than 10, either lower- or
* upper-case digits may be used.
*/
char **endPtr; /* Where to store address of terminating
/* char **endPtr; Where to store address of terminating
* character, or NULL. */
int base; /* Base for conversion. Must be less
/* int base; Base for conversion. Must be less
* than 37. If 0, then the base is chosen
* from the leading characters of string:
* "0x" means hex, "0" means octal, anything
......
......@@ -207,7 +207,7 @@ issize_t su_vsend(su_socket_t s,
su_sockaddr_t const *su, socklen_t sulen)
{
int ret;
DWORD bytes_sent = -1;
DWORD bytes_sent = 0;
ret = WSASendTo(s,
(LPWSABUF)iov,
......@@ -230,7 +230,7 @@ issize_t su_vrecv(su_socket_t s, su_iovec_t iov[], isize_t iovlen, int flags,
su_sockaddr_t *su, socklen_t *sulen)
{
int ret;
DWORD bytes_recv = -1;
DWORD bytes_recv = 0;
DWORD dflags = flags;
int fromlen = sulen ? *sulen : 0;
......
......@@ -92,8 +92,8 @@ int su_home_threadsafe(su_home_t *home)
/* Avoid linking pthread library just for memory management */
su_home_mutex_locker = mutex_locker;
su_home_mutex_unlocker = mutex_unlocker;
su_home_locker = (void *)pthread_mutex_lock;
su_home_unlocker = (void *)pthread_mutex_unlock;
su_home_locker = (void (*)(void *))pthread_mutex_lock;
su_home_unlocker = (void (*)(void *))pthread_mutex_unlock;
}
mutex = su_alloc(home, 2 * sizeof (pthread_mutex_t));
......
......@@ -1326,7 +1326,7 @@ int localinfo0(su_localinfo_t const *hints, su_localinfo_t **rresult)
#endif
char buffer[2048];
} b = {{ 1 }};
socklen_t salen = sizeof(b);
DWORD salen = sizeof(b);
int i, error = -1;
#if SU_HAVE_IN6
int v4_mapped = (hints->li_flags & LI_V4MAPPED) != 0;
......
......@@ -245,14 +245,16 @@ su_network_changed_t
su_network_changed_f *network_changed_cb,
su_network_changed_magic_t *magic)
{
#if defined (__APPLE_CC__)
su_network_changed_t *snc = NULL;
#endif
assert(home && root && network_changed_cb && magic);
/* Not implemented for others than OSX */
#if !defined (__APPLE_CC__)
return NULL;
#endif
#else
snc = su_zalloc(home, sizeof *snc);
......@@ -271,6 +273,7 @@ su_network_changed_t
}
return snc;
#endif
}
int su_root_remove_network_changed(su_root_t *root)
......
......@@ -465,9 +465,9 @@ void su_port_destroy(su_port_t *self)
su_port_unregister(self, NULL, &self->sup_mbox_wait, NULL,
(su_wakeup_arg_t *)self->sup_mbox);
su_wait_destroy(&self->sup_mbox_wait);
su_close(self->sup_mbox[0]); self->sup_mbox[0] = SOCKET_ERROR;
su_close(self->sup_mbox[0]); self->sup_mbox[0] = (su_socket_t)SOCKET_ERROR;
#if HAVE_SOCKETPAIR
su_close(self->sup_mbox[1]); self->sup_mbox[1] = SOCKET_ERROR;
su_close(self->sup_mbox[1]); self->sup_mbox[1] = (su_socket_t)SOCKET_ERROR;
#endif
SU_DEBUG_9(("su_port_destroy() close mailbox\n"));
}
......@@ -1159,7 +1159,9 @@ int su_port_wait_events(su_port_t *self, su_duration_t tout)
int i, events = 0;
su_wait_t *waits = self->sup_waits;
unsigned n = self->sup_n_waits;
#if HAVE_POLL
unsigned version = self->sup_registers;
#endif
su_root_t *root;
i = su_wait(waits, n, tout);
......
......@@ -536,7 +536,7 @@ tport_primary_t *tport_alloc_primary(tport_master_t *mr,
tp->tp_master = mr;
tp->tp_pri = pri;
tp->tp_socket = SOCKET_ERROR;
tp->tp_socket = (su_socket_t)SOCKET_ERROR;
tp->tp_magic = mr->mr_master->tp_magic;
......@@ -1003,7 +1003,7 @@ void tport_zap_secondary(tport_t *self)
self->tp_index = 0;
if (self->tp_socket != -1)
su_close(self->tp_socket);
self->tp_socket = -1;
self->tp_socket = (su_socket_t)-1;
su_home_zap(self->tp_home);
}
......@@ -2340,7 +2340,7 @@ int tport_accept(tport_primary_t *pri, int events)
su_addrinfo_t ai[1];
su_sockaddr_t su[1];
socklen_t sulen = sizeof su;
su_socket_t s = SOCKET_ERROR, l = pri->pri_primary->tp_socket;
su_socket_t s = (su_socket_t)SOCKET_ERROR, l = pri->pri_primary->tp_socket;
char const *reason = "accept";
if (events & SU_WAIT_ERR)
......@@ -3866,7 +3866,8 @@ int tport_release(tport_t *self,
int
tport_pending_error(tport_t *self, su_sockaddr_t const *dst, int error)
{
unsigned i, reported, callbacks;
unsigned i, callbacks;
int reported;
tport_pending_t *pending;
msg_t *msg;
su_addrinfo_t const *ai;
......@@ -3911,7 +3912,8 @@ tport_pending_error(tport_t *self, su_sockaddr_t const *dst, int error)
int
tport_pending_errmsg(tport_t *self, msg_t *msg, int error)
{
unsigned i, reported, callbacks;
unsigned i, callbacks;
int reported;
tport_pending_t *pending;
assert(self); assert(msg);
......@@ -4116,7 +4118,8 @@ tport_t *tport_by_name(tport_t const *self, tp_name_t const *tpn)
comp = tport_canonize_comp(tpn->tpn_comp);