mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/raddrinfo.c (init_addrinfo, inspect_sockaddr): suppress
warnings. see [ruby-core:31932]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d339fed3ad
commit
e63c5b3a62
2 changed files with 10 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Sep 23 21:40:40 2010 wanabe <s.wanabe@gmail.com>
|
||||
|
||||
* ext/socket/raddrinfo.c (init_addrinfo, inspect_sockaddr): suppress
|
||||
warnings. see [ruby-core:31932].
|
||||
|
||||
Thu Sep 23 19:27:57 2010 wanabe <s.wanabe@gmail.com>
|
||||
|
||||
* thread_win32.c (w32_wait_events, w32_close_handle): suppress warnings.
|
||||
|
|
|
@ -579,7 +579,7 @@ init_addrinfo(rb_addrinfo_t *rai, struct sockaddr *sa, socklen_t len,
|
|||
int pfamily, int socktype, int protocol,
|
||||
VALUE canonname, VALUE inspectname)
|
||||
{
|
||||
if (sizeof(rai->addr) < len)
|
||||
if ((socklen_t)sizeof(rai->addr) < len)
|
||||
rb_raise(rb_eArgError, "sockaddr string too big");
|
||||
memcpy((void *)&rai->addr, (void *)sa, len);
|
||||
rai->sockaddr_len = len;
|
||||
|
@ -937,7 +937,7 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
|
|||
{
|
||||
struct sockaddr_in *addr;
|
||||
int port;
|
||||
if (rai->sockaddr_len < sizeof(struct sockaddr_in)) {
|
||||
if (rai->sockaddr_len < (socklen_t)sizeof(struct sockaddr_in)) {
|
||||
rb_str_cat2(ret, "too-short-AF_INET-sockaddr");
|
||||
}
|
||||
else {
|
||||
|
@ -950,7 +950,7 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
|
|||
port = ntohs(addr->sin_port);
|
||||
if (port)
|
||||
rb_str_catf(ret, ":%d", port);
|
||||
if (sizeof(struct sockaddr_in) < rai->sockaddr_len)
|
||||
if ((socklen_t)sizeof(struct sockaddr_in) < rai->sockaddr_len)
|
||||
rb_str_catf(ret, "(sockaddr %d bytes too long)", (int)(rai->sockaddr_len - sizeof(struct sockaddr_in)));
|
||||
}
|
||||
break;
|
||||
|
@ -963,7 +963,7 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
|
|||
char hbuf[1024];
|
||||
int port;
|
||||
int error;
|
||||
if (rai->sockaddr_len < sizeof(struct sockaddr_in6)) {
|
||||
if (rai->sockaddr_len < (socklen_t)sizeof(struct sockaddr_in6)) {
|
||||
rb_str_cat2(ret, "too-short-AF_INET6-sockaddr");
|
||||
}
|
||||
else {
|
||||
|
@ -985,7 +985,7 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
|
|||
port = ntohs(addr->sin6_port);
|
||||
rb_str_catf(ret, "[%s]:%d", hbuf, port);
|
||||
}
|
||||
if (sizeof(struct sockaddr_in6) < rai->sockaddr_len)
|
||||
if ((socklen_t)sizeof(struct sockaddr_in6) < rai->sockaddr_len)
|
||||
rb_str_catf(ret, "(sockaddr %d bytes too long)", (int)(rai->sockaddr_len - sizeof(struct sockaddr_in6)));
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue