diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/socket/socket.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Thu Oct 23 09:26:22 2008 NAKAMURA Usaku <usa@ruby-lang.org> + + * ext/socket/socket.c (sock_s_getservbyport): cast to get rid of + warning. + Thu Oct 23 08:06:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * ext/socket/socket.c (sock_s_getservbyport): port should be diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 8fe2dd3a6..06d9f337c 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -3254,7 +3254,7 @@ sock_s_getservbyport(int argc, VALUE *argv) if (NIL_P(proto)) proto = rb_str_new2("tcp"); StringValue(proto); - sp = getservbyport(htons(NUM2INT(port)), StringValueCStr(proto)); + sp = getservbyport(htons((uint16_t)NUM2INT(port)), StringValueCStr(proto)); if (!sp) { rb_raise(rb_eSocket, "no such service for port %d/%s", NUM2INT(port), RSTRING_PTR(proto)); } |