summaryrefslogtreecommitdiff
path: root/ext/socket/raddrinfo.c
diff options
context:
space:
mode:
authorwanabe <wanabe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-23 12:42:49 +0000
committerwanabe <wanabe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-23 12:42:49 +0000
commite63c5b3a62f387bb346fb7042911e253fa6d1a6b (patch)
treedc81d80a2d6cc3c3f704aebfff335e7a7b2ed783 /ext/socket/raddrinfo.c
parentd339fed3ad9b6002712a3da09f2a7cdc604b694b (diff)
* 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
Diffstat (limited to 'ext/socket/raddrinfo.c')
-rw-r--r--ext/socket/raddrinfo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index eff5d66..6d2a5e9 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -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;